Grafana, Influxdb & DS18B20 based home temperature monitoring with Raspberry Pi

Two years later – a small update on running a network of Raspberry Pi based temperature sensors and dashboards via an influxdb/Grafana Pi server.

Original post detailing how “tomato plant overflow” lead to development of a home-wide temperature monitoring network

Hardware changes: nothing much to report – everything is working reliably. A few of the Raspberries Pi Model 2 & 3 have been changed out for Pi Zeros – smaller and still more than powerful enough to run the temperature data gathering. The Pi 4B server hosting the Grafana dashboards and influxdb has been setup to boot/run from a USB3 SSD, the original 4GB memory model was swapped out for an 8GB model during debugging/testing out-of-memory crashes around the “compaction crash loop” issue detailed below.

Raspberry Pi 4B + USB 3.0 SSD with influxdb backed up up to USB 2 flash drive

Software issues: In my initial design I hadn’t set any data retention policy on the influxdb and after ~14 months the database had grown too big to be auto-compressed on the (32-bit kernel) Raspberry Pi 4B server. I quickly found I’d ran into this known issue – I set a sensible date range on my telegraf DB and things looked a lot better. Compaction failure crash loop came back again about 4 months later and I found that the influx dev team were not actively pursuing adding support for “large” DBs in the 32 bit code so I was left debating a few options:

  • Export the DB then import onto another (64 bit) machine
    e.g. laptop running Fedora and let the compaction complete then export/import back to the Pi (too much faff)
  • Install 64 bit kernel on the Pi 4B
    despite warnings about it being “experimental” it’s not too bad. As it turns out it’s relatively simple: I ran rpi-update, ignored the scary sounding warnings and added “arm_64bit=1” to the [pi4] section of /boot/config.txt, rebooted and woke up in 64-bit heaven!
  • Move the influxdb server permanently to another 64 bit machine
    e.g. another Fedora/Debian laptop/server – I really wanted to keep the whole thing Pi based.

Initially I chose none of the above and further reduced the data retention time on my temp_logger DB…. but some months later I went with the 64-bit kernel option…

64 bits of aarch64 kernel for the Pi4

I have a simple backup script running every 6 hours that backs up the influxdb instance to an attached USB flash drive and to another laptop (which is in turn backed up to a cloud storage service), some performance stats show the improvement in this task from the 32-bit to 64-bit kernel (the same 15 minute segment of data from the 01:32 run on 2 different days):



Published by zedstarr

Chilled out human being, doing techy stuff.

3 thoughts on “Grafana, Influxdb & DS18B20 based home temperature monitoring with Raspberry Pi

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: