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.
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".
Using SSHFS to mount your Raspberry Pi's home directory on your Mac
Using SSHFS to mount your Raspberry Pi's home directory on your Mac
It is useful to be able to mount your Raspberry Pi's file system on your Mac's desktop. The Raspberry Pi is ready to rock-'n-roll but some work needs to be done on the Mac. This gist assumes macOS Mojave 10.14. Your mileage may vary on earlier or later versions.
Set up passwordless SSH (optional)
You can make your life quite a bit simpler if you set up SSH on your Mac so that it can login to your Raspberry Pi without needing a password. Follow this tutorial.
The tutorial assumes two Raspberry Pis but there is no difference in approach if you use a Mac and a Pi, or two Macs.
IOTstack - Using the PiHole container as your container DNS
IOTstack - Using the PiHole container as your container DNS
First, a small bit of editorialising (my gist, my rules). PiHole is an excellent ad-blocker. It's perfectly OK for just about every other device on your home network to use PiHole as its primary DNS.
The one device in your network that shouldn't use PiHole-in-a-container for its DNS is the Raspberry Pi running PiHole in a Docker container. I'll go so far as to describe it as a seriously dumb idea.
Why? Several reasons:
Containers start quite late in the boot cycle. Any process starting before Docker that depends on the DNS being "there" can be disappointed. PiHole being late to the party and occasionally disappearing when you do perfectly ordinary things like…
… Taking down your stack can trigger resolver failover conditions which don't always recover gracefully. You might think your DNS setup is working just fine with the PiHole container in the prime role but then it all turns to custard and you don't know why.
There exists a mechanism (unspecified) for acquiring status information from an Uninterruptible Power Supply;
That mechanism is available to Node-RED; and
There exists a Node-RED flow (unspecified) that is capable of interpreting the UPS status information and making decisions about when devices should power down and in what order.
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.
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.
As a general principle, I'm not in favour of override files. I think they muddy the waters. I think you're much better off editing docker-compose.yml directly.
That said…
When you use IOTstack to manage Docker containers, you have access to two override mechanisms:
A compose-override.yml file. This mechanism is peculiar to IOTstack and is implemented by the so-called "new" menu on the master branch.
A docker-compose.override.yml file. This mechanism is part of docker-compose.