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

Project file read fails in presence of DLTD labels #39

Open bdnstn opened 2 years ago

bdnstn commented 2 years ago

Project file reading fails with error: cbus.toolkit.cbz.CBZException: Expected 1 file in CBZ archive, got 11

Issue appears to be the presence of xxx-DLTD-index.txt and xxx-DLTD-PicNNNN.bmp files in the project zip. Deleting those files from the archive allowed to project import to succeed.

Error in log

Using C-Bus Toolkit project backup file /share/BURS1303.cbz Local time zone: Australia/Perth Current time: Sun, 28 Aug 2022 07:33:28 +0800 Running cmqttd with flags: --broker-address core-mosquitto --timesync 300 --serial /dev/serial/by-id/usb-Prolific_Technology_Inc._USB-Serial_Controller-if00-port0 --broker-disable-tls --broker-auth /etc/cmqttd/auth --project-file /share/BURS1303.cbz Traceback (most recent call last): File "/usr/bin/cmqttd", line 33, in <module> sys.exit(load_entry_point('cbus==0.2', 'console_scripts', 'cmqttd')()) File "/usr/lib/python3.10/site-packages/cbus/daemon/cmqttd.py", line 492, in main run(_main()) File "/usr/lib/python3.10/asyncio/runners.py", line 44, in run return loop.run_until_complete(main) File "/usr/lib/python3.10/asyncio/base_events.py", line 646, in run_until_complete return future.result() File "/usr/lib/python3.10/site-packages/cbus/daemon/cmqttd.py", line 449, in _main labels = (read_cbz_labels(option.project_file) File "/usr/lib/python3.10/site-packages/cbus/daemon/cmqttd.py", line 295, in read_cbz_labels cbz = CBZ(cbz_file) File "/usr/lib/python3.10/site-packages/cbus/toolkit/cbz.py", line 228, in __init__ raise CBZException( cbus.toolkit.cbz.CBZException: Expected 1 file in CBZ archive, got 11

Project backup contents

image