IOT data from sensors and other devices usually comes as either a text string usually with key value pairs or more commonly as JSON encoded data. Databases accept a variety of data formats the most common are INT and TEXT.
Continue readingCategory: Node-Red
Node-Red Settings.js File – Node-Red Admin
Node red uses a settings file called settings.js located in in the user .node-red (dot node-red) 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 there is no settings.js file present.
Continue readingUsing The Node-Red Library
If you want to save a flow or function and reuse it later in another flow on the same computer then you can save it to the local library. To save a flow to the library highlight all nodes in the flow by using CTRL+A then use the main menu (top right) and select Export>Library.
Continue readingDeploying Node-Red Flows
When you come to deploying a flow you have four (node-red v0.2)options as shown below: Although the choices appear obvious the effect of the options isn’t and can cause some confusion.
Continue readingUnderstanding and Using Buffers In Node-Red
When data is read from a file or network it is read byte by byte into a data buffer. Data Buffers are temporary storage used for transferring data. To work with binary data we will need access to these buffers.
Continue readingWorking with JSON Data And JavaScript Objects in Node-Red
JSON is popular format for encoding data sent over the Internet, and also stored in files. In computing, JavaScript Object Notation (JSON) is an open-standard file format that uses human-readable text to transmit data objects consisting of attribute–value pairs and array data types (or any other serializable value). –wiki
Continue readingUsing the Node Red Status Node
In Node red any node can report status information in the visual editor. The screen shot below shows the mqtt node. It shows a green circle to indicate that it is connected and the text connected underneath the node.
Continue readingNode-Red HTTP Request Node for Beginners
There are three core http nodes. http-in -Used to configure a web server http response – used with http-in to send responses. http request – used for making http requests i.e an http client. The http request node can be used for. Retrieving web pages from a website Making API Request Sending and receiving JSON data to a website or API. etc The node will send a request and receive the response. The node handles both the request and response. Note: if you are not familiar with the http protocol then I suggest you read the http basics tutorial.
Continue readingUsing the Node-Red Function Node- Beginners Guide
The function node is used to run JavaScript code against the msg object. The function node accepts a msg object as input and can return 0 or more message objects as output. This message object must have a payload property (msg.payload), and usually has other properties depending on the proceeding nodes.
Continue readingHow to Install and Run The Aedes Broker on Node-Red
Rather than use an external broker like mosquitto with node-red you can install the Aedes node which is a MQTT broker written in node.js. Because Aedes isn’t part of the core nodes you need to install it using the npm package manager or through the Node-red Admin control panel. Note: Aedes replaces the Mosca broker.
Continue reading