micolous / cbus

Use Python to communicate with a Clipsal C-Bus PCI or CNI! Includes MQTT bridge (for Home Assistant), PCI simulator, and reverse engineering notes.
http://cbus.readthedocs.org/
GNU Lesser General Public License v3.0
49 stars 27 forks source link

IndexError: list index out of range #23

Closed beerygaz closed 3 years ago

beerygaz commented 3 years ago

I'm trying to get the docker container running. I've cloned your repo, built the container, but when I run the container I get the following error:

Docker run command: docker run -e "MQTT_SERVER=192.168.1.20" -e "CNI_ADDR=192.168.1.26" -e "TZ=Africa/Johannesburg" cmqttd

Output:

Using TCP CNI at 192.168.1.26
Using TLS to connect to MQTT broker.
/etc/cmqttd/certificates not found, using Python CA store.
/etc/cmqttd/client.pem and/or /etc/cmqttd/client.key not found, not using client certificates for authentication.
/etc/cmqttd/auth not found; skipping MQTT authentication.
/etc/cmqttd/project.cbz not found; using generated labels.

Local time zone: Africa/Johannesburg
Current time: Sun, 10 Jan 2021 11:59:44 +0200
Running with flags: --broker-address 192.168.1.20 --timesync 300 --tcp 192.168.1.26
Traceback (most recent call last):
  File "/usr/bin/cmqttd", line 11, in <module>
    load_entry_point('cbus==0.2', 'console_scripts', 'cmqttd')()
  File "/usr/lib/python3.8/site-packages/cbus/daemon/cmqttd.py", line 474, in main
    run(_main())
  File "/usr/lib/python3.8/asyncio/runners.py", line 43, in run
    return loop.run_until_complete(main)
  File "/usr/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete
    return future.result()
  File "/usr/lib/python3.8/site-packages/cbus/daemon/cmqttd.py", line 448, in _main
    factory, addr[0], int(addr[1]))
IndexError: list index out of range 
beerygaz commented 3 years ago
  1. I needed to specify the port for the Wiser CNI in the CNI_ADDR variable
  2. I needed to specify the MQTT port using the MQTT_PORT variable
  3. I needed to specify MQTT_USE_TLS=0 as an environment variable too

After that the docker container came up perfectly. Thanks for a great bit of software.