https://github.com/johnwalicki/tjbot-node-red
TJBot Node-RED Examples that use Watson Cognitive APIs
https://github.com/johnwalicki/tjbot-node-red
Last synced: 2 months ago
JSON representation
TJBot Node-RED Examples that use Watson Cognitive APIs
- Host: GitHub
- URL: https://github.com/johnwalicki/tjbot-node-red
- Owner: johnwalicki
- License: apache-2.0
- Created: 2017-07-20T16:22:41.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2017-10-02T05:06:21.000Z (over 7 years ago)
- Last Synced: 2024-12-25T20:11:46.683Z (4 months ago)
- Size: 1.24 MB
- Stars: 10
- Watchers: 2
- Forks: 16
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# TJBot Node-RED Examples
These TJBot Node-RED flows are an easy way to get started with bringing TJBot to Life.
Node-RED is a great way to teach developers about programming without dropping them down into Node.js code.These TJBot Node-RED recipes showcase:
* Twitter Tone Analysis (blinks the LED colors and waves his arm on joyful tweets)
* Speech to Text to control the LED color and waves his arm
* Weather report
* TJBot LED Party is a simple flow that randomly generates colors / blinks the TJBot NeoPixel
* Watson Visual Recognition Image Classification and Text Extraction using a Pi CameraThere are screenshots posted so you can see the Node-RED flows in the Pictures directory.
If you're interested in trying these recipes on your TJBot / Raspberry Pi, find them here:
https://github.com/johnwalicki/TJBot-Node-RED/flows## Node-RED flows in this repository:
This flow listens to a Twitter feed, calls Tone Analyzer, speaks the Tweets, blinks the NeoPixel different colors based on tone scores, and waves TJBots arm on joyful tweets.

___
This flow records speech from a Raspberry Pi microphone. Ask TJBot the *weather*, say a *color* to set the LED, get down to *Party*, or ask TJBot to *wave* his arm.

___
This flow announces the current Weather Conditions using Text to Speech.

___
TJBot loves to party so I created a simple flow that randomly generates colors and blinks the TJBot NeoPixel.

___
I've taught TJBot to read and identify images by using Watson Visual Recognition and Text Extraction.

A browser screenshot of the "TJBot Cam" Node-RED Dashboard that shows Image Classification.

A browser screenshot of the "TJBot Cam" Node-RED Dashboard that shows Text Extraction.
## Node-RED Dependencies and Install Instructions
These flows use a variety of Node-RED nodes that you might need to install on your Raspberry Pi.
* node-red-node-watson
* node-red-dashboard
* node-red-contrib-camerapi
* node-red-contrib-micropi
* node-red-contrib-speakerpi
* node-red-node-base64
* node-red-contrib-play-audio
* node-red-node-pi-neopixel
* node-red-node-weather-undergroundHere are install and configuration instructions that will set up all of the node-red nodes onto your Raspberry Pi. Remember to restart the Node-RED service or reboot the Raspberry Pi after the installs complete. The --unsafe-perm is required for the successful installation of node-red-contrib-speakerpi. The libasound2-dev dependency is required for the compile of node-red-contrib-speakerpi which needs a header file alsa/asoundlib.h provided by libasound2-dev
```
$ sudo apt-get install libasound2-dev
$ sudo chmod 777 /usr/lib/node_modules
$ mkdir /home/pi/audio
```
If you have not configured ALSA and the MicroPi / SpeakerPi nodes on your Raspberry Pi, you might need to remove the following parameter from /boot/config.txt
```
# Enable audio (loads snd_bcm2835)
# dtparam=audio=on
```
You might also want to make certain that you are not blacklisting too many modules in /etc/modprobe.d/*.confFinally, run this npm command:
```
$ sudo npm --unsafe-perm -g install node-red-node-watson node-red-dashboard node-red-contrib-camerapi node-red-node-base64 node-red-contrib-play-audio node-red-contrib-micropi node-red-node-pi-neopixel node-red-node-weather-underground node-red-contrib-speakerpi
```