Sends structured information from a MikroTik router to an MQTT Server.
4.2K
Sends structured information from a MikroTik router to an MQTT Server.
Here are some example snippets to help you get started creating a container.
Compatible with docker-compose v2 schemas.
version: "2.1"
services:
mikrotik2mqtt:
image: zoilomora/mikrotik2mqtt
container_name: mikrotik2mqtt
environment:
- MIKROTIK_HOST=192.168.88.1
- MIKROTIK_USER=mikrotik2mqtt
- MIKROTIK_PASSWORD=mikrotik2mqtt
- MQTT_HOST=192.168.88.2
restart: unless-stopped
docker run -d \
--name=mikrotik2mqtt \
-e MIKROTIK_HOST=192.168.88.1 \
-e MIKROTIK_USER=mikrotik2mqtt \
-e MIKROTIK_PASSWORD=mikrotik2mqtt \
-e MQTT_HOST=192.168.88.2 \
--restart unless-stopped \
zoilomora/mikrotik2mqtt
Container images are configured using parameters passed at runtime (such as those above).
| Parameter | Function |
|---|---|
-e UPDATE_TIME=60 | Time interval (seconds) between data collection |
-e MIKROTIK_HOST=192.168.88.1 | IP Address of your MikroTik router |
-e MIKROTIK_USE_SSL=0 | Enable (1) or disable (0) the use of SSL from the MikroTik API |
-e MIKROTIK_USER=mikrotik2mqtt | User with read permission of his MikroTik |
-e MIKROTIK_PASSWORD=mikrotik2mqtt | Password of your user with read permissions of your MikroTik |
-e MQTT_HOST=192.168.88.2 | IP Address of your MQTT Server |
-e MQTT_PORT=1883 | Port of your MQTT server |
-e MQTT_USE_TLS=0 | Enable (1) or disable (0) the use of TLS on your MQTT Server |
-e MQTT_USERNAME=mikrotik2mqtt | User of your MQTT Server |
-e MQTT_PASSWORD=mikrotik2mqtt | Password of your MQTT Server |
-e MQTT_CLIENT_ID=mikrotik2mqtt | Client identifier for your MQTT Server |
-e MQTT_TOPIC_BASE=mikrotik2mqtt | Base of the topic in which the information will be published |
Below are the instructions for updating containers:
docker-compose pull
docker-compose pull mikrotik2mqttdocker-compose up -d
docker-compose up -d mikrotik2mqttdocker image prunedocker pull zoilomora/mikrotik2mqttdocker stop mikrotik2mqttdocker rm mikrotik2mqttdocker image pruneIf you want to make local modifications to these images for development purposes or just to customize the logic:
git clone https://github.com/zoilomora/mikrotik2mqtt.git
cd mikrotik2mqtt
docker build \
--no-cache \
--pull \
--target production \
--tag zoilomora/mikrotik2mqtt:latest .
We must give thanks to these dependencies for which this project would not be in operation:
Licensed under the Apache-2.0
Read LICENSE for more information
Content type
Image
Digest
Size
33.5 MB
Last updated
about 5 years ago
docker pull zoilomora/mikrotik2mqtt