We received a buffer length of 1 from the RS485 module, but data buffer length is 0. This should not occur.
See original GitHub issueToday I did a fresh installation with this commands:
sudo rm -r /etc/twcmanager
sudo rm -r TWCManager
git clone https://github.com/ngardiner/TWCManager
cd TWCManager
git checkout main
make install
Then installed my own 3 files
config.json
(see pull request #302 )
TWCMaster.py
(I use always ‘1’ phases at line 637)
Volkszahler.py
(see pull request #302)
(Note: If I would use all original files then same errors occur.)
Then tryout
python -m TWCManager
Result is IndexError: index out of range
at line 171 of TWCManager.py
if msgLen == 0 and data[0] != 0xC0:
Here is “logLevel”: 10 all info: 12:19:51 TWCMaster 14 Registered module ConsoleLogging 12:19:51 TWCMaster 14 Released module FileLogging 12:19:51 TWCMaster 14 Released module SentryLogging 12:19:51 TWCMaster 14 Registered module TWCProtocol 12:19:51 TWCMaster 14 Registered module RS485 12:19:51 TWCMaster 14 Registered module Policy 12:19:51 TWCMaster 14 Registered module TeslaAPI 12:19:51 TWCMaster 14 Released module WebIPCControl 12:19:51 HTTPContro 20 Serving at port: 8181 12:19:51 TWCMaster 14 Registered module HTTPControl 12:19:51 TWCMaster 14 Released module Kostal 12:19:51 TWCMaster 14 Released module OpenHab 12:19:51 TWCMaster 14 Released module TeslaPowerwall2 12:19:51 TWCMaster 14 Registered module Volkszahler 12:19:51 TWCManager 20 TWC Manager starting as fake Master with id 7777 and sign 77 12:19:51 TWCMaster 13 Send master linkready1 12:19:51 RS485 12 Tx@: C0 FC E1 77 77 77 00 00 00 00 00 00 00 00 46 C0 12:19:51 TWCMaster 13 Send master linkready1 12:19:51 RS485 12 Tx@: C0 FC E1 77 77 77 00 00 00 00 00 00 00 00 46 C0 12:19:52 TWCMaster 13 Send master linkready1 12:19:52 RS485 12 Tx@: C0 FC E1 77 77 77 00 00 00 00 00 00 00 00 46 C0 12:19:52 TWCMaster 13 Send master linkready1 12:19:52 RS485 12 Tx@: C0 FC E1 77 77 77 00 00 00 00 00 00 00 00 46 C0 12:19:52 TWCMaster 13 Send master linkready1 12:19:52 RS485 12 Tx@: C0 FC E1 77 77 77 00 00 00 00 00 00 00 00 46 C0 12:19:52 TWCMaster 13 Send master linkready2 12:19:52 RS485 12 Tx@: C0 FB E2 77 77 77 00 00 00 00 00 00 00 00 47 C0 12:19:52 TWCMaster 13 Send master linkready2 12:19:52 RS485 12 Tx@: C0 FB E2 77 77 77 00 00 00 00 00 00 00 00 47 C0 12:19:52 TWCMaster 13 Send master linkready2 12:19:52 RS485 12 Tx@: C0 FB E2 77 77 77 00 00 00 00 00 00 00 00 47 C0 12:19:52 TWCMaster 13 Send master linkready2 12:19:52 RS485 12 Tx@: C0 FB E2 77 77 77 00 00 00 00 00 00 00 00 47 C0 12:19:52 TWCMaster 13 Send master linkready2 12:19:52 RS485 12 Tx@: C0 FB E2 77 77 77 00 00 00 00 00 00 00 00 47 C0 Traceback (most recent call last): File “/home/pi/TWCManager/TWCManager.py”, line 717, in <module> if msgLen == 0 and data[0] != 0xC0: IndexError: index out of range 12:20:05 TWCManager 20 Unhandled Exception:Traceback (most recent call last): File “/home/pi/TWCManager/TWCManager.py”, line 717, in <module> if msgLen == 0 and data[0] != 0xC0: IndexError: index out of range
Traceback (most recent call last): File “/home/pi/TWCManager/TWCManager.py”, line 717, in <module> if msgLen == 0 and data[0] != 0xC0: IndexError: index out of range 12:20:33 TWCManager 20 Unhandled Exception:Traceback (most recent call last): File “/home/pi/TWCManager/TWCManager.py”, line 717, in <module> if msgLen == 0 and data[0] != 0xC0: IndexError: index out of range
^CTraceback (most recent call last): File “/home/pi/TWCManager/TWCManager.py”, line 717, in <module> if msgLen == 0 and data[0] != 0xC0: IndexError: index out of range
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File “/usr/lib/python3.7/runpy.py”, line 193, in _run_module_as_main “main”, mod_spec) File “/usr/lib/python3.7/runpy.py”, line 85, in _run_code exec(code, run_globals) File “/home/pi/TWCManager/TWCManager.py”, line 1561, in <module> time.sleep(5) KeyboardInterrupt
Issue Analytics
- State:
- Created 2 years ago
- Comments:9 (4 by maintainers)
Top GitHub Comments
Just to add some info: You could alternatively use
/dev/serial/by-path/platform-3f980000.usb-usb-0:1.4:1.0-port0
or/dev/serial/by-id/usb-1a86_USB2.0-Ser_-if00-port0
in de TCWManagerconfig.json
. Useby-path
if you always plug in at the same port, this means it will still work if you replace the converter. If you useby-id
it doesn’t matter which port, as long as you don’t replace.I have added your instructions to: https://github.com/ngardiner/TWCManager/blob/main/docs/config_examples.md
Thanks for the clear steps, this will be helpful to others with multiple USB to Serial interfaces