Home/Support/Support Forum/Java to XBee communication

Java to XBee communication

0 votes

I'm trying to send some data from a java application to an Arduino Uno via XBee S2.
I have 1 XBee connected to my pc via XBee USB Adapter and 1 XBee connected to Arduino Uno via XBee Shield (the red one) and also the Arduino connected to the pc.
The XBee connected to my pc via USB Adapter is the coordinator and have the following settings:
ZigBee Coordinator API
-ID 1111
-AP 2

The XBee connected to Arduino via Shield is the remote and have the following settings:
ZigBee Router API
-ID 1111
-AP 2

XBee Java Library: https://github.com/digidotcom/XBeeJavaLibrary
XBee Arduino Library: https://github.com/andrewrapp/xbee-arduino

Java Main Class: https://github.com/digidotcom/XBeeJavaLibrary/blob/master/examples/communication/explicit/SendExplicitDataSample/src/com/digi/xbee/api/sendexplicitdata/MainApp.java

Connecting my REMOTE-1 XBee via USB Adapter to XCTU (MASTER also connected to pc via USB Adapter), I am able to receive the message sent from my MainApp.java class in XCTU console.

But when the REMOTE-1 its mounted on Arduino Uno I can't manage to receive any data from my MainApp class or XCTU console.

I had tried many examples including:
- https://github.com/andrewrapp/xbee-arduino/blob/master/examples/Series2_IoSamples/Series2_IoSamples.pde (did the required configuration from comments)
- https://dzone.com/articles/xbee-zigbee-complaint (did the required configurations)
- https://learn.sparkfun.com/tutorials/xbee-shield-hookup-guide/example-communication-test

How could I receive my msg sent from my MainApp.java class on my Arduino?
Any example would be great.
Thank you for reading. I appreciate it.
asked Nov 29, 2016 in XBee Programmable Development by hodispk New to the Community (0 points)
edited Nov 3, 2016 by hodispk

Please log in or register to answer this question.

1 Answer

0 votes
Are you able to see the Remote 1 when connected to the Arduino via a Node Discovery? If you are, then it is truly a software related issue.

That is where I would take the XBee modules out of the picture and just wire the Arduino to the PC via the XBee connector. Then just simply get the application sending data that you can verify is being sent out the XBee socket and that it is a valid API frame.
answered Dec 2, 2016 by mvut Veteran of the Digi Community (15,323 points)