SparkFun Forums 

Where electronics enthusiasts find answers.

All things pertaining to wireless and RF links
By tnanoha
#177661
Hi,

I have just recently gotten 2 Xbee Series 1 and have been playing around with it for awhile.

I have gotten the Xbee's to communicate with each other using the X-CTU program and with the Xbee java-api (https://code.google.com/p/xbee-api/), however i would like to know if it is possible to configure the Xbee with the java-api for example changing the Channel, Source Address and 16 bit Destination Address.

Thanks in advance.
By Valen
#177682
Sure, the java-api sends commands to the Xbee in API packets. One of those is AT commands encapsulated into an API packet. You just have to read the manual of both the Xbee and the java api, and connect the dots.

I have no experience with Java, but to me it seems obvious from the example code shown on that page that it can do this. Would be a lousy api if it didn't.
By tnanoha
#177740
Thanks everyone for your reply.

stevech - The person who introduced this to me used the java-api so i decided to use it as well. Is it really the hard-way??

Valen - I looked through the java-api and i saw the XbeeConfiguration page but it was kind of brief, there was no examples given.
By Valen
#177742
Then it pays to look again and download the api zip file and look inside. I may not know how to 'brew a cup of java', but there seems plenty examples with enough commenting in it to get started. I did notice some hardwired (linux) serial ports references in the code, so it may require some tweaking before execution.

[Edit] Ignore the xbee manuals in the download. They are old versions. Get the latest from the digi website. Things changed a bit in later firmwares.
By Valen
#177743
tnanoha wrote:Thanks everyone for your reply.

stevech - The person who introduced this to me used the java-api so i decided to use it as well. Is it really the hard-way??

...
You should use the api in the programming language in which you are fluent. It depends if you are good in java, or better in another language like c/c++/arduino or a Basic flavour. It's hard if you don't speak java. Ofcourse it depends also on the computing platform, if it has the apropriate compiler for it.
By stevech
#177767
The best XBee library other than the one you write, are in C/C++. One is in the Arduino distributions. There are others.
There's one in Python, using the Serial library for python. I've used that.

Java could do it, but you'd be in Siberia doing it that way.