Set remote output high via usart

Hi All:

I need to controll (set at a high or low state) one of the outputs of one Xbee module by sending an API frame from a remote modue, is that possible? How can I do such thing?
I’ve read the documents but I can’t find anything about this.
Thanks in advance.


Yes, certainly it’s possible. You need the remote AT command packet, which basically wraps a standard AT command inside an API packet. If you look up the remote AT command packet in the product manual you’ll find the details.

You might also want to look at the cookbook and the packet-check program (see pinned posts).

Ok I think I get it, you mean setting one of the IO pins as digital output using AT commands sent by a remote module.
I’ll give it a try, thank you.

Hi John,

I was able to set D2 as an output and change its state using the At command ATIO, but the module sends back that state in an API frame over and over again.
Is there a way to avoid this? I mean, if I set the state of an output I don’t need the module to tell me the whole time something that I already know.

Sounds like a module setting problem. Can you use X-CTU to save a .PRO file with the settings, and then post the file as an attachment (or in-line if you prefer). Then we can take a look at it to see what’s going on.

Here is the settings file, I can’t find anything wrong with it.
There is something else, I am using D1 as an ADC and wait for it to take 40 samples before sending the API frame

Ok, I think I see what’s happening. In the settings, you have IR=0x0a so you’re telling the XBee to sample all enabled inputs every 10mS. Then you have IT=0x28 so you’re telling it to buffer 40 samples before sending a line state packet. So every 400mS you’d expect to receive a packet telling you the 40 sample values from D1, which is the only line you have set to be an input.

It isn’t D2 that’s triggering the packets - it’s D1, coupled with the IR and IT settings. If you want further confirmation, post one of the packets you’re receiving and we’ll have a look at it.

That’s right, D1 is set to send the API frame with the 40 samples every 400ms. The thing is that D2 is also sending its state in the same frame and I find that useless and anoying.
These frames are sent to a coordinator module that is connected to a PC in which there is a software running that analyzes the frames and stores the ADC values in a buffer and plot them later. When I set D2 as an output the new frame is no longer compatible with my software.
If there is no way to avoid the module bulding this new frame then I will modify my software, but logic dictates that there should be some way to just set D2 as an output and change its state when I want it, not getting any feedback from it.
I hope I made myself clear. Thanks for your answers.

My understanding is that if no lines are set as digital inputs, there should be no reporting of digital status in the packet.

So if you set D2 as an input, it’ll report its status in the frame. Otherwise it shouldn’t.

You’ll need to post the packets if you want to take this further. One with D2 as output, and another with it set as an input.