Hello,
I am receiving incorrect API packet on remote XbeePro. Any help will be much appreciated!!!!!
PROJECT SETUP:
I have a Arduino Uno hosting a XbeePro module on top of a Geetech XbeeShield. For remote XbeePro, I have am using a Xbee USB Explorer.
I was able configure this setup successfully (AP=1, also tried AP=2) and then uploaded below sketch on Arduino. All is well and remote Xbee is receiving the following packet:
7E 00 1A 81 00 00 24 00 7D 5E 00 10 17 01 00 7D 5D 33 A2 00 40 54 BB D0 FF FE 02 44 34 04 98 30...which I know is not correct.
If I change AP=0, I receive the following packet
7E 00 10 17 01 00 7D 33 A2 00 40 54 BB D0 FF FE 02 44 34 04 98
PROJECT CODE:
#include <arduino.h>
#include <XBee.h>
#include <SoftwareSerial.h>
XBee xbee = XBee();
// Set DIO0 (pin 20) to Analog Input
uint8_t d0Cmd[] = { 'D', '4' };
uint8_t d0Value[] = { 0x5 };
uint8_t d0Valuelow[] = { 0x4 };
// SH + SL of your remote radio
XBeeAddress64 remoteAddress = XBeeAddress64(0x0013a200, 0x4054bbd0);
RemoteAtCommandRequest remoteAtRequest = RemoteAtCommandRequest(remoteAddress, d0Cmd, d0Value, sizeof(d0Value));
void setup() {
xbee.begin(9600);
delay(2000);
}
void loop() {
remoteAtRequest.setCommand(d0Cmd);
remoteAtRequest.setCommandValue(d0Value);
remoteAtRequest.setCommandValueLength(sizeof(d0Value));
sendRemoteAtCommand();
delay(5000);
// remoteAtRequest = RemoteAtCommandRequest(remoteAddress, d0Cmd, d0Valuelow, sizeof(d0Valuelow));
// remoteAtRequest.setCommand(d0Cmd);
// remoteAtRequest.setCommandValue(d0Valuelow);
// remoteAtRequest.setCommandValueLength(sizeof(d0Valuelow));
// sendRemoteAtCommand();
// delay(5000);
}
void sendRemoteAtCommand() {
xbee.send(remoteAtRequest);
}
Moderator edit:
</mark> <mark>[code]</mark> <mark>
</mark> <mark>[/code]</mark> <mark>
tags added.