Hello!
I purchased the XBee Wireless Kit Retail (RTL-09897) 6 years ago along with my Arduino Uno and had a lot of fun playing with it then. Fast-forward 6 years and I’ve rediscovered my interest in electronics so I took my kit out of storage and now I am trying to remember how to use it. I knew I was going to hit trouble with 6 year old hardware v.s. updated software (i.e… xctu) so below is my setup and problem.
Project: Have a single LED light turned on/off wirelessly by sending a character through the serial communication from my laptop. H = Turn the LED on for 10 secs, anything else should turn the LED off for 10 secs, otherwise keep blinking.
Hardware: I have 1x Arduino Uno, 1x XBee Shield, 1x XBee USB Explorer, 2x XBee S1.
Problem: I’ve read [Sparkfun’s Exploring XBees and XCTU guide along with many other internet guides but they all assume you can connect two XBee’s to your computer at the same time, but I can’t because I only have one XBee USB Explorer. So I follow the guide very closely, configure the CH, ID, DH, DL respectfully for each XBee but cannot figure out how to send a character from the USB connected XBee to the other on the Arduino. I remember doing this originally with the Serial Monitor provided with the Arduino IDE but now when I open that and type either nothing happens in the text area below or I see a bunch of garbage characters.
Direct Question: How do I send data (number, characters, or strings) from the USB Explorer connected XBee to the one attached to my Arduino?
Software:
Fedora 26
Linux 4.13.5-200.fc26.x86_64 #1 SMP Thu Oct 5 16:53:13 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
XCTU Version 6.3.10, Build ID: 20170928-2
Arduino IDE 1.6.6
Note: That I am running all of this as the root user so it has full access.
XBee Sheild:
Set to DLINE
XBee 1 Setup (Connected to my PC via USB Explorer):
Series: 1
Product Family: XB24
Function set: XBEE 802.15.4
Firmware version: 10ef
Baud: 9600
CH: C, ID: 555, DH: 0, DL: 2, MY: 1, CE: Coordinator [1]
AP: API enabled w/ PPP [2]
XBee 2 Setup (Connected Arduino Uno via XBee Shield):
Series: 1
Product Family: XB24
Function set: XBEE 802.15.4
Firmware version: 10ef
Baud: 9600
CH: C, ID: 555, DH: 0, DL: 1, MY: 2, CE: End Device [0]
AP: API enabled w/ PPP [2]
Now when XBee1 is connected to my PC I can use the XCTU Discovery Mode to see the visualization graph of the connected devices. It successfully displays that XBee1 (Coordinator) is connected to another XBee2 device but it’s Role is shown as Unknown. That’s concerning because I would think it should display End Device.
http://stevenz.io/wp-content/uploads/20 … covery.png
Now if I try to send a character using Arduino Serial Monitor it will either display no characters or garbage characters, more importantly nothing happens to the LED light and it keeps on blinking which implies no data is being transmitted at all.
http://stevenz.io/wp-content/uploads/20 … 68x298.png
Here is the code loaded on the Arduino.
#include <SoftwareSerial.h>
SoftwareSerial XBee(2, 3); // RX, TX
int ledPin = 13;
void setup()
{
XBee.begin(9600);
pinMode(ledPin, OUTPUT);
}
void loop()
{
if (XBee.available()) {
char c = XBee.read();
if (c == 'H')
{
// stay on for 10 secs if you see an H
digitalWrite(ledPin, HIGH); delay(10000);
}
else{
// stay off for 10 secs for anything else
digitalWrite(ledPin, LOW); delay(10000);
}
}
else{
// just blink on/off when there is no communication.
digitalWrite(ledPin, HIGH); delay(200); digitalWrite(ledPin, LOW); delay(200);
}
}
Question: Am I using the SoftwareSerial and XBee library correctly? Are these compatible with the devices I have? Is it good for XBee S1? Also where is the documentation for the XBee library, where can I find out what functions exist and what they do?
Any help at all is appreciated, this is only the first step in a very long journey I have planned.](https://learn.sparkfun.com/tutorials/exploring-xbees-and-xctu/all.pdf)