I am using two Digi International XBee Series 2 modules (Zigbee), an Arduino Uno, and a HC-SR04 Ultrasonic sensor to send distance readings from the coordinator XBee on the Arduino (connected via SparkFun XBee Explorer Regulated) to the XBee connected to my computer on a SparkFun Explorer USB. I already have the latest FTDI drivers and X-CTU software running on my laptop and I configured the ArduinoXBee as "Zigbee coordinator AT" and the ComputerXBee as "Zigbee end device AT" with the following networking settings:
Coordinator:
PanID: 1234
DH: 0
DL: FFFF
End Device:
PanID: 1234
DH: 0
DL: 0 (so it can only talk to the coordinator)
The problem I am facing is that when I open the End Device terminal, the distance readings I get are accurate yet very unstable. Like it receives the correct readings but the transmission is unsynchronized as it sometimes receives 5 numbers in one transmission and lags for 10 seconds then receives the next bunch and lags for another 10 seconds and so on...
The XBee Explorer Regulated is powered by 5V from the Arduno and the code I used to print distance data is a very simple serial communication:
I want to receive the distance data through the XBees in the same manner as receiving it with a USB cable through the Serial Monitor with only 500 milliseconds delay between the two readings but I am not able to achieve that.
code works via wire perfectly, but when you put the xbees in place they work for about 3-4 seconds and stop responding or hang. below is a quick overview of the xbee config.
i am running: 2 arduino nano's
2 series 1 xbee's
pan 1111
cord 3333 my -> 2222
end d 2222 my -> 3333 (used 16 bit address for ping test and range test for xctu)
baud 9600
ive sent just commands for the relay and the led and it works perfectly, but when the joysticks readings change it "chokes" on the input. sometimes the led and or relay will work again and continue to work.
any help on this would be great. still learning how these devices function. thanks in advance!
Mine is also a XBee PRO Series 2 (ZigBee) and in the range test it starts fine but after a few seconds, minutes, or hours, corrupt data happen and gets hung for seconds and randomly communication restores and again problems are back. It is a unstable and non trustable modules to until i get the solution to this problem. AT mode, 9600bps, SH and SL go to DH and DL of the other module, and vice versa.
Your packet structure and parsing algorithm is waaaay more complicated than it needs to be. Try using this serial transfer library instead - it'll take care of "packetizing" and parsing transmitted data bytes (up to 255 bytes of payload per packet)
Power_Broker:
Your packet structure and parsing algorithm is waaaay more complicated than it needs to be. Try using this serial transfer library instead - it'll take care of "packetizing" and parsing transmitted data bytes (up to 255 bytes of payload per packet)
@rodstar, why on earth are you digging up a 3 year old post? Just as your own question in your own thread so we can get to your problem faster instead of having to wade through other, unnecessary posts first!