No data received with con_RxWait

142 views
Skip to first unread message

Matthieu Anceret

unread,
Mar 5, 2013, 11:06:34 AM3/5/13
to lib...@googlegroups.com
Hi, 

Sorry for my English, but I'm a French student and I write poorly in English. 
I work with several Xbee modules : 
- 1 coordinator (Xbee S2 ; XB24-B ZNet 2.5 Coordinator API v1197) link to a computer (USB)
- and 1 and more end devices (XB24-B ZNet 2.5 Router/End Device API v1347) link to a Arduino Uno board

They are configurated with the same channel, same PAN-ID and they used API level 2. 

End devices used xbee-Arduino lib (https://code.google.com/p/xbee-arduino/) and they send a frame every second to the coordinator.  

For my coordinator, I use a C++ software with libxbee. This software reads all frames it receives. And this is the problem... 
Follow this link for check my code : http://pastebin.com/C1PGCkcP

Thanks for your help. 
Best records. 



Attie Grande

unread,
Mar 5, 2013, 11:36:49 AM3/5/13
to Matthieu Anceret, libxbee
Hi Matthieu,

My first suggestion would be to set the coordinator (connected via USB) to API mode 1 - libxbee does not use mode 2 by default for a number of reasons.

I also noticed that you are setting up an I/O connection (line 52). If your Arduinos are sending data, then this is not what you wanted - you want "Data".

The final point is that you have enabled callbacks (line 60), and you're then trying to call xbee_conRx() on the connection, which won't work.
As you have enabled callbacks, the callback function will be called once per received packet, and you cannot retrieve the packets by using xbee_conRx().

The final point to check is hardware flow control - libxbee has this enabled by default.


If you for whatever reason want to use API mode 2, or disable hardware flow control, then please modify the config.mk before you build libxbee.

I hope that helps to fix your issue!
Attie



--
You received this message because you are subscribed to the Google Groups "libxbee" group.
To unsubscribe from this group and stop receiving emails from it, send an email to libxbee+u...@googlegroups.com.
To post to this group, send an email to lib...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msg/libxbee/-/81VOWFYHgsAJ.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Matthieu Anceret

unread,
Mar 5, 2013, 11:45:53 AM3/5/13
to lib...@googlegroups.com, Matthieu Anceret
Thanks for your quickly response. 
I will try to implement this solutions. 

Matthieu. 

Matthieu Anceret

unread,
Mar 6, 2013, 10:41:31 AM3/6/13
to lib...@googlegroups.com, Matthieu Anceret
I try this solution but I think that I have an other problem : communication between the 2 XBee don't works. My Arduino send an API frame every second but with X-CTU, I don't receive any data...  

Attie Grande

unread,
Mar 6, 2013, 2:33:45 PM3/6/13
to Matthieu Anceret, libxbee
Hi Matthieu,

Have you confirmed that your API frame and also importantly the checksum are correct?
Try sending the raw bytes using the X-CTU facility instead of the Arduino (button labelled 'Assemble Packet' - http://goo.gl/KQCHC).
Please ensure that flow control is disabled at all points - in X-CTU, the Arduino and both XBee modules (by setting the following configuration options)
  • D6 = 0
  • D7 = 0
If you are using API mode 2, then please be sure that you are escaping the data correctly, and calculating the checksum correctly.
I would strongly recommend that you use API mode 1 instead as mode 2 is broken on some firmware versions, and there is little need for it anyway.

If you are still having issues, please take a series of screenshots to show the FULL configuration of BOTH of your modules, and identify which images are for which module (filename is fine).

Attie
To view this discussion on the web, visit https://groups.google.com/d/msg/libxbee/-/9OPfr6_c63EJ.

Matthieu Anceret

unread,
Mar 7, 2013, 3:07:01 AM3/7/13
to lib...@googlegroups.com, Matthieu Anceret
Hi, 

Even with flow control disabled, data are not transmit... It's really strange !
The only data that I receive on my coordinator is when I start my end-device (Arduino/Zigbee) : 

After this, I don't receive any other data...

You will find in attachments screenshots of my configuration for both modules. 

Do you want to see my code embedded on Arduino ? (for sending data)

Thanks you very much for your help ;) 

coordinator_1.PNG
coordinator_2.PNG
coordinator_3.PNG
enddevice_1.PNG
enddevice_2.PNG
enddevice_3.PNG
Reply all
Reply to author
Forward
0 new messages