# Set remote output high via usart

**URL:** https://forums.digi.com/t/set-remote-output-high-via-usart/1680
**Category:** XBee - 802.15.4
**Created:** [May 4, 2011, 7:53pm UTC](https://forums.digi.com/t/set-remote-output-high-via-usart/1680 "2011-05-04T19:53:30Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![manuperetti](https://avatars.discourse-cdn.com/v4/letter/m/848f3c/32.png) [@manuperetti](https://forums.digi.com/u/manuperetti)
#### Post date: [May 4, 2011, 7:53pm UTC](https://forums.digi.com/t/set-remote-output-high-via-usart/1680/1 "2011-05-04T19:53:30Z")

</div>

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.

Manuel

---

<div class="post-metadata">

### Author: ![johnf](https://avatars.discourse-cdn.com/v4/letter/j/848f3c/32.png) [@johnf](https://forums.digi.com/u/johnf)
#### Post date: [May 4, 2011, 9:21pm UTC](https://forums.digi.com/t/set-remote-output-high-via-usart/1680/2 "2011-05-04T21:21:40Z")

</div>

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

---

<div class="post-metadata">

### Author: ![manuperetti](https://avatars.discourse-cdn.com/v4/letter/m/848f3c/32.png) [@manuperetti](https://forums.digi.com/u/manuperetti)
#### Post date: [May 5, 2011, 7:33pm UTC](https://forums.digi.com/t/set-remote-output-high-via-usart/1680/3 "2011-05-05T19:33:08Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![manuperetti](https://avatars.discourse-cdn.com/v4/letter/m/848f3c/32.png) [@manuperetti](https://forums.digi.com/u/manuperetti)
#### Post date: [May 6, 2011, 7:37pm UTC](https://forums.digi.com/t/set-remote-output-high-via-usart/1680/4 "2011-05-06T19:37:33Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![johnf](https://avatars.discourse-cdn.com/v4/letter/j/848f3c/32.png) [@johnf](https://forums.digi.com/u/johnf)
#### Post date: [May 8, 2011, 5:46pm UTC](https://forums.digi.com/t/set-remote-output-high-via-usart/1680/5 "2011-05-08T17:46:13Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![manuperetti](https://avatars.discourse-cdn.com/v4/letter/m/848f3c/32.png) [@manuperetti](https://forums.digi.com/u/manuperetti)
#### Post date: [May 10, 2011, 1:37am UTC](https://forums.digi.com/t/set-remote-output-high-via-usart/1680/6 "2011-05-10T01:37:45Z")

</div>

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

---

<div class="post-metadata">

### Author: ![johnf](https://avatars.discourse-cdn.com/v4/letter/j/848f3c/32.png) [@johnf](https://forums.digi.com/u/johnf)
#### Post date: [May 10, 2011, 9:30am UTC](https://forums.digi.com/t/set-remote-output-high-via-usart/1680/7 "2011-05-10T09:30:45Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![manuperetti](https://avatars.discourse-cdn.com/v4/letter/m/848f3c/32.png) [@manuperetti](https://forums.digi.com/u/manuperetti)
#### Post date: [May 10, 2011, 4:27pm UTC](https://forums.digi.com/t/set-remote-output-high-via-usart/1680/8 "2011-05-10T16:27:59Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![johnf](https://avatars.discourse-cdn.com/v4/letter/j/848f3c/32.png) [@johnf](https://forums.digi.com/u/johnf)
#### Post date: [May 10, 2011, 6:07pm UTC](https://forums.digi.com/t/set-remote-output-high-via-usart/1680/9 "2011-05-10T18:07:25Z")

</div>

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.
