flyte / python-xbee

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

Examples for API mode? #15

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
All provided examples are using AT mode. API mode is by far more interesting 
and more useful, but unfortunately less easy to debug since it lacks an 
interactive and simple mode.

Is it possible to add a simple example, e.g. for the led_adc_example.py to use 
ZigBee instead of XBee? Setting an LED on a remore XBee and reading a remove 
ADC value is most useful and would provide a nice example.

Original issue reported on code.google.com by harald.k...@gmail.com on 11 Feb 2011 at 8:35

GoogleCodeExporter commented 8 years ago
Hmm...classified now as a software defect. This is clearly a documentation 
enhancement request, not a defect. I cannot seem to change it though.

Original comment by harald.k...@gmail.com on 11 Feb 2011 at 8:37

GoogleCodeExporter commented 8 years ago
Well...that was easier than I expected.
Got it running. Attached is the small example file.
Feel free to fix any errors, beautify it, add to the examples in the archive.

I had to do some changes as the older xbee-python library (back when ZB support 
was incomplete) was different in many ways.

Great library. Even without knowing Python (my Python skills are mostly based 
on educated guessing) I was able to make the example work.

Original comment by harald.k...@gmail.com on 11 Feb 2011 at 1:58

Attachments:

GoogleCodeExporter commented 8 years ago
Hi Harald,

Before making claims such as this:

"All provided examples are using AT mode."

please read the documentation a little more thoroughly. This library does not 
provide any "AT mode" functionality; it operates strictly with the XBee/XBee ZB 
binary "API  mode" by providing a convenient way to send AT commands in the 
proper format.

As for your point about providing ZigBee examples, it is worth noting that the 
documentation provides instructions for how to use the examples with ZigBee 
devices (as you discovered, replace XBee with ZigBee). I can see the benefit of 
your suggestion though, and I will include your sample code when I get a chance.

If you are interested, a few more of the examples converted for and tested with 
XBee ZBs would be nice. Feel free to play with some of those.

Thanks,
~Paul Malmsten

Original comment by pmalms...@gmail.com on 11 Feb 2011 at 6:19

GoogleCodeExporter commented 8 years ago
I submitted another 'Defect" (which should be again an "Improvement request", 
but I it seems "Defect" is default and only you can change this).

Yes, I'll happily provide some working ZigBee examples. It's exactly what I am 
doing now. I'm sure someone else can benefit from those as I benefit from this 
library.

Original comment by harald.k...@gmail.com on 12 Feb 2011 at 2:20

GoogleCodeExporter commented 8 years ago
As for my comment "All provided examples are using AT mode", that should have 
been "All provided examples are using Series 1 XBees". I don't know what was 
going on with my brain and fingers when I wrote this about AT mode. I obviously 
mixed us AT/API and XBee Series 1 and Series 2.

Original comment by harald.k...@gmail.com on 12 Feb 2011 at 2:47