Po uruchomieniu skryptu na linux'ie otrzymałem komunikat:
admin@nas:~/DeyeInverter-main$ **sudo python InverterData.py**
Traceback (most recent call last):
File "InverterData.py", line 18, in <module>
os.chdir(os.path.dirname(sys.argv[0]))
FileNotFoundError: [Errno 2] No such file or directory: ''
Zakomentowałem 18 linię i uruchomiłem ponownie i otrzymałem błąd:
Traceback (most recent call last):
File "InverterData.py", line 108, 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 13, in twosComplement_hex
val = int(hexval, bits)
ValueError: invalid literal for int() with base 16: ''
Wstawiłem w kodzie print ze zmiennej "data" i dostaję wynik:
0
DATA:
b"\xa5\x10\x00\x10\x15\x00<\xa0\x1fjf\x02\x01@f\x98\x00/\x0e\x00\x00'\x13\xbc`\x05\x00\xd9\x15"
0x003B-Running Status:21
Traceback (most recent call last):
File "InverterData.py", line 110, 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 13, in twosComplement_hex
val = int(hexval, bits)
ValueError: invalid literal for int() with base 16: ''
Po uruchomieniu skryptu na linux'ie otrzymałem komunikat:
Zakomentowałem 18 linię i uruchomiłem ponownie i otrzymałem błąd:
Wstawiłem w kodzie print ze zmiennej "data" i dostaję wynik:
Mój konfig:
Co może być nie tak?
Pozdrawiam, Paweł