Reading RSSI of Xbee Series 2

Ah, I see. Good thing it is solved now.

donaldhwong:
Hi Steve,

Thank you for your input. I purchased S2, because the sample URL uses S2. This is my first venture into Xbee. You think I should return the S2 and change it with S1?

Does S1 also have a RSSI output pin? I looked and can not find it.

I have downloaded the Xbee library, but no need to use it yet. Can you give me one, regarding RSSI?

the PWM RSSI, when integrated and fed to an LED or volt meter, shows rough RSSI.

The RSSI in dBm is within API messages.

The XBee S1 is much better for hobby use as you are not stuck with the complexities of Zigbee which is a tangent to a dark hole.

Thank you Steve,

My RSSI test for Xbee ranges 61 to 103 with 86 average at 3 feet. 79 to 296 with average of 112 at 5 feet.

While RFM69W RSSI is much more stable. 34 to 28 with 31 average at 3 feet. 50 to 41 with average 46 at 5 feet.

Though, I don’t know whether 433 MHz is less susceptable to interference than 2.4 GHz or not. If you have any experience, please share with me.

For my project, I decided to use RFM69W at the present time.

I must thank Valen and Steve for your guidance and support. I have learned at lot.

For someone missing the fun of digital electronics for over 30 years. It is most enjoyable.

Donald

donaldhwong:
Thank you Steve,

My RSSI test for Xbee ranges 61 to 103 with 86 average at 3 feet. 79 to 296 with average of 112 at 5 feet.

While RFM69W RSSI is much more stable. 34 to 28 with 31 average at 3 feet. 50 to 41 with average 46 at 5 feet.

Though, I don’t know whether 433 MHz is less susceptable to interference than 2.4 GHz or not. If you have any experience, please share with me.

Donald

That sounds like multi-pathing is the cause of the variable RSSI readings.

Read up on this to understand why the reads vary. I’ll also bet that even at fixed distances if you move the RSSI readings will change.

Hi, to whoever is till following this thread. I am having some trouble reading the RSSI values. I followed the profiles and codes but somehow my serial console only print out “Serial 1 not available”.

Is there anyone here that can guide me? Any help would be appreciated!!

Thanks in advance!

Please start your own thread where you state your own problem in detail. Hijacking another’s thread will only cause confusion because of mixed up information. Please provide your own information there. That means the code you used, schematic of how you have it connected. Modelnumbers of the parts in it. Uploaded settings files. And photo’s of the breadboard or pcb if soldered to look for obvious wiring faults.

Since there is no mention of the text “Serial 1 not available” in the code of the very first link posted in this thread (the letsmakerobots.com site) I have no idea what could cause that or what you did. If you used some specific code then please direct us to it.

Sorry Valen, I am quite new to this forum. Basically, I followed donaldhwong’s code and xCTU profiles that he uploaded. But yes, you are right, I will start my own thread.

Thanks!

J.Y.

P.S. Some forums require the users to write a certain number of posts before opening a thread. >.<

XBee Series 1 is much simpler to deal with, presuming you don’t want/need Zigbee mesh routing.

Series 1 has the same sort of RSSI output pin: It’s PWM. Some people wire this to LED(s) to have intensity = RSSI visually, or…

As you’ve found, the XBee Binary API can be used to get the RSSI of the last-received packet.

XBees uses IEEE 802.15.4 for the protocol and transmission modes. In the 2.4GHz Xbee S1, a good RSSI is -80dBm. At 1m range you’ll see about -30dBm. At -90dBm and less, the frame error rate increases. IEEE 802.15.4 has an option (normally you enable it using XCTU) to use ACKs for every frame, and automatic retransmissions.

Hi Stevech, thanks for your reply. I will post a new thread about my problem with more details and hopefully you and Valen could guide me through over there. Just a quick summary, since 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.

The Series 2 models do not leverage the amount of programming you can do with the Arduino. (It doesn’t make the Arduino smarter or more capable) In fact the mesh routing requires more complex code to keep track of where packets are going and if they arrive. Also the notion that series 1 or 802.15.4 models are mere hobby-stuff as opposed to professional products is a false one. They have different features that should match your project requirements.

jysgymg:
… 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.

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.

Thanks!

Codes are below:

/*

XbeeRSSI.pde

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.

ATTENTION!!!


YOU HAVE TO USE AN ARDUINO WITH AT LEAST TWO SERIAL PORTS!

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 (cedric.portmann@gmail.com.)

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(Serial3.read() == 0x7E) { // Reads the start byte

for(int i = 1; i < 50; i++) {

byte discardByte = Serial3.read();

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);

}

}

delay(1000);

Serial.println();

}

}

}

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.

Serial.println(Zone 1);

That space should have caused compiler errors and prevented upload.

New thread: https://forum.sparkfun.com/viewtopic.php?f=13&t=42941