SparkFun Forums 

Where electronics enthusiasts find answers.

All things pertaining to wireless and RF links
By stevech
jysgymg wrote:... this is an industrial scale project and not much of a hobby, which is the main reason that I pick xBee Series 2 instead of xBee Series 1 and I hope that using xBee Series 2 will be able to incorporate more complex programming from Arduino.
Does your project require use of the Zigbee stack? The Series 2 can run only Zigbee. Series 1 cannot run Zigbee (licensing issues).

Decide if your wireless network will be a star topology, fixed routing (hops), or self-forming mesh. The latter is very complicated and hard to make reliable.
On Series 1, Digimesh is much better than zigbee (as on Series 2), but requires all nodes to be Xbee.

I use IEEE 802.15.4 without a routing protocol stack since there are ways, similar to WiFi, for the hub of a star network to advertise its existance without device association. And run the MAC frames strictly per '15.4 with no proprietary content. With this, I can interoperate with any '15.4 compliant radio. Works well.

Use Zigbee only if some nodes must be Zigbee.

Zigbee is NOT a synonym for IEEE 802.15.4.
Zigbee is a network layer protocol, and '15.4 is like 802.3 (ethernet) or 802.11 (WiFi), though 802.11 is rarely used with other than IP.
By jysgymg
Thanks for the replies Valen and stevech. Althought I have started a new thread, I will also reply here and hopefully make it simpler for both of you?

To summarise my project, I am going to use XBees Series 2 to relay messages in a Carpark to find the location of a Car. Currently, I am only working on Zoning which is to only locate which Zone the Car is in.

So, technically I will need to use Self-Forming Mesh topology so that my routers can relay messages to one another. Although, I must say at my stage of my project I could use Star topology to do a simple presentation of the Carpark but I prefer to use Mesh so that if I pass down my project to my juniors, they can continue from there.

If however, getting the RSSI value is much easier in Star Topology than in Mesh (which I am certain it is the same), then I may change to Star.

My problem now is that I am unable to display the RSSI values. I hooked up a Router AT in a USB explorer to my laptop (for power) and a Coordinator API to a MEGA. I have pins 6 of XBee connected to pin 10 and literally follow all the steps in that tutorial video. I know there is RSSI as the LEDs are on but the RSSI printed is always 0 (shown in serial log) rather than a range of numbers indicating RSSI.

I am not sure if this is the result of the Arduino program codes or somewhere in x-CTU settings which incur the inability to show RSSI values.

Any help would be appreciated.
By jysgymg
Codes are below:


This is a sketch for RSSI-Measurements. The sketch reads the incoming RSSI Value and turns on a LED if the Signal is strong enough.
Please note that the used Value (40) depends on your project environement.

I am using an Arduino MEGA!
Connect your Xbee RX to Arduino RX!
Connect your Xbee TX to Arduino TX!
And don't forget the power supply!
RSSI Pin on Xbee -> 6

Author: Cédric Portmann (
Copyright (C) 2013 Cédric Portmann

int digitalPin = 10; // the RSSI pin 6 of Xbee is connected to this PWM Pin. (Digital Pin 10)
int rssiDur; // Variable for RSSI
int led = 13; // LED connected to Pin 13

void setup()
pinMode(led, OUTPUT);
pinMode(digitalPin, INPUT);

Serial.begin(9600); // this is the connection for your Arduino to your PC/MAC
Serial3.begin(9600); // this is the connection of your Xbee to your Arduino MEGA!!


void loop()

if(Serial3.available() >= 21) { // This isn't important. You can do here whatever you want.

if( == 0x7E) { // Reads the start byte
for(int i = 1; i < 50; i++) {
byte discardByte =;
rssiDur = pulseIn(digitalPin, LOW, 200); // get's the RSSI Value
Serial.println(rssiDur); //for debbuging and first setup.

if(rssiDur < 40 && rssiDur != 0){ //turns Led on if RSSI is less then 40
digitalWrite(led, HIGH);
Serial.println(Zone 1);
if(rssiDur > 40 && rssiDur != 0){ //turns Led off if RSSI is bigger then 40
digitalWrite(led, LOW);
Serial.println(Zone 2);

By Valen
This is certainly not easier. You have posted the code in a different thread than where you are stating your own problem and want to continue the discussion in. How is that going to help those that do not come in this thread. Just post a link to the new thread here and a reference to here in the new one.

I don't know what you have running on your Arduino's because this could not have compiled correctly.
Code: Select all
Serial.println(Zone 1);
That space should have caused compiler errors and prevented upload.

New thread:
long long title how many chars? lets see 123 ok more? yes 60

We have created lots of YouTube videos just so you can achieve [...]

Another post test yes yes yes or no, maybe ni? :-/

The best flat phpBB theme around. Period. Fine craftmanship and [...]

Do you need a super MOD? Well here it is. chew on this

All you need is right here. Content tag, SEO, listing, Pizza and spaghetti [...]

Lasagna on me this time ok? I got plenty of cash

this should be fantastic. but what about links,images, bbcodes etc etc? [...]