Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
digitalstrom_mqtt_gateway_in_a_docker_container [06.07.2024 09:26] – Pascal Suter | digitalstrom_mqtt_gateway_in_a_docker_container [06.07.2024 09:47] (current) – Pascal Suter | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== DigitalSTROM MQTTG Gateway in a Docker container ====== | ====== DigitalSTROM MQTTG Gateway in a Docker container ====== | ||
- | **this is WIP** | + | this is how i set up Chriss Gross' [[https:// |
- | this is how i set up Chriss Gross' [[https:// | + | |
+ | on a personal note i want to add: kudos to node.js for still being able to run a script that hasn't been touched for 9 years without modifying a single line of code! this actually makes the need to dockerize this quite questionable. however, i still perfer it this way in my current setup :) | ||
+ | |||
+ | so here is how i set it up: | ||
<code yaml docker-compose.yml> | <code yaml docker-compose.yml> | ||
Line 78: | Line 81: | ||
CMD /startup.sh | CMD /startup.sh | ||
</ | </ | ||
+ | |||
+ | docker compose build | ||
+ | docker compose up | ||
+ | press '' | ||
nano ./ | nano ./ | ||
+ | |||
+ | now your setup might be different, but i wanted to be able to use a password authentication for mqtt and i wanted to set '' | ||
+ | |||
+ | so in the settings in the '' | ||
+ | <code javascript> | ||
+ | // MQTT-Client | ||
+ | client: { | ||
+ | url: ' | ||
+ | baseTopic: dssTopic, | ||
+ | qos: 2, | ||
+ | username: ' | ||
+ | password: ' | ||
+ | }, | ||
+ | </ | ||
+ | again of course with the correct username and password. | ||
+ | |||
+ | next i had to slightly modify the script in '' | ||
+ | <code javascript> | ||
+ | var clientSettings = { | ||
+ | keepalive: 10, | ||
+ | clientId: config.name, | ||
+ | will: { | ||
+ | topic: config.client.baseTopic + '/ | ||
+ | payload: new Buffer(' | ||
+ | qos: config.client.qos, | ||
+ | retain: true | ||
+ | }, | ||
+ | username: config.client.username, | ||
+ | password: config.client.password | ||
+ | }; | ||
+ | </ | ||
+ | |||
+ | with all this done, we can now start the container and hope for it to run ;) | ||
+ | docker compose up -d | ||
+ | |||
+ |