Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop empty frames #600

Merged
merged 1 commit into from
Dec 11, 2023
Merged

Drop empty frames #600

merged 1 commit into from
Dec 11, 2023

Conversation

puddly
Copy link
Contributor

@puddly puddly commented Dec 11, 2023

It seems like zigbeed (or our TCP-enabling patchset for it) can sometimes send completely empty frames:

2023-12-11 14:47:18.882 DEBUG (MainThread) [zigpy.serial] Opening a serial connection to 'socket://core-silabs-multiprotocol:9999' (57600 baudrate)
2023-12-11 14:47:18.902 DEBUG (MainThread) [bellows.uart] Data frame: b'592a2c7e'
2023-12-11 14:47:18.902 DEBUG (MainThread) [bellows.uart] Sending: b'8610be7e'
2023-12-11 14:47:18.905 ERROR (MainThread) [homeassistant] Error doing job: Fatal error: protocol.data_received() call failed.
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/asyncio/selector_events.py", line 1003, in _read_ready__data_received
    self._protocol.data_received(data)
  File "/usr/local/lib/python3.11/site-packages/bellows/uart.py", line 76, in data_received
    self.frame_received(frame)
  File "/usr/local/lib/python3.11/site-packages/bellows/uart.py", line 103, in frame_received
    self.data_frame_received(data)
  File "/usr/local/lib/python3.11/site-packages/bellows/uart.py", line 124, in data_frame_received
    self._application.frame_received(self._randomize(data[1:-3]))
  File "/usr/local/lib/python3.11/site-packages/bellows/ezsp/__init__.py", line 305, in frame_received
    self._protocol(data)
  File "/usr/local/lib/python3.11/site-packages/bellows/ezsp/protocol.py", line 83, in __call__
    sequence, frame_id, data = self._ezsp_frame_rx(data)
                               ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/bellows/ezsp/v4/__init__.py", line 33, in _ezsp_frame_rx
    return data[0], data[2], data[3:]
           ~~~~^^^
IndexError: index out of range
2023-12-11 14:47:18.932 DEBUG (MainThread) [bellows.uart] Connection lost: IndexError('index out of range')

Copy link

codecov bot commented Dec 11, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (1ac01ed) 99.78% compared to head (c4d22f8) 99.78%.

Additional details and impacted files
@@           Coverage Diff           @@
##              dev     #600   +/-   ##
=======================================
  Coverage   99.78%   99.78%           
=======================================
  Files          67       67           
  Lines        4719     4722    +3     
=======================================
+ Hits         4709     4712    +3     
  Misses         10       10           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@puddly puddly merged commit 15b3223 into zigpy:dev Dec 11, 2023
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant