MQTT Logger

Description

ezvpn-mqtt-logger is a Docker container designed for debugging purposes.

Generic MQTT Schema

ezvpn-mqtt-logger subscribes to the internal MQTT broker topics; each incoming message is printed to the console.

Please check the Debug Tools documentation if you need to display the Docker console locally.

Otherwise, you can install the web logger application to get access to the logs.

How to use it

ezvpn-mqtt-logger is a Docker container image based on Eclipse Mosquitto pre-configured for communication with ezvpn-mqtt. To use, install it along with ezvpn-mqtt or a generic MQTT broker.

Environment variables

When you start the ezvpn-mqtt-logger image, you can adjust the instance's configuration by passing one or more environment variables to the docker run command.

  • MQTT_HOST: MQTT internal host. Defaults to 127.0.0.1
  • MQTT_PORT: MQTT internal port. Defaults to 1883
  • MQTT_IN_TOPIC: MQTT topic to subscribe (e.g. "fld/modbus/r/#"). Defaults to fld/+/r/#. Subscribe to multiple topics can be obtained defining each topic on a separated line.
  • MQTT_USE_URL_AUTH: If true MQTT_USERNAME and MQTT_PASSWORD are used to connect to the MQTT broker, with url authentication (mqtt://MQTT_USERNAME:MQTT_PASSWORD@MQTT_HOST:MQTT_PORT)
  • MQTT_USERNAME: Optional MQTT username
  • MQTT_PASSWORD: Optional MQTT password

Docker container details

Image: us-central1-docker.pkg.dev/ez-shared/iohub/iohub-mqtt-logger

Supported architecture: amd64

Running locally with Docker

Example of running an ezvpn-mqtt-logger Docker container:

docker run -it --rm -e MQTT_HOST="<your mqtt broker ip>" \
    -e MQTT_PORT="1883" \
    -e MQTT_IN_TOPIC="#" \
    us-central1-docker.pkg.dev/ez-shared/iohub/iohub-mqtt-logger

Changelog

v1.0.4
  • Smaller image
v1.0.3
  • Fixes
v1.0.2
  • MQTT_USE_URL_AUTH Environment Variable added
  • MQTT_USERNAME Environment Variable added
  • MQTT_PASSWORD Environment Variable added
v1.0.1
  • MQTT_IN_TOPIC accepts multiple topics
v1.0.0
  • First Release