Maker Pro
Maker Pro

Xbee s2 reading digital sensor data and sending the data remotely

Hello guys. I am stuck at getting my 2 Xbees to communicate to each other. I am doing exactly same excersise as this guy on youtube: https://www.youtube.com/watch?time_continue=726&v=jh-GIaghIjw .
I have connected my Xbees accordingly and I have run the program but my serial monitor is empty and im not getting any data. I have written some additional code to turn on Arduino LED 13 to confirm that the loop is working and the LED turned ON. Somehow my router does not send the data to coordinator. I have added some pictures .

There is one interesting thing:
Okay i realised another thing.
if (Serial.available() >21){
digitalWrite(led,HIGH); //turn on Uno LED

for (int i=0; i<22; i++) {
Serial.print(Serial.read(),HEX);
Serial.print(", ");
}
Serial.println();
}

If i write a code digitalwrite after the first if stetement, the LED will not turn OFF meaning that it never satisfies the condition.

Could someone give me some tips on how to properly troubleshoot and solve this issue! thank you
 
pictures
 

Attachments

  • Screen Shot 2018-10-22 at 14.27.06.png
    Screen Shot 2018-10-22 at 14.27.06.png
    267.9 KB · Views: 0
  • Screen Shot 2018-10-22 at 14.26.54.png
    Screen Shot 2018-10-22 at 14.26.54.png
    409.5 KB · Views: 0
  • Screen Shot 2018-10-22 at 14.26.24.png
    Screen Shot 2018-10-22 at 14.26.24.png
    378.9 KB · Views: 0
  • Screen Shot 2018-10-22 at 14.26.05.png
    Screen Shot 2018-10-22 at 14.26.05.png
    384.7 KB · Views: 0
Hello guys. I am stuck at getting my 2 Xbees to communicate to each other. I am doing exactly same excersise as this guy on youtube: https://www.youtube.com/watch?time_continue=726&v=jh-GIaghIjw .
I have connected my Xbees accordingly and I have run the program but my serial monitor is empty and im not getting any data. I have written some additional code to turn on Arduino LED 13 to confirm that the loop is working and the LED turned ON. Somehow my router does not send the data to coordinator. I have added some pictures .

There is one interesting thing:
if (Serial.available() >21){
digitalWrite(led,HIGH); //turn on Uno LED

for (int i=0; i<22; i++) {
Serial.print(Serial.read(),HEX);
Serial.print(", ");
}
Serial.println();
}

If i write a code digitalwrite after the first if stetement, the LED will not turn OFF meaning that it never satisfies the condition.

Could someone give me some tips on how to properly troubleshoot and solve this issue! thank you
 
Top