Skip to content

Instantly share code, notes, and snippets.

View Paraphraser's full-sized avatar

Phill Paraphraser

  • Cootamundra NSW Australia
View GitHub Profile
@Paraphraser
Paraphraser / IOTstack tutorial – adding a second drive.md
Last active March 23, 2023 11:32
IOTstack tutorial - adding a second drive

IOTstack tutorial – adding a second drive

Problem statement

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.

@Paraphraser
Paraphraser / power_monitor_poc.md
Last active June 3, 2021 00:48
UPS monitor - back end - proof of concept

UPS monitor - back end - proof of concept

Assumptions

  • 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.

Task Goal

@Paraphraser
Paraphraser / Docker+OctoPrint - When your 3D printer turns on and off.md
Last active August 10, 2024 08:04
IOTstack+OctoPrint: When your 3D printer turns on and off

octoprint-docker: when your 3D printer turns on and off

Task goals

  • Keep the OctoPrint Docker container service running even when your printer is switched off:

    • GCODE files can still be uploaded
    • Plugins can still be updated
@Paraphraser
Paraphraser / Using the PiHole container as your container DNS.md
Last active December 24, 2022 03:15
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.
@Paraphraser
Paraphraser / Mount Raspberry Pi home directory on your Mac.md
Last active April 26, 2024 13:10
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.

@Paraphraser
Paraphraser / Tutorial - Debugging MQTT traffic flows in IOTstack.md
Last active April 28, 2023 02:06
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".

Related resources

@Paraphraser
Paraphraser / Node-Red IOTstack hints.md
Last active December 24, 2022 02:35
Hints: Running Node-Red in IOTstack
@Paraphraser
Paraphraser / RPiWiFiFreeze.md
Last active March 27, 2024 03:41
Do your Raspberry Pi's Network Interfaces freeze? This may solve it.

Do your Raspberry Pi's Network Interfaces freeze?

My Raspberry Pi 4 kept losing its wlan0 interface. I could usually reconnect via Ethernet but, from time to time, I noticed that the eth0 interface would also go walkabout.

I tried a lot of things but the one described here seems to have cured the problem. I have no idea why it works. It just does.

Step 0 - are you a Windows user?

The script shown in the next step should be created on your Raspberry Pi. Please do not make the mistake of selecting the text, copying it into a text editor on your Windows machine, saving the file, and then moving the file to your Raspberry Pi. Unless you take precautions, Windows will add its 0x0d 0x0a (CR+LF) line endings and those will stop the script from working properly on your Raspberry Pi.

@Paraphraser
Paraphraser / IOTstackPullRequest.md
Last active January 28, 2023 17:26
Preparing IOTstack Pull Requests

Preparing a Pull Request for IOTstack

If you want to fix a bug or propose an enhancement for IOTstack, you will need to prepare a Pull Request (PR).

Please don't try to do anything in this gist inside an ~/IOTstack folder on a Raspberry Pi that is also being used to run your Docker containers. It's easy to get confused and you could accidentally break your own working IOTstack.

You can do everything on the same Raspberry Pi that is running your IOTstack but it's usually easier to work on a desktop or laptop. If you accept this advice, there's no risk of breaking your running IOTstack.

This guide barely scratches the surface of Pull Requests. There is lots of advice on GitHub and Google will find plenty of hits for any question you might have.

@Paraphraser
Paraphraser / InfluxDB security under IOTstack.md
Last active December 24, 2022 02:45
Enabling authentication in InfluxDB for SensorsIot/IOTstack

Tutorial: Enabling authentication in InfluxDB

Assumptions:

  • you are running SensorsIot/IOTstack with InfluxDB as one of the containers
  • you want to enable authentication for your InfluxDB databases.

Note: This tutorial is specific to SensorsIot/IOTstack.

Definition: