Shop OBEX P1 Docs P2 Docs Learn Events
How to resume lost communication between 2 XBees — Parallax Forums

How to resume lost communication between 2 XBees

JChrisJChris Posts: 58
edited 2014-12-15 08:52 in Propeller 1
I would like to know how to resume lost communication between 2 XBees. I use 2 XBees Pro S1 and 2 propeller C3.

When I move one XBee away from the other one, the communication stops. I want the communication to resume when I bring the remote XBee back to its original location (i.e. both xBees close to each other).
In my project I have a constraint that is to use API_Rx. When the communication stops because of the distance the Xbees get stalled. In my program, the XBees stop in the loop that receive data (API_Rx function). Should I use the reset function to relaunch the XBees or are there other approachs to resume communication between XBees?


If anyone has a hint I would appreciate

Comments

  • ElectrodudeElectrodude Posts: 1,658
    edited 2014-12-11 18:18
    The API_RxCheck function in my 4 port version of the xbee library that I mentioned in your other thread should fix your problem. It checks for anything in the receive buffer, and if there isn't anything, it immediately returns instead of waiting forever. If you don't want to use my library (but you should - you're basically reimplementing it yourself), simply copying the function from my library into your copy of the library should work.
  • JChrisJChris Posts: 58
    edited 2014-12-15 08:41
    Thank you for your help :) My program works fine with your library.
  • ElectrodudeElectrodude Posts: 1,658
    edited 2014-12-15 08:52
    You're welcome! I didn't test all of the functions (only the ones I actually needed), so tell me if you have any more problems.
Sign In or Register to comment.