Go Down

Topic: RSSI Data dBm (Read 2045 times) previous topic - next topic

I have a XBee module and want to read the signal strength in dBm.
I have used the AT command 'ATDB' and it gives me the RSSI value.
But I don't know how to write code in arduino for it. Could you help.

dxw00d

Google says http://log.liminastudio.com/itp/physical-computing/measuring-xbee-signal-strength-from-the-rssi-pin
First link on first page of search results.

Does anybody know how to convert AT commands to C code?

I want to use the ATDB command and get the return value and save it in a variable.

PaulS

Quote
Does anybody know how to convert AT commands to C code?

Yes.

Quote
I want to use the ATDB command and get the return value and save it in a variable.

Permission granted.


Quote
Does anybody know how to convert AT commands to C code?

Yes.

Quote
I want to use the ATDB command and get the return value and save it in a variable.

Permission granted.

could you help me

PaulS

How do you send an AT command to the XBee now? You type some text into an application that sends the text to the XBee via the serial port. So:
Code: [Select]
Serial.print("ATDB");

Then, the application shows any serial data that came back:
Code: [Select]
while(Serial.available() > 0)
{
   char inChar = Serial.read();
   // Do something with inChar
}


If the Arduino is using a software serial port to talk to the XBee, replace Serial with the SoftwareSerial instance name.

AWOL

These seemed related, so I merged them.
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

#7
Apr 19, 2012, 09:23 pm Last Edit: Apr 19, 2012, 09:29 pm by arduino2012 Reason: 1
The code above worked only when i write +++ and it answers OK.
But when I use other AT commands like ATID or ATDB it doesnt answer anything. You can see my code below to see what I have done.

Sending AT Commands Code
Quote
import processing.serial.*;
Serial myPort;  // The serial port

void setup() {
 println(Serial.list());
 myPort = new Serial(this, Serial.list()[0], 9600);
 myPort.write("+++");
 delay(1000);
 
}

void draw() {
 while (myPort.available() > 0){
   int inByte = myPort.read();
   println(inByte);
   myPort.write("ATID");
   delay(1000);
 }
}


Receiver Code
Quote
while(Serial.available() > 0)
{
  char inChar = Serial.read();
  Serial.write(inChar);
}

PaulS

You know that you have to put the XBee in command mode, first, right? Then, when you get the OK, you can send it other AT commands.


You know that you have to put the XBee in command mode, first, right? Then, when you get the OK, you can send it other AT commands.

I send +++ and get OK but after that I can't send anything else.
Am I not getting the XBee in AT Command mode when I write +++?

PaulS

Quote
Am I not getting the XBee in AT Command mode when I write +++?

Yes, but if commands don't arrive in a timely fashion, it exits command mode. As I recall, "timely fashion" means less than a second between commands. Your 1 second delay shoots that opportunity all to hell.

Go Up