FRED is a cloud hosted node-red server provided by the awesome folks at Sense Tecnic. FRED allows you to run a reliable, centralized node-red instance in the cloud for easy prototyping and deployment of your Internet of Things application.

Wouldn’t it be great if you could get the sensor data from the PiShield into the cloud? Well, now you can – There is a FRED node that allows you to do just that! By instantiating the “FRED” nodes on the server and client side, you can hook up data from your local flow into the cloud and vice versa.

Here we first see the “client” side running on the Raspberry Pi: It’s based on the simple sensor interface example, but with the FRED nodes added. Inside the settings of the FRED node, you will be entering the name of the endpoint (must match what you do on the remote node), as well as your username.

The Fred input node allows you to send data to FRED, and the output node gets data from FRED. The first time you bring in a FRED node, make sure you go into the settings and edit the server information, as well as your username (the name you use to login on the FRED server). You only have to do this once, and only for the local flow:

screen-shot-2016-10-11-at-4-23-52-pm

For now leave the “Private Endpoint” bit unchecked, but for anything important it is recommended to use that option (see link at bottom of this page for more info).

screen-shot-2016-10-11-at-4-11-57-pm

The “Change” node is an Rbe node that filters out sensor values unless it has changed. (Called “change” based on the Max/MSP object, not to be confused with the “Change” node in node-red!). This is done to prevent constant flooding of the values that are streamed by the sensors.

On the FRED server side, we see the following flow:

screen-shot-2016-10-11-at-4-15-23-pm

Here, the nodes function the same way: the input node gets data from the remote client, and the output node sends it to the client. Make sure the endpoint name of the FRED nodes match the ones on the client side! (PiShieldTest) in this case. You won’t have to input your username here since its inside FRED already!

Once connected, we can now communicate from our local node-red flow to the remote FRED instance. Pretty neat eh?

For more information, including how to set up a secured connection using your Fred API key, check out the official tutorial here.