Closed halkeye closed 6 years ago
If i wanted to start writing patches for this, what should i do?
@halkeye Just create a Pull Request.
Sorry I mean how can I debug this?
Like how do I get started
Check out the code. Run 'python3 setup.py develop'. Try to add some more debug printing. Try to reproduce the problem.
Hope this helps.
debug: Send command getEui64
debug: Sending: b'674c218ea1627e'
debug: Data frame: b'4ca18e03cd07b959fb4725aebd7e'
debug: Sending: b'8520dd7e'
debug: Application frame 171 (setValue) received
Exception in callback SerialTransport._read_ready()
handle: <Handle SerialTransport._read_ready()>
Traceback (most recent call last):
File "/usr/lib/python3.4/asyncio/events.py", line 120, in _run
self._callback(*self._args)
File "/srv/homeassistant/lib/python3.4/site-packages/serial_asyncio/__init__.py", line 106, in _read_ready
self._protocol.data_received(data)
File "/home/homeassistant/bellows/bellows/uart.py", line 61, in data_received
self.frame_received(frame)
File "/home/homeassistant/bellows/bellows/uart.py", line 73, in frame_received
self.data_frame_received(data)
File "/home/homeassistant/bellows/bellows/uart.py", line 94, in data_frame_received
self._application.frame_received(self._randomize(data[1:-3]))
File "/home/homeassistant/bellows/bellows/ezsp.py", line 179, in frame_received
result, data = t.deserialize(data, schema)
File "/home/homeassistant/bellows/bellows/types/__init__.py", line 9, in deserialize
value, data = type_.deserialize(data)
File "/home/homeassistant/bellows/bellows/types/basic.py", line 13, in deserialize
r = cls(int.from_bytes(data[:cls._size], 'little', signed=cls._signed))
File "/usr/lib/python3.4/enum.py", line 222, in __call__
return cls.__new__(cls, value)
File "/usr/lib/python3.4/enum.py", line 457, in __new__
raise ValueError("%r is not a valid %s" % (value, cls.__name__))
ValueError: 153 is not a valid EzspStatus
debug: NAK frame: b'a18e03cd07b959fb4725b5157e'
Wow, something is very weird here -- the NCP shouldn't be responding to getEUI64 with setValue. If I had to guess, I'd say data is somehow being corrupted on the wire. I haven't decoded the setValue frame that's received by hand to examine what's going on, but I bet that the first improvement here would be to validate the CRC on the frame received from EZSP and act accordingly if it's wrong.
I found a way to reproduce this issue. I will test it tomorrow and try to see if it is a crc issue.
Den 15. okt. 2017 19.45 skrev "Russell Cloran" notifications@github.com:
debug: Send command getEui64 debug: Sending: b'674c218ea1627e' debug: Data frame: b'4ca18e03cd07b959fb4725aebd7e' debug: Sending: b'8520dd7e' debug: Application frame 171 (setValue) received Exception in callback SerialTransport._read_ready() handle: <Handle SerialTransport._read_ready()> Traceback (most recent call last): File "/usr/lib/python3.4/asyncio/events.py", line 120, in _run self._callback(*self._args) File "/srv/homeassistant/lib/python3.4/site-packages/serial_asyncio/init.py", line 106, in _read_ready self._protocol.data_received(data) File "/home/homeassistant/bellows/bellows/uart.py", line 61, in data_received self.frame_received(frame) File "/home/homeassistant/bellows/bellows/uart.py", line 73, in frame_received self.data_frame_received(data) File "/home/homeassistant/bellows/bellows/uart.py", line 94, in data_frame_received self._application.frame_received(self._randomize(data[1:-3])) File "/home/homeassistant/bellows/bellows/ezsp.py", line 179, in framereceived result, data = t.deserialize(data, schema) File "/home/homeassistant/bellows/bellows/types/init.py", line 9, in deserialize value, data = type.deserialize(data) File "/home/homeassistant/bellows/bellows/types/basic.py", line 13, in deserialize r = cls(int.from_bytes(data[:cls._size], 'little', signed=cls._signed)) File "/usr/lib/python3.4/enum.py", line 222, in call return cls.new(cls, value) File "/usr/lib/python3.4/enum.py", line 457, in new raise ValueError("%r is not a valid %s" % (value, cls.name)) ValueError: 153 is not a valid EzspStatus debug: NAK frame: b'a18e03cd07b959fb4725b5157e'
Wow, something is very weird here -- the NCP shouldn't be responding to getEUI64 with setValue. If I had to guess, I'd say data is somehow being corrupted on the wire. I haven't decoded the setValue frame that's received by hand to examine what's going on, but I bet that the first improvement here would be to validate the CRC on the frame received from EZSP and act accordingly if it's wrong.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/rcloran/bellows/issues/58#issuecomment-336728269, or mute the thread https://github.com/notifications/unsubscribe-auth/AIa7l2i3xQleoJ3h-qRUzVMXG9TC4H8Eks5sskTVgaJpZM4PmHoi .
@halkeye Can you try to test with my PR with the new CRC check?
I'll have to keep poking at it over the next couple days. I forgot how i triggered it. Its certainly not happening anymore with my smartthings motion sensor gen 1, but i forgot how to tell my blinds to go into join mode.
I think its nicer now.
Not sure what is useful for debugging, so including the entire stack trace.
I'm really just playing around with the HUSBZB-1 and seeing if i can't add some random zigbee devices I have.
If i run it again i'm getting