Go Down

Topic: RSSI Data dBm (Read 1 time) previous topic - next topic

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.

arduino2012

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

arduino2012


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

Go Up