MichaluxPL / Sofar_LSW3

Get MODBUS data from Sofar (K-TLX) inverter through LSW-3 or LSE module
GNU General Public License v3.0
99 stars 47 forks source link

Traceback error #4

Closed stingone closed 2 years ago

stingone commented 3 years ago

I tried running the code and get the error below.

Traceback (most recent call last): File "./InverterData.py", line 153, in <module> response=twosComplement_hex(str(''.join(hex(ord(chr(x)))[2:].zfill(2) for x in bytearray(data))+' '+re.sub('[^\x20-\x7f]', '', ''))[p1:p2]) File "./InverterData.py", line 20, in twosComplement_hex val = int(hexval, bits) ValueError: invalid literal for int() with base 16: ''

MichaluxPL commented 3 years ago

It appears You don't get any answer from Your logger/inverter or it uses different register's addresses that configured. In place the script expects to find a number value it gets empty string - that's why it throws this error.