birdie1 / victron

Victron bluetooth and serial communication at a python script. With MQTT and HomeAssistant support.
GNU General Public License v3.0
125 stars 16 forks source link

SER# requested for smartshunt on serial interface #4

Closed niecore closed 2 years ago

niecore commented 2 years ago

Hello,

I got following crash:

(venv) pi@rpi-jinx:~/victron $ python victron.py -d 0
Exception in thread Thread-2:
Traceback (most recent call last):
  File "/usr/lib/python3.9/threading.py", line 954, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.9/threading.py", line 1266, in run
    self.function(*self.args, **self.kwargs)
  File "/home/pi/victron/victron.py", line 25, in victron_thread
    v = Victron(config, vdevice_config, output, args, thread_count, thread_q)
  File "/home/pi/victron/lib/victron.py", line 40, in __init__
    pid, ser, fw = self.victron_type.get_device_info()
  File "/home/pi/victron/lib/victron_serial/victron_serial.py", line 26, in get_device_info
    return self.victron_device.get_device_info()
  File "/home/pi/victron/lib/victron_serial/victron_smartshunt.py", line 61, in get_device_info
    ser = self.MAP['SER#'][4](data['SER#'], self.MAP['SER#'])
KeyError: 'SER#
devices:
    - name: Shunt1
      type: smartshunt
      protocol: serial
      port: /dev/ttyUSB0

It seems like the smartshunt is not supporting this field on the serial interface.

birdie1 commented 2 years ago

My smartshunt is currently not connected via serial. I will try to test it the next days and see if I can reproduce the error.

fti7 commented 2 years ago

I have the same issue (Latest Smartshunt Firmware via Serial)

birdie1 commented 2 years ago

Fixed with commit 06d75538ff4b6b3ede639f96f4c0634f5d16fe6b