Pages: [1]   Go Down
Author Topic: RSSI Data dBm  (Read 1458 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 21
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Gosport, UK
Offline Offline
Faraday Member
**
Karma: 19
Posts: 3114
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 21
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 548
Posts: 46042
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 21
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 548
Posts: 46042
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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:
Serial.print("ATDB");

Then, the application shows any serial data that came back:
Code:
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.
Logged

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 238
Posts: 24322
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

These seemed related, so I merged them.
Logged

"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.

Offline Offline
Newbie
*
Karma: 0
Posts: 21
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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);
}
« Last Edit: April 19, 2012, 02:29:43 pm by arduino2012 » Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 548
Posts: 46042
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 21
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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 +++?
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 548
Posts: 46042
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Pages: [1]   Go Up
Jump to: