# Help with API for Dio

**URL:** <https://forums.digi.com/t/help-with-api-for-dio/1099>\
**Category:** XBee - DigiMesh\
**Created:** [September 12, 2010, 4:36am UTC](https://forums.digi.com/t/help-with-api-for-dio/1099 "2010-09-12T04:36:54Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![hippled](https://avatars.discourse-cdn.com/v4/letter/h/5e9695/32.png) [@hippled](https://forums.digi.com/u/hippled)\
**Post date:** [September 12, 2010, 4:36am UTC](https://forums.digi.com/t/help-with-api-for-dio/1099/1 "2010-09-12T04:36:54Z")

</div>

I am a beginner to Xbee api. I am trying to set DIO 4 to 5(high)  
I have the api mode set to 1

here is the packet I made:  
7e 00 11 17 01 00 13 a2 00 40 30 81 c5 ff fe 02 64 34 30 35 80

7e Start Delimiter  
00 11 Length  
17 Frame Type  
01 Frame ID  
00 13 a2 00 40 30 81 c5 Address of remote xbee  
ff fe Reserved  
02 Remote Command Options  
64 34 “d4 at command”  
30 35 “05 set command d04 to 05 for high”  
80 Checksum

This is what is returned  
7E 00 33 AB 00 00 33 AB 00 40 30 81 C5 FF FE 64 34 03 64  
But I can not make sense of it.

am I doing something wrong? If I am please point me in the right direction. I have read the manual over and over but I am not to sure if I am doing it right.

Thanks for your help.  
Dave

---

<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:** [September 12, 2010, 6:26pm UTC](https://forums.digi.com/t/help-with-api-for-dio/1099/2 "2010-09-12T18:26:30Z")

</div>

There seem to be two things wrong here.

The first is in your original packet: you’ve encoded the parameter value as a pair of ASCII digits where it should be a straight byte value. Try this packet instead:  
7E 00 10 17 01 00 13 A2 00 40 30 81 C5 FF FE 02 64 34 05 E0

The second thing is that the response packet is garbage (packet type AB doesn’t exist) and that shouldn’t happen. It looks as though the incorrect packet has triggered the firmware to return something it shouldn’t. If you get the first packet right the problem should go away.

The second problem might be a case of not running the latest firmware. What version are you running?

---

<div class="post-metadata">

**Author:** ![hippled](https://avatars.discourse-cdn.com/v4/letter/h/5e9695/32.png) [@hippled](https://forums.digi.com/u/hippled)\
**Post date:** [September 12, 2010, 7:36pm UTC](https://forums.digi.com/t/help-with-api-for-dio/1099/3 "2010-09-12T19:36:47Z")

</div>

Thank you very much, I must have understood the manual wrong. I will try your advice soon. Also both modules are running 804B I think that is the latest?

Thanks again

---

<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:** [September 12, 2010, 9:07pm UTC](https://forums.digi.com/t/help-with-api-for-dio/1099/4 "2010-09-12T21:07:56Z")

</div>

Yes, I think that’s the latest. Looks a bit like a firmware problem, but as long as a correct packet doesn’t trigger it things should be all right.

---

<div class="post-metadata">

**Author:** ![hippled](https://avatars.discourse-cdn.com/v4/letter/h/5e9695/32.png) [@hippled](https://forums.digi.com/u/hippled)\
**Post date:** [September 12, 2010, 9:57pm UTC](https://forums.digi.com/t/help-with-api-for-dio/1099/5 "2010-09-12T21:57:41Z")

</div>

Yes, that new packet worked. Thank you very much.
