Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to initialize polling of several messages in Docker Compose #508

Closed
freerkvenhuizen opened this issue Jan 25, 2022 · 5 comments
Closed
Labels

Comments

@freerkvenhuizen
Copy link

Hi,

I am working on setting up the following chain: ebusd -> mosquitto -> telegraf -> influxdb using docker-compose.
Currently the entire chain seems to be working as expected, but there is 1 thing I still have to do manually which I would like to automate somehow.

After initializing ebusd I have to manually use Mosquitto to enable polling of the parameters I'm interested in using (for example) the following command: docker container exec mosquitto mosquitto_pub -t 'ebusd/700/z1RoomTemp/get' -m '?3'
As far as I understand, this command tells ebusd to enable polling for this message, which indeed works; I nicely see the data flowing into the database at a regular interval.

I would however like to add this initialization somewhere in my code such that ebusd automatically knows which messages to poll. How to do this?

@freerkvenhuizen
Copy link
Author

Content of the docker-compose yaml file:

version: "3.5"

services:

mosquitto:
container_name: mosquitto
image: eclipse-mosquitto:latest
user: "0"
ports:
- "1883:1883"
- "9001:9001"
volumes:
- ./mqtt/data:/mosquitto/data
- ./mqtt/log:/mosquitto/log
- ./mqtt/config:/mosquitto/config

restart: always

influxdb:
container_name: influxdb
image: influxdb:latest
ports:
- "8086:8086"
volumes:
- ./influxdb:/var/lib/influxdb2
- ./influxdb:/etc/influxdb2
environment:
- DOCKER_INFLUXDB_INIT_MODE=setup
- DOCKER_INFLUXDB_INIT_USERNAME=telegraf
- DOCKER_INFLUXDB_INIT_PASSWORD=P@ssw0rd
- DOCKER_INFLUXDB_INIT_ORG=telegraf
- DOCKER_INFLUXDB_INIT_BUCKET=telegraf
- DOCKER_INFLUXDB_INIT_RETENTION=1w
- DOCKER_INFLUXDB_INIT_ADMIN_TOKEN=9859DAA6-3B3F-48FE-A981-AE9D31FBB334
restart: always

telegraf:
container_name: telegraf
image: telegraf:latest
ports:
- "8092:8092"
- "8094:8094"
- "8125:8125"
volumes:
- ./telegraf/telegraf.conf:/etc/telegraf/telegraf.conf:ro
restart: always

ebusd:
container_name: ebusd
image: john30/ebusd
restart: unless-stopped
tty: true
devices:
#- '/dev/serial/by-id/usb-Silicon_Labs_CP2102N_USB_to_UART_Bridge_Controller_62928ffa24deea119e8ccf149a583cc7-if00-port0:/dev/ttyUSB0'
- '/dev/ttyUSB0:/dev/ttyUSB0'
ports:
- 8888:8888
#configuration volume if you need to customize it (also add --configpath=/config to command param)
volumes:
- ./ebusd/log:/var/log
depends_on:
- mosquitto
command: -f --scanconfig --mqtthost=mosquitto --mqttport=1883 --mqttjson --accesslevel="*"
privileged: true

@mwildbolz
Copy link

mwildbolz commented Jan 26, 2022

I would suggest that you clone the ebusd-configuration repository (https://github.com/john30/ebusd-configuration) to a local directory and change the message type from "r" to "r1-r9" (according to the poll priority needed) for all values you want to poll regularly (refer to message definition). The parameter --pollinterval=SEC should also be set!
And you have to link that configuration volume into your docker container and add the corresponding --configpath=path/to/your/config option to your command parameters.

So you don't need to do that manually via MQTT.

@freerkvenhuizen
Copy link
Author

Awesome, that sounds exactly what I'm looking for! Thanks!

@john30
Copy link
Owner

john30 commented Feb 20, 2022

the MQTT integration settings are capable of adjusting poll priority of messages matching filter criteria, see here and here

@john30
Copy link
Owner

john30 commented Nov 13, 2022

closed due to inactivity

@john30 john30 closed this as completed Nov 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants