XBEE intermittent functionality

XBee projects like the adapter, xBee tutorials, tweetawatt/wattcher, etc. from Adafruit

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
ericf3
 
Posts: 4
Joined: Thu Feb 14, 2013 6:14 pm

XBEE intermittent functionality

Post by ericf3 »

Hey there,

I'm pretty new to the whole tinker community so bear with me, please.

I have two arduino r3's with PIR motion sensors turning on an led when they detect something. They also both write to serial with is attached to my xbee series 2 chips. They are both setup as AT Routers with the destination high and low set to the coordinator and the pan address set to 0 which is what I have it as on the coordinator. The coordinator is plugged into a usb dongle that is monitored by xctu.


The setup seems to work intermittently. When i check the terminal in x-ctu i get messages every once in a while with a little junk attached to it.

EX:
[email protected] ended!
..~.
[email protected][email protected] detected!
.W~.
[email protected][email protected]".......
..~.
[email protected][email protected][email protected]!
./~.#[email protected] 1 Starting up!
[email protected]!
[email protected] Motion ended!
[email protected] 2 Motion ended!
..~.'[email protected] 2 Motion detected!
[email protected] 2 Motion ended!



Here is the code for the two arduinos:

Code: Select all

/* Basic XBEE Communication Test */

//Settings
int sigLED = 11;
int sigPIR = 2;
int pirStatus = 0;
int motionFlag = LOW;

void setup(){
  Serial.begin(9600);
  pinMode(sigLED, OUTPUT);
  pinMode(sigPIR, INPUT);
  Serial.println("Sensor 1 Starting up!");
}

void loop(){
  //Check PIR
  pirStatus = digitalRead(sigPIR);
  //Light LED and Signal, or don't
  if (pirStatus == HIGH){
    digitalWrite(sigLED, HIGH);
    if(motionFlag == LOW){
      Serial.println("Sensor 1 Motion detected!");
      motionFlag = HIGH;
    } 
  }
  else{
    digitalWrite(sigLED, LOW);
    if(motionFlag == HIGH){
      Serial.println("Sensor 1 Motion ended!");
      motionFlag = LOW; 
    }
  }
}

the code is the same on both except for the messages say sensor 1 and sensor 2.


The messages are really rather infrequent.


Anyways, if someone has any inclination as to what might be the problem i'd really appreciate some advice. If you need more information, please let me know and i'll add it. There are a ton of settings I don't touch in x-ctu, but what i did change are as follows:

Coordinator:
Updated and set to api coordinator
pan id = 0

Router 1:
updated and set to at router
set pan id to 0
set DH to 0013A200
set DL to 408B2D78

Router 2:
Router 1:
updated and set to at router
set pan id to 0
set DH to 0013A200
set DL to 408B2D78

ericf3
 
Posts: 4
Joined: Thu Feb 14, 2013 6:14 pm

Re: XBEE intermittent functionality

Post by ericf3 »

I still haven't been able to figure out the problem. It seems to me, since there is that limited display of messages in the terminal, that is must be working on some level, but I don't know why most of the messages don't arrive. Nor do I understand why there is junk in them.

ericf3
 
Posts: 4
Joined: Thu Feb 14, 2013 6:14 pm

Re: XBEE intermittent functionality

Post by ericf3 »

Another update. I tried using the raspberry pi to receive the messages (python-xbee) and i get the same behavior. Here is some example output:

{'status': '\x01', 'id': 'status'}
{'status': '\x06', 'id': 'status'}
{'source_addr_long': '\x00\x13\xa2\x00@\xa2\x0br', 'rf_data': 'Sensor 2 Motion detected!\r\n', 'source_addr': '(Y', 'id': 'rx', 'options': 'A'}
{'source_addr_long': '\x00\x13\xa2\x00@\xa2\x0br', 'rf_data': 'Sensor 2 Motion ended!\r\n', 'source_addr': '(Y', 'id': 'rx', 'options': 'A'}
{'source_addr_long': '\x00\x13\xa2\x00@\xa2\x0br', 'rf_data': 'Sensor 2 Motion detected!\r\n', 'source_addr': '(Y', 'id': 'rx', 'options': 'A'}
{'source_addr_long': '\x00\x13\xa2\x00@\xa2\x0br', 'rf_data': 'etected!\r\n', 'source_addr': '(Y', 'id': 'rx', 'options': 'A'}

User avatar
adafruit_support_bill
 
Posts: 88090
Joined: Sat Feb 07, 2009 10:11 am

Re: XBEE intermittent functionality

Post by adafruit_support_bill »

Have you posted this over at the Digi forums? They know these modules inside and out and might recognize the problem. http://forums.digi.com/

ericf3
 
Posts: 4
Joined: Thu Feb 14, 2013 6:14 pm

Re: XBEE intermittent functionality

Post by ericf3 »

Thanks for the suggestion. In case they solve it and some other poor soul comes across this, here is the link:

http://forums.digi.com/support/forum/vi ... ,yes#41152

Locked
Please be positive and constructive with your questions and comments.

Return to “XBee products (discontinued)”