andrewrapp / xbee-arduino

Arduino library for communicating with XBee radios in API mode
GNU General Public License v2.0
334 stars 162 forks source link

Controlling remote D0 pin #42

Closed jetremote closed 7 years ago

jetremote commented 7 years ago

Hello,

This is my remote XBee SH and SL SH --> 0013A200 SL --> 40A292BD

API Mode 2

I use this api frame to controlling D0 pin from XCTU

D0 HIGH --> 7E 00 10 17 01 00 7D 33 A2 00 40 A2 92 BD FF FE 02 44 30 05 89 D0 LOW --> 7E 00 10 17 01 00 7D 33 A2 00 40 A2 92 BD FF FE 02 44 30 04 8A

Now, How can I made the same with xbee-arduino library ?

I have tried this:

  XBeeAddress64 addr64 = XBeeAddress64(0x0013A200, 0x40A292BD);
                        uint8_t payload[] = {0x44, 0x30, 0x05};
                        ZBTxRequest zbTx = ZBTxRequest(addr64, payload, sizeof(payload));
                        xbee.send(zbTx);

But not works to me.

Best regards

jetremote commented 7 years ago

Solved!

Works fine so:

               ```
 uint8_t d0Cmd[] = { 'D', '0' };
                    uint8_t d0Value[] = { 0x5 };
                    RemoteAtCommandRequest remoteAtRequest = RemoteAtCommandRequest(addr64, d0Cmd, d0Value, sizeof(d0Value));
                    xbee.send(remoteAtRequest);