Home/Support/Support Forum/Use Python or Java to test PC to remote XBees?
Welcome to Digi Forum, where you can ask questions and receive answers from other members of the community.

Use Python or Java to test PC to remote XBees?

0 votes
Hi

Should I use Python, Java or somthing else?

I'm looking for code examples to test collecting analog and digital inputs from remote XBee 2.5 devices. I want to write test programs on my PC connected to a coordinator. Once the PC program is working properly then I'll port it to C to run on a microcontroller.

I can drive the modules with X-CTU easily, but Python has proven more difficult. However I really need to use the API mode.

There are a few examples on the web for Python and Java but they are poorly documented. Python libraries are available but apart from some random example code there is no documentation on how to use the libraries. Well not that I can find.

I've seen some Java libraries. Maybe these are better supported.

Advice please.

It seems like everyone wants example code and documented libraries for getting and setting IO on remote devices. Maybe Digi has these already, but I can't find them.
asked Aug 6, 2010 in 3rd Party Python and API development in other Languages by slicker New to the Community (7 points)

Please log in or register to answer this question.

3 Answers

0 votes
Digi's ConnectPort-X gateways (and other capable products) use an embedded python 2.4.3 interpreter, so if you may eventually port your application to a ConnectPort X you'd likely want to go that route. We also have a wealth of python code examples to do various things at this link:

http://www.digi.com/wiki/developer/index.php/Python_Wiki

The other thing I need to mention is that development on the ZNet 2.5 stack has ended, so I'd highly recommend migrating your wireless network from ZNet 2.5 to ZB before beginning your development.

Though we still offer ZNet 2.5 modules to customers with applications based on that technology, most of the examples at our Python wiki will be ZB-based.

Instructions on how to migrate from ZNet 2.5 to ZB can be found here: http://www.digi.com/support/kbase/kbaseresultdetl.jsp?id=3025
answered Aug 6, 2010 by Admin Veteran of the Digi Community (732 points)
0 votes
Thanks for the reply.

I had the upgrade kit, so I've done the upgrade. Just have to figure out what config changes are necessary to run the range tests again.

I guess this thread should move forums now.

The application will never use ip, so the ConnectPort option is not suitable.

The Python Wiki is good, but concentrates on Digi hardware like ConnectPort , adaptors etc. This isn't surprising. Some of the code might be suitable. It is well documented.

What I really want is a well documented guide to show how to run Python on a PC and connect a ZB device to others for reading hardware.

An equivalent C version would be even better. When the code runs perfectly on the PC it could be easily ported to a microcontroller.
answered Aug 6, 2010 by slicker New to the Community (7 points)
0 votes
I've moved your thread to a forum more apt to get a response by programmers, since that's who your question is directed at.

As far as running python from a PC, you'll need the zigbee.py for PC file: ftp://ftp1.digi.com/support/sampleapplications/zigbee_py-for-PC.zip
answered Aug 11, 2010 by Admin Veteran of the Digi Community (732 points)
...