# Reading xBee with Arduino Wireless Proto Shield

**URL:** <https://forums.digi.com/t/reading-xbee-with-arduino-wireless-proto-shield/17578>\
**Category:** XBee Programamble (S2C & 900 HP)\
**Tags:** xbee-pro-s2c\
**Created:** [October 21, 2016, 11:33am UTC](https://forums.digi.com/t/reading-xbee-with-arduino-wireless-proto-shield/17578 "2016-10-21T11:33:03Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![mustafagokce09](https://avatars.discourse-cdn.com/v4/letter/m/ea5d25/32.png) [@mustafagokce09](https://forums.digi.com/u/mustafagokce09)\
**Post date:** [October 21, 2016, 11:33am UTC](https://forums.digi.com/t/reading-xbee-with-arduino-wireless-proto-shield/17578/1 "2016-10-21T11:33:03Z")

</div>

Hi.  
I’m trying to read RSSI of received signal from xBee.  
I wrote this code for Arduino:

#include ;  
SoftwareSerial mySerial(10, 11); // RX, TX

int rssi;

void serialFlush()  
{  
while(mySerial.available() \> 0)  
char t = mySerial.read();  
}

void setup()  
{  
Serial.begin(9600);  
mySerial.begin(9600);  
}

void loop()  
{  
rssi=0;  
if(mySerial.available())  
{  
serialFlush();  
mySerial.print(“+++”);  
while(!mySerial.available());  
serialFlush();  
mySerial.println(“ATDB”);

```
while(mySerial.available())
{
  rssi = mySerial.read();
  Serial.print(rssi);
  Serial.print(" ");
}
Serial.println("");

mySerial.print("ATCN");

```

}  
delay(1000);  
}

And i see these output from serial monitor:

26 57 13  
13 156 195  
26 156 13  
26 78 195  
26 57 13  
26 57 13  
26 80 195  
26 156 13  
26 57 13  
26 50 68 13  
26 50 67 13  
26 153 81 195  
26 50 65 13  
26 50 56 13  
26 50 56 13  
26 50 57 13  
26 51 48 13  
26 49 57 13  
26 76  
26 49 65 13

Which is absolute non-sense. It should return only one byte (usually negative integer)  
On other xbee i’m just posting “hi” messege to the air and also i’m changing the module’s position but i could not find any sequance (during the experiment, the distance is always increased.).  
and als ATCN command is not working. I need to wait about 3-5 (no sure) seconds to receive another message.  
can anyone help me?

---

<div class="post-metadata">

**Author:** ![mvut](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.digi.com/mvut/32/31_2.png) [@mvut](https://forums.digi.com/u/mvut)\
**Post date:** [October 21, 2016, 1:49pm UTC](https://forums.digi.com/t/reading-xbee-with-arduino-wireless-proto-shield/17578/2 "2016-10-21T13:49:42Z")

</div>

What XBee modules are you working with?

Are you in transparent mode or API mode on them?

What firmware version is running on your XBee modules?

---

<div class="post-metadata">

**Author:** ![mustafagokce09](https://avatars.discourse-cdn.com/v4/letter/m/ea5d25/32.png) [@mustafagokce09](https://forums.digi.com/u/mustafagokce09)\
**Post date:** [October 21, 2016, 1:59pm UTC](https://forums.digi.com/t/reading-xbee-with-arduino-wireless-proto-shield/17578/3 "2016-10-21T13:59:30Z")

</div>

Hi.  
Thanks for quick answer.  
My modules are: XBee Pro Series 2C XBP24-CZ7WIT-004.  
Coordinator and end device has the latest firmware of ZigBee (4059) and both of them on transparent mode (not API). Coordinator module sends “hi” and end device responds with measuring its rssi via the code.  
Waiting for your help.  
Regards…

---

<div class="post-metadata">

**Author:** ![mvut](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.digi.com/mvut/32/31_2.png) [@mvut](https://forums.digi.com/u/mvut)\
**Post date:** [October 21, 2016, 2:15pm UTC](https://forums.digi.com/t/reading-xbee-with-arduino-wireless-proto-shield/17578/4 "2016-10-21T14:15:27Z")

</div>

Do yourself a favor, if this is a simple point to point network, change your firmware over on both module to the 802.15.4 versions. Then if you wanted, you could simply put the receiving module into API mode and get the RSSI level directly with the receive frame.

---

<div class="post-metadata">

**Author:** ![mustafagokce09](https://avatars.discourse-cdn.com/v4/letter/m/ea5d25/32.png) [@mustafagokce09](https://forums.digi.com/u/mustafagokce09)\
**Post date:** [October 21, 2016, 2:24pm UTC](https://forums.digi.com/t/reading-xbee-with-arduino-wireless-proto-shield/17578/5 "2016-10-21T14:24:48Z")

</div>

Hello again sir.  
Thanks for suggestion but i need to create a network that has one coordinator and many end devices.  
So there will be a changing message like “hi1” and first end device will listen and get rssi. second message will be “hi2” and second end device will listen and get the rssi and so on.  
Thanks again.  
If you have a solution, please share with me.  
Best regards…

---

<div class="post-metadata">

**Author:** ![mvut](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.digi.com/mvut/32/31_2.png) [@mvut](https://forums.digi.com/u/mvut)\
**Post date:** [October 21, 2016, 2:27pm UTC](https://forums.digi.com/t/reading-xbee-with-arduino-wireless-proto-shield/17578/6 "2016-10-21T14:27:02Z")

</div>

The 802.15.4 protocol and firmware I am referring to is a Peer to peer, point to point, point to multi-point protocol which the Zigbee mesh protocol runs on top of.

So you can do a Point to multi-point with 1 coordinator (802.15.4) and many end devices just as I described above.

---

<div class="post-metadata">

**Author:** ![mustafagokce09](https://avatars.discourse-cdn.com/v4/letter/m/ea5d25/32.png) [@mustafagokce09](https://forums.digi.com/u/mustafagokce09)\
**Post date:** [October 21, 2016, 2:31pm UTC](https://forums.digi.com/t/reading-xbee-with-arduino-wireless-proto-shield/17578/7 "2016-10-21T14:31:52Z")

</div>

thank you sir.  
i will try your solution and come back with results.  
have a great day.
