The purpose of this repository is to create automatically a ready to use Raspberry Pi image containing all the needed files to setup a Wirepas gateway. This image allows to easily configure the Wirepas sink and transport services as well as sink parameters from files located in the FAT32 boot partition of the Raspberry Pi which can be easily edited. Other Raspeberry Pi parameters like Network settings, Wi-Fi and others setting are not modified by the image.
The Raspberry base image is built with official RPi-Distro/pi-gen tool.
On top of it, this image is customized with Docker tool to allow the usage of Wirepas gateway docker images that can be found on DockerHub.
In a standard configuration with one sink attached to the gateway and the gateway publishing to a single broker, the gateway can be configured with the file gateway.env. This file must be adapted to reflect your setup and copied under /boot/wirepas (after the image has been flashed to the SD-Card).
GATEWAY_TAG key allows you to specify a new version of gateway. Editing this key will allow you to switch to a newer version in future without the need to reflash the base image. Only a reboot is needed. If latest tag is used (by default), gateway will be automatically updated at each new release.
Keys starting with WM_GW_SINK_* are related to sink configuration.
Keys starting with WM_SERVICES_MQTT_* are related to broker configuration
To use the local MQTT broker installed previously, the following config can be set:
WM_SERVICES_MQTT_HOSTNAME=localhost
WM_SERVICES_MQTT_PORT=1883
WM_SERVICES_MQTT_USERNAME=
WM_SERVICES_MQTT_PASSWORD=
WM_SERVICES_MQTT_FORCE_UNSECURE=true
All the following commands, required to be connected to a console on the gateway (through SSH).
By default, SSH is enabled on this image with following credentials:
Login | Password |
---|---|
wirepas | wirepas_pw |
Hostname is set to wirepasgw
From wirepas user root folder, execute this command:
docker-compose logs
To observe packets received from sink(s) on dbus, execute this command:
docker run --rm -v wirepas_dbus-volume:/var/run/dbus -ti wirepas/gateway_transport_service wm-dbus-print
To see the current sink(s) configuration, please execute this command:
docker run --rm -v wirepas_dbus-volume:/var/run/dbus wirepas/gateway_transport_service wm-node-conf list
wm-node-conf allows to configure sink locally too. To see its usage and different options, execute this command:
docker run --rm -v wirepas_dbus-volume:/var/run/dbus wirepas/gateway_transport_service wm-node-conf
For example, following command allows you to stop a sink named sink1:
docker run --rm -v wirepas_dbus-volume:/var/run/dbus wirepas/gateway_transport_service wm-node-conf set -s sink1 -S False
Images under release tab are automatically build with github actions when repository is tagged.