Sign inSign up

rvleij/p1monitor

By rvleij

Updated over 3 years ago

Docker container for running P1 Monitor for smart energy meters.

Image
2

100K+

rvleij/p1monitor repository overview

ChangeLog

8-Jan-2023:latest: Upgrade to 2.1.0 (didn't get it running at first in Docker due to the PyEnv setup and compiler issues on my multi-arch buildx with some python modules. Seems stable now, but I only tested on ARM (Pi4) with this image. Let me know in the Github Issues (https://github.com/rvleij/p1monitor) if you run into issues on other arcs (like AMD64).

7-Jun-2022:latest: Upgrade to 1.7.0

7-Jun-2022:latest: Upgrade to 1.6.0 (sorry it took a bit of time, I was busy. I'll immediately also publish v1.7.0 now, which was released during my building of 1.6.0)

4-Dec-2021:latest: Upgrade to v1.5.0 Included support for SOCAT, use

-e "SOCAT_ENABLE=TRUE" -e "SOCAT_HOST=your_ser2net_IP" -e "SOCAT_PORT=port"

17-Nov-2021:testing Added a testing tag for a new release (fetch with docker pull rvleij/p1monitor:testing), including Socat for those of us running Socat for serial-over-IP. In order to use Socat and generate a /dev/ttyUSB4 (to be used in P1Monitor) use the following environment variables when starting the Docker container, i.e. add the following to the docker start command, replacing the IP and port with your settings: -e "SOCAT_ENABLE=TRUE" -e "SOCAT_HOST=" -e "SOCAT_PORT="

Let me know if it works in this issue: https://github.com/rvleij/p1monitor/issues/4 I wrote a small Blog entry about how this works, check it here: https://blog.vleij.com/post/p1monitor-docker-image-improvements/

17-Oct-2021:v.1.4.1 updated to 1.4.1 release

23-aug-2021: v.1.3.1-2 due to a mistake on my side, the packaged 1.3.1 image actually contained 1.2.0 (or parts of 1.2.0), now fixed in 1.3.1-2 which is confirmed to run 1.3.1. It all worked, but 1.3.1 functionality wasn't present in the image.

General

This is a Docker container running P1-Monitor from https://www.ztatz.nl/p1-monitor/. This docker image is not supported by the original author of P1 Monitor, please don't report problems since it's not an official way to distribute P1 Monitor.

The Github repo for this build, so you can build your own Docker container if you want to rather do that or open an issue: https://github.com/rvleij/p1monitor My blog where I write about this container and other stuff sometimes: https://blog.vleij.com

P1 Monitor is intended to monitor smart meters (used in NL, maybe other countries) using a P1 cable (basically serial cable). The software monitors the telegrams sent by the meter via serial interface, interprets them and stores the data in a SQLite DB running in memory (to prevent writing to SDHC which has limited write cycles). From there, it's displayed in a web interface, sent via MQTT, UDP broadcasts etc etc. See the above website for more information.

Normally this (great!) software is distributed as a complete package for flashing on a Raspberry Pi SDHC card, including upgrades. I wanted to use my Pi4 for a bit more than just this one application and decided to see if this runs as a container along other stuff.

I found some work done by someone called "JeroenJ" to make it work in a container and I decided to publish a ready made container for easy use. See for more information: https://www.ztatz.nl/p1-monitor-download-202006/#comment-6824

I built the container image based on this work and published it here so others can find it. I intent to keep this container updated as soon as new P1 Monitor releases are made, until the maintainer for the software releases Docker containers himself (seems to be more or less the plan). I have compiled for amd64 (if you want to run this on a x86) and arm (for the Pi).

Running

I run the container using the following run command:

docker run -d -p 80:80 -p 10721:10721 -p 40721:40721 --name="p1mon" \
-h p1mon --cap-add=SYS_NICE \
--tmpfs /tmp --tmpfs /run --tmpfs /p1mon/mnt/ramdisk \
-v /<insert local path>/p1mon/data:/p1mon/data:rw -v /<insert local path>/p1mon/usbdisk:/p1mon/mnt/usb:rw \
-v /etc/localtime:/etc/localtime:ro \
--device=/dev/<your USB device> \
--restart=unless-stopped \
rvleij/p1monitor:latest

If you want to run SOCAT client, include

-e "SOCAT_ENABLE=TRUE" -e "SOCAT_HOST=your_ser2net_IP" -e "SOCAT_PORT=port"

Updating

  1. Create the memory dump to /usbstick (mounted seperately) by running the Upgrade Assistant
  2. Stop P1 Monitor by using the "system" section and using the "shutdown" button (as if you shutdown your Pi)
  3. docker pull rvleij/p1monitor
  4. docker stop p1-mon (or whatever you named it)
  5. docker rm p1mon
  6. run the start command above under "running" to start a new instance. It'll load the data from /usbstick and continue operations.

Tag summary

Content type

Image

Digest

sha256:978fea699

Size

481.2 MB

Last updated

over 3 years ago

docker pull rvleij/p1monitor