I have 2 XBee Pro S3B, one connected to an Arduino Uno and the other to a XBee Explorer. So far I am able to chat between the 2 nodes (the one with the Arduino being the Router and the one with the Explorer being the Coordinator). I use the console of CTU and the Serial Monitor of Arduino IDE for this.
Now I want to send Input Samples from the Coordinator to the Router and I set in the IO settings: D1 ->ADC [2] and in IO Sampling: IR -> 10000 (this is the sample rate).
I explorer is now turning the RSSI led on accordingly, but I am not getting anything is my Arduino Serial Monitor (as I was getting with the chat experience before).
This is the code for the chat and works just fine. I don't understand then, why the sample readings are not being received in the arduino serial monitor.
#include <SoftwareSerial.h>
SoftwareSerial mySerial(3, 2); // RX, TX
void setup() {
// Open serial communications and wait for port to open:
Serial.begin(9600);
while (!Serial) {
; // wait for serial port to connect. Needed for native USB port only
}
// Set the data rate for the SoftwareSerial port
mySerial.begin(9600);
} // End of setup function
void loop() { // Run over and over
if (mySerial.available()) { // If there is data from the Xbee
Serial.write(mySerial.read()); // Write it to the serial of Arduino
}
if (Serial.available()) { // If there is data to be sent
mySerial.write(Serial.read()); // Send it to the Xbee
}
while (!Serial) {
; // wait for serial port to connect. Needed for native USB port only
}
You don't HAVE a native USB port, so why do you have this code?
What input samples is the coordinator collecting? What is the other XBee supposed to do with the data?
When you have the XBee collecting data from sensors connected to it, and automatically broadcasting that data, the XBee is supposed to be in API mode. The packets it sends are not meant to be sent to the Serial Monitor app.