This image allow to run a instance of DSMR-Reader https://github.com/dennissiemensma/dsmr-reader).
The Docker image is available for the following architectures:
amd64 - For regulair Intel/AMD systems (default)arm32v6 - For Raspberry Pi 1/2/Zeroarm32v7 - For Raspberry Pi 2/Zero 2arm64v8 - For Raspberry Pi 3 and upThis was initially a fork of xirixiz, because that image wasn't updated regularly enough and didn't had multi architecture support for Raspberry Pi 1/2/3/4/Zero. It also supports the remote datalogger with the same image.
The Docker image is automatically build when Dennis releases a new version.
The Raspberry Pi is based Alpine, but in Alpine 3.13 they introduced a breaking change in the date of the container (it was changed from 32-bit to 64-bit). To allow the Raspberry Pi image to run successfully, you must upgrade the "libseccomp2" to a version 2.4.2 or higher. Only this is not default available in the stable Raspbian repository, so that it not easy. It is available in the back ports and can be installed with the following commands:
$ sudo su -
# apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 04EE7237B7D453EC 648ACFD622F3D138
# echo 'deb http://httpredir.debian.org/debian buster-backports main contrib non-free' | tee -a /etc/apt/sources.list.d/debian-backports.list
# apt update
# apt install libseccomp2 -t buster-backports
80 : WebGUINOTE: If HTTPS is required, please use Traefik or another proxy to enable this. This makes upgrades easier, because the standard DSMR-Reader configuration isn't changed.
/home/dsmr/app/backups
/dev/ttyUSB0 - Example of the serial device where the P1 is connected too
DSMR_MODE - Run DSMR in 1 of the following modes (default is SERVER):
SERVER - Run all processes, including backend, GUI and dataloggerSERVER-NO-DATALOGGER - Run server mode without the data logger process. A remote datalogger is required to collect DSMR telegramsDATALOGGER - Only start the datalogger client, which sends the P1 telegrams to the server. It is required to setup DATALOGGER_* environment variablesAll environment variables are documented in: https://dsmr-reader.readthedocs.io/nl/v4/reference/env-settings.html
Datalogger configuration:
DSMRREADER_DATALOGGER_API_HOSTS - Destination DSMR Reader host(s), separated by comma. Required if datalogger used.
DSMRREADER_DATALOGGER_API_KEYS - DSMR Reader API key(s), separated by comma. Required if datalogger used.
DSMRREADER_DATALOGGER_INPUT_METHOD - Connection method. Serial or ipv4 (default is serial).
DSMRREADER_DATALOGGER_SERIAL_PORT - Serial port name (default is /dev/ttyUSB0). Only used when input method is serial.
DSMRREADER_DATALOGGER_SERIAL_BAUDRATE - Serial port speed (default is 115200). Only used when input method is serial.
DSMRREADER_DATALOGGER_NETWORK_HOST - Network host (default is localhost). Only used when input method is ipv4.
DSMRREADER_DATALOGGER_NETWORK_PORT - Network host (default is 2000). Only used when input method is ipv4.
More information about the datalogger can be found in the following link: https://dsmr-reader.readthedocs.io/nl/v4/installation/datalogger.html
The following is the run command to start the image, but this is without the postgresql server. It is expected to run on "192.168.1.1" in this example.
docker run -d \
--name dsmr \
--restart unless-stopped \
-p 8888:80 \
-e DJANGO_DATABASE_HOST=192.168.1.1 \
-e DSMRREADER_ADMIN_USER=admin \
-e DSMRREADER_ADMIN_PASSWORD=admin \
-v /dev:/dev \
--device /dev/ttyUSB0:/dev/ttyUSB0 \
ualex73/dsmr-reader-docker
version: '3'
services:
db-dsmr:
image: postgres
container_name: db-dsmr
volumes:
- <dir>/db:/var/lib/postgresql/data
restart: unless-stopped
environment:
- POSTGRES_USER=dsmrreader
- POSTGRES_PASSWORD=dsmrreader
- POSTGRES_DB=dsmrreader
networks:
- net-dsmr
dsmr:
container_name: dsmr
image: ualex73/dsmr-reader-docker
container_name: dsmr
restart: unless-stopped
volumes:
- ./dsmr/backups:/home/dsmr/app/backups
- /dev:/dev
environment:
- DJANGO_DATABASE_HOST=db-dsmr
- DSMRREADER_ADMIN_USER=admin
- DSMRREADER_ADMIN_PASSWORD=password
ports:
- 8888:80
devices:
- /dev/ttyUSB0:/dev/ttyUSB0
networks:
- net-dsmr
networks:
net-dsmr:
driver: bridge
To bring up the container with docker compose, use the following command:
docker-compose -f docker-compose.yaml up -d db-dsmr
docker-compose -f docker-compose.yaml up -d dsmr
"db-dsmr" in docker-compose is configured to use a docker volume. So when the application and docker containter have been removed, the postgres data still persists.
Backup the PostgreSQL database to a SQL file:
docker-compose stop dsmr
docker exec -t db-dsmr pg_dumpall -c -U dsmrreader >postgresql-dump.sql
docker-compose start dsmr
Restore the database from a SQL file:
docker-compose stop dsmr
docker exec -t db-dsmr dropdb dsmrreader -U dsmrreader
docker exec -t db-dsmr createdb -O dsmrreader dsmrreader -U dsmrreader
cat postgresql-dump.sql | docker exec -i db-dsmr psql -U dsmrreader
docker-compose start dsmr
Content type
Image
Digest
sha256:1c567464f…
Size
82.3 MB
Last updated
7 months ago
docker pull ualex73/dsmr-reader-docker:5.12.0