Greetings,
My main project is to develop a multi-hop wireless sensor network but as of now, I have been unable to send a single packet in API mode. For testing purposes, I implemented a simple chat between two S1 Digimesh Xbees and the test went fine.
Now I am trying to upload the following code to my Xbee.
#include <XBee.h>
uint8_t payload [] = {5, 7};
XBee xbee = XBee();
XBeeAddress64 addr64 = XBeeAddress64(0x0013a200, 0x40c345ac);
Tx64Request tx = Tx64Request(addr64, payload, sizeof(payload));
void setup()
{
xbee.begin(9600);
Serial.begin(9600);
}
void loop()
{
xbee.send(tx);
Serial.println();
delay(3000);
}
It is a simple enough code but it doesn't seem to work.
I am using an Arduino UNO R3 with an Sparkfun Xbee Shield to interface my Xbee and Arduino.
Also, I am using the XCTU console window on the receiving side to check my received packet but no packets are appearing except for AT Command and AT Response
Some key points to note:
-
After I have uploaded the code, the RSSI light does not blink at all which leads me to the idea that the problem is in the interfacing.
-
During loop(), weird characters appear on my Arduino Serial Monitor everytime the xbee.send() command is encountered.
-
I used the SoftwareSerial library in my chat program but now I am using the hardware serial interfacing, for the former setting my DLINE/UART switch was in DLINE position and the code I am uploading for sending packets is also being done in the same setting. This is because when I switch it to UART position the code doesnt upload at all and the status bar of ArduinoIDE is stuck at uploading.
Any help would be greatly appreciated. Much thanks ![]()