You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Instantly share code, notes, and snippets.
Phill
Paraphraser
I wrote my first line of code in 1975. I've worked for the Aussie government, for local and multinational corporates, and in the tertiary education sector.
IOTstack tutorial: running two instances of Node-RED on the same host
IOTstack tutorial: running two instances of Node-RED on the same host
Suppose you have a Node-RED container running but you want to create a test version where you can experiment safely without disturbing the original.
Running multiple instances of a container is something Docker excels at! This tutorial explains how to set it up. It will also help you to understand the differences between containers running in host mode and non-host mode.
Assumptions
Your existing Node-RED service definition looks similar to this:
This gist is a response to a Discord question. It explains my approach to deciding whether barometric pressure is rising, falling or remaining steady.
I do the trend calculation in Arduino (ESP8266) code. I tried to mimic the idea of setting the reference needle on a real barometer, waiting an hour, then seeing which way the pressure needle had moved with respect to the reference. The wrinkle is that "the last hour" is a moving window that updates every 10 minutes.
The BMP085 sensor is polled every 10 minutes. Until there are six observations (eg after a reboot) the code returns "training".
After that, the code does a least-squares regression on the last six observations (ie the last hour of data) to find the linear equation of best fit. In effect, the algorithm assumes that knowing the time (independent variable on the X axis) at some point in the past hour would permit the pressure at that time (dependent variable on the Y axis) to be estimated with some degree of
Tutorial: Debugging MQTT traffic flows in IOTstack
Tutorial: Debugging MQTT traffic flows in IOTstack
You have built an ESP32, ESP8266 or similar project. You are sure it is sending payloads via MQTT but the data doesn't seem to be arriving in Node-Red. You're at a bit of a loss as to what to do next.
This tutorial is specific to IOTstack where Mosquitto and Node-Red are running as Docker containers on a Raspberry Pi. Much of it is probably applicable to other environments but "your mileage may vary".
This gist answers a Discord question. It explains my approach to collecting CPU temperatures by sending the data as an MQTT payload.
I like to think of this approach as working with the MING (Mosquitto, InfluxDB, Node-RED, Grafana) paradigm rather than fighting against it (eg using approaches like SSH calling out of the Node-RED container).
The approach is not tied to the Raspberry Pi that is running IOTstack. If you have several Raspberry Pis, they can all log their temperatures to the Raspberry Pi running IOTstack using exactly the same mechanism.
This issue has come up a few times on Discord. The question can be summarised like this:
My existing IOTstack installation is running out of space on my primary drive. I have another drive. How do I move the "volumes" directory to the new drive?
This example is based on a Raspberry Pi 4 which is booting from a 500GB USB3 SSD. I will show you how to use a 32GB USB3 "thumb drive" as the secondary drive and move ~/IOTstack/volumes onto it.
The following problem was reported on the IOTstack Discord channel:
Today I rebuild my IOTstack from scratch using the Pibuild process and after restoring my nodered flows I noticed that my serials and GPIO are not connecting anymore.
I don't use node-red-node-pi-gpiod myself but I have been able to reproduce the problem.