Configuring the MQTT Publish and Subscribe Nodes in Node-Red

Node-Red provides both an MQTT subscribe (input) and publish (output) node. The configuration for these nodes are almost Identical as the main part of the configuration concerns the actual client connection. Because of this it is useful to think of the publish and subscribe nodes as consisting of two components as shown in the schematic below: Before we look a the actual configuration we will look at MQTT client connections in general.

Continue reading

Logging MQTT Sensor Data -Notes

Data from sensors will need to be stored. But how much data do you really need to store? Many sensors like state sensors (ON/OFF), temperature etc will fluctuate very little over the course of a day so does it makes sense to store the same sensor value every x seconds?

Continue reading

Node-Red Setup and Admin Notes

Note: Working Notes Node red uses a settings file called settings.js located in in the user .node-re folder in their home directory. You can create your own settings file and customise it either by copying the existing file or using the file available from Github here. On Linux the settings.js file is copied from the /usr/lib/node-modules/node-red/ folder  to your .node-red folder in your home directory when you start node-red and no settings.js file is present. On windows if no settings.js file is present in the home folder then the node-red start process stops with an error. To use your own

Continue reading

Storing Data in Node-Red Variables

Node-red nodes pass the msg object between nodes. However this object is replaced by the next msg object. So how do you store data between node calls? Node-Red provides three mechanisms: The context object -stores data for a node The Flow object – stores data for a flow The global object -stores data for the canvas

Continue reading

MQTT-SN RSMB Broker Install and Configuration

Important Note: The RSMB broker is no longer being actively developed. There is an MQTT-SN t MQTT Gateway available that is in active development and being supoorted by the original author or the RSMB broker (Ian Graggs). This post contains the details as well as links to download the gateway and embedded C client. You can download the RSMB ( Really small message broker here here. Unzip it. When you unzip it you should see a directory structure like the one below:

Continue reading

Using The Python MQTT-SN Client

There is a Python client included with the RSMB src files. You can download the RSMB ( Really small message broker here here. The client is written in python2.7 and consists of 4 files. The MQTTSN.py handles the packet packing and unpacking, and you don’t need to edit this.

Continue reading