lhemmen / python-xbee

Automatically exported from code.google.com/p/python-xbee
MIT License
0 stars 0 forks source link

api_commands and api_responses differ from Digi API doc dated 5.17.2010 #11

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Not sure if I'm missing something, but the api_commands and api_responses 
dictionaries seem to differ significantly from the API frame types and formats 
listed in the Digi Zigbee doc dated 5.17.2010.  Is there a different firmware 
or API I should be using or should I just update the dictionaries to reflect 
the (newer?) API in the Digi doc?  Thanks!

Original issue reported on code.google.com by gdr...@gmail.com on 8 Aug 2010 at 4:15

GoogleCodeExporter commented 9 years ago
The frames defined by api_commands and api_responses are XBee-specific and have 
no direct relation to the ZigBee protocol.

For more information, see the documentation for Digi XBee devices, posted here 
(http://www.digi.com/support/productdetl.jsp?pid=3130&osvid=0&s=358&tp=3) under 
the title "Product Manual: XBee / XBee-PRO 802.15.4 OEM RF Modules". The 
section titled "API Operation" beginning on page 57 describes how to operate 
XBee devices in API mode.

Original comment by pmalms...@gmail.com on 11 Aug 2010 at 9:18

GoogleCodeExporter commented 9 years ago
So based on some quick reading I just did, you're referring to series 1 devices 
from Digi and I'm referring to series 2.  Is that correct?

It looks like my series 2 devices cannot run the 802.15.4 firmware, the only 
option is ZNet or Zigbee.  Judging by the fact that you marked this as 
'wontfix', I'm guessing you aren't interested in including Zigbee compatibility 
in your code?  I've updated api_commands and api_responses for compatibility 
with Zigbee and would be happy to supply the code if you're interested.

Original comment by gdr...@gmail.com on 11 Aug 2010 at 10:19

GoogleCodeExporter commented 9 years ago
Hm. Maybe I misunderstood something. I'll take a look at the documentation for 
the XBee Series 2 devices and get up to speed (I have only tested this code 
with a series 1 device).

In the meantime, however, go ahead and try updating the code to work for you. 
My advice would be to create a new class with a recognizable name and put your 
modified api_commands and api_responses in there. Let me know if you get 
something working.

If you would like source control support, I have a Mercurial repository which 
you may  clone from here: 
http://bombadier.homeftp.net/hg/projects/python-xbee/main 
This is the latest code I am playing with.

Original comment by pmalms...@gmail.com on 11 Aug 2010 at 10:52

GoogleCodeExporter commented 9 years ago
Thanks for reconsidering.  I've got the code updated and working (for the most 
part) in my project.  I've cloned your repo, so I'll go ahead and create a new 
class and send you what I've done.

Original comment by gdr...@gmail.com on 12 Aug 2010 at 1:04

GoogleCodeExporter commented 9 years ago
I've updated the code to mostly work with the Series 2 devices.  I say mostly 
because there still appears to be an issue with how the code handles IO samples 
from series 2 devices, but since I'm not using that in my project its been a 
low priority to fix.  I updated the api commands and responses for series 2 and 
added some additional ones as well.  I also updated the XbeeBase class to 
handle variable length null terminated fields in the middle of frames (used in 
node_id_indicator frame), indicated by a field length of zero.  Diff is 
attached, feel free to use.

Original comment by gdr...@gmail.com on 28 Aug 2010 at 5:01

Attachments:

GoogleCodeExporter commented 9 years ago
Thank you very much for sending me your work! I'll set some time soon to 
integrate your work into the project.

Original comment by pmalms...@gmail.com on 1 Sep 2010 at 2:47

GoogleCodeExporter commented 9 years ago
Glad to help!  I'm also going to update the code to support escaped API mode 
since it appears to be more reliable.  I know this is available in series 2 
devices and I believe it also applies to series 1.  I'll forward you the diffs 
when I get that completed.

Original comment by gdr...@gmail.com on 1 Sep 2010 at 2:58

GoogleCodeExporter commented 9 years ago
Okay, your changes are in. A few things to note:

- I made a few name changes to clean things up. Your new class is now called 
ZigBee and is located in the zigbee.py module. I also renamed impl.y to 
ieee.py, and various comments were updated across a few modules. These changes 
make the library more consistent with Digi's naming scheme, as they have 
discarded the Series 1/2 monikers and now call the modules XBee 802.15.4 and 
XBee ZB ZigBee respectively.

- Some internal variables were renamed in an attempt to improve clarity and 
normalize
code style.

- I added a unit test for the new null-termination behavior which you added to 
XBeeBase._split_response. In the future, I would appreciate it if you included 
at least one unit test which verifies logic changes such as this. They can be 
found in the xbee/tests/ directory. Don't worry about testing changes to API 
command/response definitions though; they're just data.

Thanks!

Original comment by pmalms...@gmail.com on 4 Sep 2010 at 6:33

GoogleCodeExporter commented 9 years ago
Fixed as of version 2.0.0.

Original comment by pmalms...@gmail.com on 29 Dec 2010 at 10:02