core: Warnings and errors with zigpy_znp
The problem
Recently upgraded to a zzh CC2652R Stick from a CC2531 (new host for HA as well so everything is set up new) and I am seeing warnings and errors in logs on every HA restart. I did not see these same errors with the CC2531.
What is version of Home Assistant Core has the issue?
2021.5.0b5
What was the last working version of Home Assistant Core?
No response
What type of installation are you running?
Home Assistant OS
Integration causing the issue
zha
Link to integration documentation on our website
https://www.home-assistant.io/integrations/zha/
Example YAML snippet
n/a - config flow
Anything in the logs that might be useful for us?
Logger: zigpy_znp.api
Source: /usr/local/lib/python3.8/site-packages/zigpy_znp/api.py:393
First occurred: 12:20:31 AM (2 occurrences)
Last logged: 12:20:31 AM
Received an unhandled command: ZDO.SrcRtgInd.Callback(DstAddr=0x7FD9, Relays=[])
Received an unhandled command: AF.IncomingMsg.Callback(GroupId=0x0000, ClusterId=6, SrcAddr=0x7FD9, SrcEndpoint=1, DstEndpoint=1, WasBroadcast=<Bool.false: 0>, LQI=72, SecurityUse=<Bool.false: 0>, TimeStamp=377188, TSN=0, Data=b'\x08\xA8\x0A\x00\x00\x10\x01', MacSrcAddr=0x7FD9, MsgResultRadius=29)
Logger: zigpy_znp.uart
Source: /usr/local/lib/python3.8/site-packages/zigpy_znp/uart.py:82
First occurred: 12:20:47 AM (1 occurrences)
Last logged: 12:20:47 AM
Received an exception while passing frame to API
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/zigpy_znp/uart.py", line 80, in data_received
self._api.frame_received(frame.payload)
File "/usr/local/lib/python3.8/site-packages/zigpy_znp/api.py", line 359, in frame_received
command = command_cls.from_frame(frame)
File "/usr/local/lib/python3.8/site-packages/zigpy_znp/types/commands.py", line 412, in from_frame
params[param.name], data = param.type.deserialize(data)
File "/usr/local/lib/python3.8/site-packages/zigpy_znp/types/basic.py", line 197, in deserialize
item, data = cls._item_type.deserialize(data)
File "/usr/local/lib/python3.8/site-packages/zigpy/types/basic.py", line 480, in deserialize
item, data = cls._item_type.deserialize(data)
File "/usr/local/lib/python3.8/site-packages/zigpy/types/basic.py", line 53, in deserialize
raise ValueError(f"Data is too short to contain {cls._size} bytes")
ValueError: Data is too short to contain 1 bytes
Additional information
No response
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 20 (8 by maintainers)
Commits related to this issue
- Allow deserialization failures with some commands. See https://github.com/home-assistant/core/issues/50005 — committed to zigpy/zigpy-znp by puddly 3 years ago
“Fixed” by https://github.com/zigpy/zigpy-znp/commit/aaf0c31fb3a6ded29e3c8e6036478a64d6011c84, which will be included in the next zigpy-znp release.
The ZDO parent announce response command sent by your bulb is nonsensical so there’s really nothing to be done other than make an exception and swallow the warning:
These errors are gone thank you!
I appreciate the debugging help!
You can leave this issue open. Whenever the
zigpy-znp==0.5.1
dependency update lands up in the next HA beta, I’ll just leave a comment. If you see theReceived an exception while passing frame to API
error in your log file again after that beta, it will have the extra data appended to the end of it of so you won’t need to mess with logging at all.Here’s what I see on beta Home Assistant OS (
2021.5.0b8
) in VirtualBox with nothing else set up but ZHA:My entire config is as follows:
Like I said before, if it’s an intermittent startup error and it’s going to be too much of a hassle to get debug logging working properly to figure this out (for whatever reason), it’ll be easier to just wait until the next beta with the updated version of
zigpy-znp
that logs this error message to contain everything I need to see what the problem is (without having to enable this very verbose logging).