EBC Exercise 50 Setting Up Node-Red
Embedded Linux Class by Mark A. Yoder
Node-RED is a programming tool for wiring together hardware devices, APIs and online services in new and interesting ways.([1])
The following is based on https://groups.google.com/g/beagleboard/c/b7PZXB7JbmA/m/SEB0qTK2AAAJ.
Install
First make sure you have the current version of Node-Red.
bone$ dpkg --list | grep node-red ii bb-node-red-installer 1.2.2-0rcnee2~buster+20201021 armhf Node-RED installer for beagleboard.org
If yours is older do the following.
bone$ sudo apt update bone$ sudo apt install bb-node-red-installer bone$ sudo reboot
Accessing on the Bone
Point your browser to http://192.168.7.2:1880/
.
After a bit you will see the Node-Red canvas.
Copy the code below to the clipboard.
[{"id":"70fd05e2.f03d0c","type":"tab","label":"Flow 1","disabled":false,"info":""},{"id":"b1dc9221.09e41","type":"gpio out","z":"70fd05e2.f03d0c","name":"","state":"OUTPUT","pin":"P9_15","i2cDelay":"0","i2cAddress":"","i2cRegister":"","outputs":0,"board":"14fb0dec.376712","x":610,"y":180,"wires":[]},{"id":"acb4df30.72216","type":"inject","z":"70fd05e2.f03d0c","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"1","payloadType":"num","x":370,"y":180,"wires":"b1dc9221.09e41"},{"id":"35e9479e.0e2428","type":"inject","z":"70fd05e2.f03d0c","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"0","payloadType":"str","x":370,"y":220,"wires":"b1dc9221.09e41"},{"id":"cca6a964.c0e978","type":"gpio out","z":"70fd05e2.f03d0c","name":"","state":"OUTPUT","pin":"USR3","i2cDelay":"0","i2cAddress":"","i2cRegister":"","outputs":0,"board":"14fb0dec.376712","x":610,"y":280,"wires":[]},{"id":"b9def222.f9a97","type":"inject","z":"70fd05e2.f03d0c","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"1","payloadType":"num","x":370,"y":280,"wires":"cca6a964.c0e978"},{"id":"230706ad.dbc7ea","type":"inject","z":"70fd05e2.f03d0c","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"0","payloadType":"str","x":370,"y":320,"wires":"cca6a964.c0e978"},{"id":"14fb0dec.376712","type":"ioplugin","name":"","username":"","password":"","boardType":"beaglebone-io","serialportName":"","connectionType":"local","mqttServer":"","pubTopic":"","subTopic":"","tcpHost":"","tcpPort":"","sparkId":"","sparkToken":"","beanId":"","impId":"","uuid":"","token":"","sendUuid":"","samplingInterval":"500"}]
Go to the hamburger stack to the right of the red Deploy button and select Import. Paste the above into the window.
Click Import.
You should see.
Try clicking on the 1's and 0's and USR3 and P9_14 will respond.
Embedded Linux Class by Mark A. Yoder