NodeRED has already the topic system in place, which means you can specify the publishing topic by setting the msg.topic value instead of hardcoding that information into the MQTT output node. Publishing a message to a topic is very easy. Inject node with topic and payload specified Via HTTP POST, but the same message should be posted as data updates to 2 topics instead: the temp and the humid. Always consider the type of data sent to your NodeRED and the best possible data transfer protocol. Let’s issue a simple POST request with a current temperature as data. The requests will have to match the node type, directory and receive the response. Whether sending a POST or GET request, NodeRED nodes have to be configured accordingly.
This way you will be aware that the HTTP protocol has been successful. What’s also super useful is that requests are not sent blindly and each one of them will receive a response. POST will submit data to the NodeRED server (again there is more to that) The two most popular types of requests are POST and GET. I’m going to simplify how you interact with the server via requests, as this is a tutorial for beginners. You can send data to NodeRED from anything that supports the protocol.
#NODEBOT COM PORT REDIRECT HOW TO#
Consider the security if you planning on making the NodeRED server available to WAN, I have a guide on how to secure NodeRED server in 5 min.
A lot of things I’m going to talk about will be based on assumption, that you possess the relevant knowledge. Sending data in and out of NodeRED will require some sort of data structure and JSON is the default way of processing organised information in NodeRED. Connectivityīefore we dive into the details I’d strongly recommend that you read the Data Processing part & JSON for beginners.
Tips and Tricks NodeRED for beginners: 5.