Closed hasselrot closed 1 year ago
The dynaconf can't load the settings as JSON. As docker container, the setting env should be something like this: @json {"username": "", "password": "", "vin": "", "vccapikey": ["key1", "key2"], "odometerMultiplier": 1, "averageSpeedDivider": 1, "averageFuelConsumptionMultiplier": 1}
.
So try adding @json
in front of your value.
Still having some issues with this in kubernetes, so I thought I would give it a try just as your documentation:
docker run -d --pull=always -e CONF_debug=true -e CONF_updateInterval=300 -e CONF_babelLocale='sv_SE' -e CONF_mqtt='@json {"broker": "10.3.0.51", "username": "", "password": "", "port": 8182}' -e CONF_volvoData='@json {"username": "EMAIL", "password": "PASSWORD", "vin": "VINHERE", "vccapikey": ["secretapikey1", "secretapikey2"], "odometerMultiplier": 1, "averageSpeedDivider": 1, "averageFuelConsumptionMultiplier": 1}' -e TZ='Europe/Berlin' --name volvo2mqtt ghcr.io/dielee/volvo2mqtt:latest
But the container only crashes. Logs:
hasselrot@ubuntu-01:~$ docker logs 16231acd1659
Oct 22 07:24:21 volvo2mqtt [1] - INFO: Starting volvo2mqtt version v1.8.8
Traceback (most recent call last):
File "/volvoAAOS2mqtt/./main.py", line 14, in <module>
connect()
File "/volvoAAOS2mqtt/mqtt.py", line 40, in connect
client.loop_start()
File "/usr/local/lib/python3.9/site-packages/paho/mqtt/client.py", line 1799, in loop_start
self._thread.start()
File "/usr/local/lib/python3.9/threading.py", line 899, in start
_start_new_thread(self._bootstrap, ())
RuntimeError: can't start new thread
It looks like the container can't connect to your mqtt broker...
Thanks! I do see the connection in my mqtt broker:
1697976079: New connection from 172.17.0.2 on port 1883.
1697976079: New client connected from 172.17.0.2 as volvoAAOS2mqtt_lars (p2, c1, k60).
1697976079: Socket error on client volvoAAOS2mqtt_lars, disconnecting.
Which docker version you are running?
Docker version 20.10.7, build f0df350
Then I have no more ideas, sorry. As I can't reproduce this behavior...
@Dielee Thanks for the help! Upgraded Docker version did the trick!
Describe the bug Hi!
Im trying to run volvo2mqtt in my kubernetes environment. But running into configuration issues with the ENV Variables.
Im sure it is something with the vccapikey that I am misunderstanding. I have added the primary and secondary keys that I created on the volvo developer page.
To Reproduce:
My kubernetes configuration here, with bogus vccapikeys.
Would very much appreciate any help! Thanks!