Tell me more ×
Electrical Engineering Stack Exchange is a question and answer site for electronics and electrical engineering professionals, students, and enthusiasts. It's 100% free, no registration required.

I am trying to set the SM (sleep mode) register on the XBee radio. These registers can be set with so called AT Commands, listed from pg. 28 in the XBee/XBee Pro Product Manual.

This can be done using the X-CTU desktop application, either by typing the AT commands in the built-in terminal or by editing the values in a list and then click "Write".

But is it possible to modify these registers on the fly from a sketch running on the Fio?

share|improve this question

2 Answers

First of All, I never ever used Arduino in my Life but I have worked on XBee.

Yes, You can configure XBee module on the fly. XBee accepts AT Commands. So the Same commands you send from X-CTU are valid if you connect XBee to Microcontroller Serial Port which is configured properly (In Most cases, 9600 baud 8-N-1) and Write over it.

Put your command in an Array [AT] and write that array to Serial port. You are done!

Note: All AT Commands are in ASCII and don't forget to add Carriage return at the end (0x0D)

share|improve this answer
The only way I know of sending anything to the radio is Serial.println() or Serial.print(). But all the XBee does is send those commands into the ether. I can hardly believe that it reads the characters passing through and if some of that looks like a command, then it executes that command instead. Please tell me if I misunderstood? Btw: I can't even test the commands with X-CTU because of another problem, described here. – Lucy Brennan Jun 7 '12 at 15:47

Yes you can modify this on the fly. Make sure you are sending the necessary characters first with the required timing. The default is +++

After Xbee replies "OK" you can send your AT commands. As Swanand said don't forget the 0x0D at the end

share|improve this answer
This is all you need, send Serial.print("+++") to enable AT mode, wait for OK from the Xbee, and you can send the AT commands. To disable the AT mode, you can either wait a few seconds or send Serial.print("ATCN\r"). Never forget to send Carriage Return at the end of the AT commands, the only one that doesn't need CR is the +++ command – Jamiro14 Jun 22 '12 at 9:45

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.