Go Down

Topic: Configuring XBee without XCTU (Read 340 times) previous topic - next topic

ant1bball

Hello, I am quite new to arduino and I would like to configure my Xbee S1 (which is pluged into my arduino with a Bees Shield v2.12 from seedstudio) without having to use XCTU. More precisely I would like to put the power down to minimum level which is command ATPL 0 if I am not wrong. Could this be done automatically by programming it in the setup() function without going through XCTU? if so, how would i do it? how could I send the +++ to enter command and then configure the ATPL 0 and check its been done?

Thank you very much  :)

PaulS

Quote
I would like to configure my Xbee S1 (which is pluged into my arduino with a Bees Shield v2.12 from seedstudio) without having to use XCTU.

Why?

Quote
Could this be done automatically by programming it in the setup() function without going through XCTU?

Yes.

Quote
how could I send the +++ to enter command

Code: [Select]
Serial.print("+++");
Assuming that the XBee is on the serial port.

Quote
and then configure the ATPL 0

Code: [Select]
Serial.print("ATPL=0");

Quote
and check its been done?

In a while loop, while there has not been a complete response, see if there is serial data to read. If so, read it. A complete response generally ends with a carriage return and line feed.

ant1bball

I want to do this because I have to configure 3 arduinos and I think its faster to add a few lines of code to the setup than configuring each one individually with XCTU right?

I have a software serial library, which uses pins 8 and 9 to tx/rx. Therefore the default Serial i use to read and print info on the monitor serial screen while the SoftwareSerial mySerial i use to tx/rx data from the Xbee. If i'm not wrong there should also be a delay of 1 sec before and after the +++ correct¿? something like:
delay(1000);
mySerial.print("+++");
delay(1000);
mySerial.print("ATPL=0");
...
a while loop that waits for =="\r\n"

Thanks for your help :)

PaulS

Quote
I want to do this because I have to configure 3 arduinos and I think its faster to add a few lines of code to the setup than configuring each one individually with XCTU right?

You have to configure other things, too, right? Like MY, DL, etc.

You need to read the existing configuration, and then rewrite it, right?

You need to perform error checking on the parameter and value, right?

I think that using X-CTU will be easier. But, that might be just me.

Quote
If i'm not wrong there should also be a delay of 1 sec before and after the +++ correct¿?

If the XBee doesn't receive a command every second or less while in command mode it exits command mode. So, a one second delay after entering command mode hardly seems like a good idea. The delay before entering command mode is plain useless. It simply wastes a second.


Jack Christensen

XBees can also be configured by connecting them to a terminal program and issuing the required AT commands. Set the desired parameters, then issue the ATWR command to save them to non-volatile memory. Personally I prefer X-CTU but whatever floats your boat.
MCP79411/12 RTC ... "One Million Ohms" ATtiny kit ... available at http://www.tindie.com/stores/JChristensen/

Go Up