-
Notifications
You must be signed in to change notification settings - Fork 5
Importing the Node RED flows
This git repo contains 2 flows for Node-RED in the flows folder. One called Test.flow, which allows you to test the setup of all the hardware components to verify that they can be driven from Node-RED (Speaker, Microphone, RGB LED, Servo to wave arm, SenseHAT and the camera). The other flow, TobyJnr.flow is an example which pulls all the hardware components together with a number of IBM Cloud cognitive services (visual recognition, speech to text, text to speech, weather service, tone analysis and conversation) in addition to other Node-RED features, such as the dashboard, to build a working bot.
The wiki sections following this section will cover each of the services in turn, so you will understand the services and be able to extend the example flow or create your own applications using the services.
To add the flows to Node-RED you need to open a web browser and navigate to the Node-RED editor running on the Raspberry Pi inside your bot. You can use a browser running on your laptop or workstation, so long as it can communicate with the Raspberry Pi over your local network. The browser doesn't need to be running on the Raspberry Pi.
The editor runs on port 1880, so the URL will be http://:1880. In the setup section I set my Raspberry Pi hostname as bi-tobyjnr, so the URL I can use is http://bi-tobyjnr.local:1880. If local name resolution is not working for you then you can simply use the IP address for your Raspberry Pi, e.g. http://192.168.0.10:1880, replacing 192.168.0.10 with the IP address of your pi (you can get this by running hostname -I
on the command line of the Raspberry Pi).
Once in the Node-RED editor, open the top menu then select import -> clipboard this will open a dialog box where you can import the flow. Node-RED flows are JSON document, so you can choose to clone or download this git repository then open the flow file in a text editor to then copy it to your system clipboard (ensure it is not a word processor which may replace certain characters with smart-characters to improve appearance, as this will invalidate the JSON document). Alternatively you can simply open up the file in the browser and copy from the browser to your system clipboard. When the file content has been pasted into the dialog box press the import button. The flow is now linked to your mouse cursor, allowing you to place the flow at the desired location on the editor sheet.