Node-Red: The interesting world of API

The pi I have running at home had accumulated alot of updates. Anyone who owns a pi can tell you that a small collection of updates can take an exceedingly long time to complete. About 20 minutes into the upgrade, I noticed apt stalling on one particular package : node-red. Knowing that it’s not usually included in a standard installation, I did some digging and found something interesting.

Node-red is a graphical wiring program that allows you to do some cool things with different API’s. I mean, really interesting things.

Starting it up for the first time, it listened to port 1880 and told me to connect via a browser. What then arose was a brilliant piece of technology.

A scratch like interface with pastel coloured buttons and brief descriptions about their purpose filled the left colomn. Those are, as I understand, the nodes. Simply dragging and dropping these building blocks and linking them up felt seamless; some functional boxes for different languages such as html, xml and json. Switches to initialise case logic, splitters to manipulate the direction of data and in and out nodes for twitter implementation. Also for the pi, nodes to make use of gpio pins for muchly anything you can think of. This is for the makers. Brilliant.

To my surprise (and burden however), there’s not a great deal of documentation that I could find for this platform. There a few tutorials for the very basics but when it came to slightly more complex stuff, it’s almost non existant. Either way, I plugged on and crafted a twitter bot as an excersise; expanding on some of the basic tutorials on YouTube. My first small ‘flow’ was a program that pinged to a network address and recorded the time and latency in a text file. Pretty low grade but if I wanted to, I could expand to tweet myself a message if the ttl lapsed.

I’m still unsure of the language used in main function block, it looks like java (being objective) but I don’t know enough about it to know exactly. I would like to make my @awkwardbot_ a bit more intelligent but will need to dig deeper into this exciting framework.