Monitors my Workshop PI, and lets me see my printroom conditions at a glance via an embeddable web interface and also on a small OLED display.
It records and displays the CPU temperature, load and memory useage of the Pi itself, and uses an (optional) environmental sensor to also record the room temperature, pressure and humidity readings. Readings happen every 10 seconds and are held in a database so you can view graphs of how they change with time.
It also has the ability to optionally monitor and log specified GPIO pins as they are toggled by other programs (eg printer power control pins controlled by Octoprint, etc.) and monitor ping times and status for network targets you specify (eg your router, or a wifi enabled controller, etc.)
I have written it to be very low impact on the host; database readings are cached and disk writes only happen every five minutes in order to minimise impact on the SD card. When running without a display the the program typically consumes less than 1% of one CUP core. Adding a display increases this but not by much overall. There is in-built housekeeping to do database backups, dumps and log rotation.
Bonus! Control a light connected to a GPIO pin via a button and/or url, this is a convenience feature I added for myself so I can easily toggle my workbench lamps when in the room, or remotely via the web when viewing my webcams.
Written in Python as a learning excercise, it draws heavily on RRDtool, RPI.GPIO, psutil, the default python http.server and CircuitPython for interfacing with sensor and screen.
Default Web Interface
Add a some network targets, a BME280 sensor and/or some GPIO pins to monitor
Add a 128x64 OLED display
Log GPIO actions etc..
Embeddable Panels and Standalone Graphs
- Python3.7+, pip and virtualenv
The install guide covers installing these, and the rest of the requirements in a way that wont conflict with other python tools and versions on your system:
This is covered in detail here: docs/INSTALL.md
- Install is done via a python virtual environment to avoid any conflicts with other Python installs (such as OctoPrint)
Copy the default.ini
file in the repo to config.ini
and edit..
- All the useful options are commented in the file
- Restart Overwatch to apply any changes
I need to flesh this out in a sepaerate document.
In brief: Customising should be relatively easy, add a data source and commands to gather it in overwatch.py
(see how this is done for the CPU temperature, etc); then add it to the graph structures in robin.py
and the sensorlist in httpserver.py
. Customising the screens for an OLED display can be done in animate.py
The sensor, display and GPIO control is all optional. The unit itself can only control a single pin, but it can monitor and log multiple pins if you are also using GPIO for controlling other aparatus (eg 3d printer power supplies)
- I2C goes to the 0.96' OLED screen and BME280 Sensor module
- GPIO outputs controlling lights etc; opto-isolated relay boards are your friend here.
- Button goes to a spare GPIO with a pulldown resistor
I want to add an extensible alerting function.. see #15
https://circuitpython.readthedocs.io/en/latest/shared-bindings/index.html https://circuitpython.readthedocs.io/projects/framebuf/en/latest/api.html https://circuitpython.readthedocs.io/projects/bme280/en/latest/api.html