lumapu / ahoy

Various tools, examples, and documentation for communicating with Hoymiles microinverters
https://ahoydtu.de
Other
936 stars 220 forks source link

[Bug] IndexError: bytearray index out of range #1218

Open haufsolutions opened 8 months ago

haufsolutions commented 8 months ago

Platform

RaspberryPi

Assembly

I did the assebly by myself

nRF24L01+ Module

nRF24L01+ plus

Antenna

external antenna

Power Stabilization

Elko (~100uF)

Connection picture

Version

latest

Github Hash

e5d78bf5b42363751bc3956c0ce465d1f75d43bb

Build & Flash Method

was already installed

Setup

mqtt: host: edited username & password: ''

inverters: serial: edited

Debug Serial Log output

xxx:/home/pi/ahoy/tools/rpi# python3 -um hoymiles --log-transactions --verbose --config ahoy.yml | tee -a log2.log
Using python Module: RF24
Traceback (most recent call last):
  File "/home/pi/ahoy/tools/rpi/hoymiles/__main__.py", line 153, in main_loop
    poll_inverter(inverter, dtu_ser, do_init, transmit_retries)
  File "/home/pi/ahoy/tools/rpi/hoymiles/__main__.py", line 206, in poll_inverter
    while com.rxtx():
  File "/home/pi/ahoy/tools/rpi/hoymiles/__init__.py", line 660, in rxtx
    for response in self.radio.receive():
  File "/home/pi/ahoy/tools/rpi/hoymiles/__init__.py", line 432, in receive
    time_rx=datetime.now()
  File "/home/pi/ahoy/tools/rpi/hoymiles/__init__.py", line 262, in __init__
    if f_crc8(payload[:-1]) != payload[-1]:
IndexError: bytearray index out of range
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/ahoy/tools/rpi/hoymiles/__main__.py", line 416, in <module>
    main_loop(ahoy_config)
  File "/home/pi/ahoy/tools/rpi/hoymiles/__main__.py", line 153, in main_loop
    poll_inverter(inverter, dtu_ser, do_init, transmit_retries)
  File "/home/pi/ahoy/tools/rpi/hoymiles/__main__.py", line 206, in poll_inverter
    while com.rxtx():
  File "/home/pi/ahoy/tools/rpi/hoymiles/__init__.py", line 660, in rxtx
    for response in self.radio.receive():
  File "/home/pi/ahoy/tools/rpi/hoymiles/__init__.py", line 432, in receive
    time_rx=datetime.now()
  File "/home/pi/ahoy/tools/rpi/hoymiles/__init__.py", line 262, in __init__
    if f_crc8(payload[:-1]) != payload[-1]:
IndexError: bytearray index out of range

Error description

I installed the RPI method using the NRF24 wrapper on Debian 10. I noticed the error will mostly vary if I switch between tzlocal versions. Or maybe I'm missing something?

lumapu commented 8 months ago

the Raspberry version is only slightly maintained. The focus of this repository is most regarding ESP8266 and ESP32. Hopefully somebody is out there who can help you. I mention @PaeserBastelstube because he provided the last merged PR.