I am living in Turkey.About 2 months ago I bought the XBee Pro S2C (original) module due to its maximum distance
range of 3.2 km.I was able to transfer the GPS data I received from GY-NEO 6MV2 to the XBee Pro S2C.The reason I chose
this RF module was for the drone(autopilot).I wanted my drone to go 2 kilometers away.As a result of my trials, I found
that GPS data did not come after 500 meters.Weather conditions were good when I tested.Moreover, I am very surprised that a
module that range of 3.2 kilometers away in the best weather conditions cannot send data after 500 meters in a sunny and
open area.
I complain about this situation.
Receiver Arduino Code (with Coordinator XBee) (Arduino MEGA)
#include “SoftwareSerial.h”
// RX: Arduino pin 10, XBee pin DOUT. TX: Arduino pin 11, XBee pin DIN
SoftwareSerial XBee(10, 11);
float DO_float=0;
void setup()
{Serial.begin(9600);
// Baud rate MUST match XBee settings (as set in XCTU)
XBee.begin(9600);
}
void loop()
{
if (XBee.available()) { // If data comes in from XBee, send it out to serial monitor
char DO, buf[100];
DO = XBee.read();
DO_float = atof((char *)buf);
Serial.print(DO);
//Serial.println(DO_float); //uncomment to print floating point result
}
Transmitter Arduino Code (with Router XBee)
#include “SoftwareSerial.h”
#include
//long lat,lon; // create variable for latitude and longitude object
float lat,lon;
TinyGPS gps; // create gps object
SoftwareSerial XBee(10, 11);
void setup(){
Serial.begin(9600);
XBee.begin(9600);
Serial.println(“The GPS Received Signal:”);
Serial3.begin(9600); // connect gps sensor
}
void loop(){
while(Serial3.available()>0){ // check for gps data
if(gps.encode(Serial3.read()))// encode gps data
{
gps.f_get_position(&lat,&lon); // get latitude and longitude
Serial.print("Position: ");
//Latitude
Serial.print("Latitude: ");
Serial.print(lat,8);
Serial.print(",");
//Longitude
Serial.print("Longitude: ");
Serial.println(lon,8);
XBee.write(“NA”); // latitude
XBee.print(lat,6);
delay(100);
XBee.write(“EA”); // longtitude
XBee.print(lon,6);
delay(100);
}
}
}
XBEE CONFIGURATION ----- IN 802.15.4 TH PRO FUNCTION
Router (Transmits GPS data)
CH - C
ID PAN ID - 2018
DH - 0
DL - 1
MY 16 bit Source Adress - 2
CE - END DEVICE
API DISABLED (AT MODE)
Coordinator (Receives GPS Data)
CH - C
ID PAN ID - 2018
DH - 0
DL - 2
MY 16 bit Source Adress - 1
CE - Coordinator
API DISABLED (AT MODE)
other settings are default in both of modules
The distance has to be extended and this is very important to me.
I chose this module because I trusted DIGI company.
Please help me solve the problem.
I don’t want to buy a XBee Pro XSC S3B module. It’s very expensive.