Open LuisPinaSoares opened 8 years ago
Hi Luis, sorry for the late response, but hopefully I can be some help.
Am I correct in believing that this ValueError is raised? https://github.com/nioinnovation/python-xbee/blob/master/xbee/zigbee.py#L207
Your proposed fix sounds reasonable for this situation you're seeing (and I definitely agree that the checksum should be used in place of what's there), but I wonder why I don't see this behavior documented here: http://examples.digi.com/wp-content/uploads/2012/07/XBee_ZB_ZigBee_AT_Commands.pdf
Did you ever find any XBee documentation to back up what you are saying is a 4 byte device identifier?
Hi,
There is a Device Type identifier (DD) command in the AT commands (Addressing commands), page 128 of the document:
DD Device Type Identifier. Stores a device type value. This value can be used to differentiate different XBee-based devices. Digi reserves the range 0 - 0xFFFFFF. For example, Digi currently uses the following DD values to identify various ZigBee products: 0x30001 - ConnectPort X8 Gateway 0x30002 - ConnectPort X4 Gateway 0x30003 - ConnectPort X2 Gateway ... CRE 0 - 0xFFFFFFFF 0x30000
I think in the case of the ND command they added the DD (Device Type Identifier) to the answer payload (for some reason they might have started to have the need for that info), and because of that when the answer is parsed you get the, ValueError.
It concerns me that the documentation for ND doesn't mention anything about a 4 byte Device Type identifier (just the Device Type), but it does look like your analysis of the response frame you're getting makes sense.
Is there some new (undocumented) firmware that you are using? Or maybe it's specific to Pro S2B? Did you try with the regular S2B?
Given that the code fix you suggested works for you, I'm happy to review and merge a pull request that fixes the problem. Please write the code in such a way that a frame without those extra 4 bytes is still properly parsed.
OK. As soon as i am able to look into that, i will make the pull request.
Hi @LuisPinaSoares did you get round to putting together a PR for this issue?
Hi James,
I havent.
The reason for this, is i later found out that the code didnt work because i changed the DD value on the coordinator, to a diferent value than the default.
When i changed back to a default value the problem was solved.
Later the diferent DD values should besuported in the code, but if you use a default value there will be no issue with the current code version. If you change the DD value to some non default values, the coordinator will give a new key in the ND response request dictionary, "device_type_identifier", which is not parsed currently.
Regards
On Wed, Aug 17, 2016 at 5:36 PM, James Saunders notifications@github.com wrote:
Hi @LuisPinaSoares https://github.com/LuisPinaSoares did you work out a code fix for this issue?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/nioinnovation/python-xbee/issues/1#issuecomment-240470010, or mute the thread https://github.com/notifications/unsubscribe-auth/ALaje7Iv6sJaN_33xN-LrYh3zng2NzLdks5qgzh3gaJpZM4GUnO7 .
What steps will reproduce the problem?
What is the expected output? What do you see instead?
You were expected to receive the following information associated with the ND command refered in the datasheet:
QUOTE:
Node Discover. Discovers and reports all RF modules found. The following information is reported for each module discovered. MY
SH
SL
NI (Variable length)
PARENT_NETWORK ADDRESS (2 Bytes)
DEVICE_TYPE (1 Byte: 0=Coord, 1=Router, 2=End Device)
STATUS (1 Byte: Reserved)
PROFILE_ID (2 Bytes)
CRE
MANUFACTURER_ID (2 Bytes)