XBee problems
Rsadeika
Posts: 3,837
in Propeller 1
Not sure how to resolve this issue with using multiple XBee Pro modules.
Below is a sample program that I am using on two different Activity boards. I also have a special terminal program on my PC which uses the third XBee module. When I have just one Activity Board turned on, then the program works as expected. When I have both Activity boards turned on, then I have some problems like there is a blue LED by XBee socket on the boards that start to flash, along with the red LED next to it. The one board is #1 and the other board is #2. Not sure why this is occurring with the XBee boards, when I send it a command from the XBee on the PC using my special terminal program, that is addressing only one of the boards.
Thanks
Ray
Below is a sample program that I am using on two different Activity boards. I also have a special terminal program on my PC which uses the third XBee module. When I have just one Activity Board turned on, then the program works as expected. When I have both Activity boards turned on, then I have some problems like there is a blue LED by XBee socket on the boards that start to flash, along with the red LED next to it. The one board is #1 and the other board is #2. Not sure why this is occurring with the XBee boards, when I send it a command from the XBee on the PC using my special terminal program, that is addressing only one of the boards.
Thanks
Ray
/* testxbee.c January 19, 2017 */ #include "simpletools.h" #include "simpletext.h" #include "fdserial.h" serial *xbee; int main() { // Add startup code here. /* Rx Tx BAUD */ xbee = fdserial_open(11, 10, 0, 9600); char inIDno[5]; char inDec[5]; char inBuff[40]; long inSec = 0; while(1) { // Add main loop code here. readStr(xbee,inIDno,5); if(!strcmp(inIDno,"#2")) { readStr(xbee,inBuff,40); if(!strcmp(inBuff,"0001")) high(26); else if(!strcmp(inBuff,"0002")) low(26); }//if loop }//while(1) loop }//main
Comments
I'm working on the a laser tag project that makes extensive use of XBees. We're using API1 coms so that the Propeller doesn't have to filter every message (the target address is in the message).
Most packets use a simple packet that is formatted like this: Referee commands go to every XBee. When one tagger is hit by another, it can send feedback using a similar packet -- this is the code that does that. Depending on your project, using API1 (or 2) messages may be cleaner.
Ray
Just so you understand, XBees always use API mode -- it's just hidden from you when you select non-API. I prefer API mode so that I can craft messages as I choose, including those that go point-to-point.
My object (which I cannot share because it does include customer code) is Spin as a wrapper over FDS. I have posted the source for other generic routines in my wrapper, and you shouldn't have any trouble porting them to C.
And... there's lots C code for XBees written by Arduino users -- that should be even easier to fold into your project.
When I get a workable solution I will post the PropGCC program here, I am not confined by proprietary code.
Ray
Anybody have any idea as to what you get that is better than what I have right now, in the new module? What does the new module have to offer that the legacy module does not have, besides up to date docs and info? I will have to look at the Parallax store and see if they have some kind of user information besides just a product info page.
Ray
Have you seen this?
https://www.parallax.com/news/2016-09-16/upcoming-changes-xbee-product-line
Point number two looks kind of interesting, I wonder if that means that the modules have a default address? That would make life easier, that way you would not have to use XCTU program to accomplish this. Hopefully they are staying away from the paring stuff. Since the price is the same, maybe I will have to upgrade.
Ray
I find this to be a comprehensive Document. I also see information relating to Xbee on the Learn.Parallax.com site regarding programing the xBee in "C"
Jim
http://learn.parallax.com/tutorials/projects/xbee-802154-pc-demo
https://www.parallax.com/product/32407
There are links to lots of useful documentation on the Digikey page.
http://www.digikey.com/product-detail/en/digi-international/XBP24-AWI-001/XBP24-AWI-001-ND