I have additional information. Here is an email I sent to the sparkfun support email address:
Spark Fun Team,
These are not configured with the newest firmware, but I’ve tried the same setup with newest firmware v2003, older firmware, and on older firmware in the general Zigbee function set with the same results. In the general Zigbee function set the “end device” can be configured as a “router.” This is how most videos configure their end devices. I’ve tried that, but the behavior was the same in that the devices communicated through their terminal when hooked up to the PC, but seemingly do not communicate wirelessly through Arduino. Hardware involved is:
1.) Elegoo Arduino Uno (x2)- running all the latest firmware through Arduino IDE. Libraries are the latest.
2.) Digi Xbee S2C Model: S2CTH (XB24CZ7WITB003) (x2)
3.) Sparkfun explorer board #WRL-11812 (https://www.sparkfun.com/products/11812 ) (x2) I soldered the header pins on to be able to plug it into a breadboard.
Here’s the video ( https://www.youtube.com/watch?v=J5lw0Zq … e=youtu.be ) that does a very nice job explain the hardware setup and the program setup of the system. I’ve found this example most helpful for testing, and it is also probably very close to what I need in the end if the system is to not operate on a server. I have conceded server operation at this point given the time constraints. There are at least two additional interfaces and protocols I’d have to fight to get that working. I think I’ve included all the pertinent information for you to investigate. Please note the MY (16-bit source address) parameters in the .xpro files I’ve attached do not match those shown in the video, but I have tried his exact setup with no luck.
I can only get the two devices to communicate through the XCTU software terminal when the devices are hooked up to my PC via their USB ports on the sparkfun board. When powered through the Arduino they don’t do anything. Do I have to changed a parameter to enable receipt and transmission of serial data through the sparkfun board’s DOUT and DIN pins? I’m powering the XBee via your dev board’s 5V pin. Is this ok? DO the DOUT and DIN pins need to be configured to read a particular voltage coming from the Arduino serial software pins 2 & 3 or from the RX and TX pins?
Here’s my arduino coordinator code:
#include <SoftwareSerial.h>;
#include <XBee.h>;
// constants won't change. They're used here to set pin numbers:
const int buttonPin = 7; // the number of the pushbutton pin
const int ledPin = 13; // the number of the LED pin
// Variables will change:
int ledState = HIGH; // the current state of the output pin
int buttonState; // the current reading from the input pin
int lastButtonState = LOW; // the previous reading from the input pin
// the following variables are unsigned longs because the time, measured in
// milliseconds, will quickly become a bigger number than can be stored in an int.
unsigned long lastDebounceTime = 0; // the last time the output pin was toggled
unsigned long debounceDelay = 50; // the debounce time; increase if the output flickers
SoftwareSerial XBee(2,3);//RX, TX
void setup() {
pinMode(buttonPin, INPUT);
pinMode(ledPin, OUTPUT);
Serial.begin(9600);
XBee.begin(9600);
// set initial LED state
digitalWrite(ledPin, ledState);
}
void loop() {
// read the state of the switch into a local variable:
int reading = digitalRead(buttonPin);
// check to see if you just pressed the button
// (i.e. the input went from LOW to HIGH), and you've waited long enough
// since the last press to ignore any noise:
// If the switch changed, due to noise or pressing:
if (reading != lastButtonState) {
// reset the debouncing timer
lastDebounceTime = millis();
}
if ((millis() - lastDebounceTime) > debounceDelay) {
// whatever the reading is at, it's been there for longer than the debounce
// delay, so take it as the actual current state:
// if the button state has changed:
if (reading != buttonState) {
buttonState = reading;
// only toggle the LED if the new button state is HIGH
if (buttonState == HIGH) {
ledState = !ledState;
}
}
}
// set the LED:
digitalWrite(ledPin, ledState);
XBee.write(ledState);
Serial.print(ledState);
// save the reading. Next time through the loop, it'll be the lastButtonState:
lastButtonState = reading;
}
Here’s the code for the receiver/end device arduino:
#include <SoftwareSerial.h>;
#include <XBee.h>;
SoftwareSerial XBee(2, 3);
int data= 0;
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
XBee.begin(9600);
pinMode(7,OUTPUT);
}
void loop() {{
while(XBee.available())
data = XBee.read();
Serial.print(data);
}
if(data== 1){
digitalWrite(7,HIGH);
}
if (data == 0){
digitalWrite(7,LOW);
}
}
The Xbee is plugged into a breadboard via the sparkfun WRL-11812 with the DIO pins 2 & 3 from the elegoo arduino uno lining up with the DOUT and DIN pins for the explorer board. I’m wondering if not having level shifting on the sparkfun explorer is causing me issues. I didn’t initially think it was a problem. I can see data from the arduino in the coordinator XCTU terminal when the XBEE and arduino are powered via the usb cord into the sparkfun explorer board, but I’m just looking at hardware now. I’m at a total loss.