tmkasun / solar-hybrid-inverter-monitor

Monintor Hybrid inverters
https://energy.knnect.com/
MIT License
9 stars 3 forks source link

QinHeng Electronics HL-340 USB-Serial adapter #2

Open lasitha-sparrow opened 1 year ago

lasitha-sparrow commented 1 year ago

my sako sunon pro has QinHeng Electronics HL-340 USB-Serial adapter instead of mentioned Cypress Semiconductor USB to Serial module. this is the output i get when i run this code

hi@raspberrypi:~/solar-hybrid-inverter-monitor $ python tools/check-inverter.py connected to: /dev/ttyUSB0
True
0
Traceback (most recent call last):
  File "tools/check-inverter.py", line 18, in <module>
    ser.write(bytes.fromhex(START))
AttributeError: type object 'str' has no attribute 'fromhex'
tmkasun commented 1 year ago

Hi @lasitha-sparrow ,

It seems like you have python3, This will only work with python2