Hello everyone!
I’m trying to setup my newly imported xBee’s for communication between my PC and some kind of scratch-build flight controller, so I can track telemetric data as well as send some minor calibration-adjustments to the quad.
For configuration I use this wiring layout (see the Picture) of an Arduino Mega 2560 and the explorer board. Unfortunately XCTU is not able to find any plugged-in xBee module and even trying manually setting up the boards with AT commands does not give me any response.
Since the Mega’s pins 0 and 1 are also connected to USB-to-TTL chip, it is only running a blank code snippet.
Other setups I tried so far:
…
void loop() {
if(Serial.available()) { Serial1.write(Serial.read()); }
if(Serial1.available()) { Serial.write(Serial1.read()); }
}
- also swapping the RX and TX at Serial1
I hope someone my has an idea what could be wrong or has even this issue fixed by him-/herself.
Hello, and thanks for your forum post!
We actually get this question a lot and what’s happening is you have three serial devices on a single serial bus. Serial should only have two devices and the third device causes bus contention issues that cause X-CTU to not be able to see the XBee.
There’s two ways to fix this. The first would be to use a FTDI cable or adapter that doesn’t have an Arduino connected to it. Something like the [5 volt FTDI Basic Breakout would be ideal for this.
If you don’t have an FTDI, you could use a Mega, but you can’t use pins 0 and 1 for serial since those are used by the ATMega2560 chip on the Mega board. You can write a simple sketch that passes data between the Mega’s Serial port (USB and pins 0&1) and a software serial port or one of the Mega’s free hardware UARTs.
The code below should work for you. If you have trouble, try connecting a jumper wire between 5V and the Mega’s RESET pin.
/*
Connections:
Arduino --> XBee Explorer Regulated
5V --> 5V
GND --> GND
18 --> DIN
19 --> DOUT
*/
void setup()
{
// Set up both ports at 9600 baud.
Serial.begin(9600); //This is the Mega
Serial1.begin(9600); //This is your XBee
}
void loop()
{
if (Serial.available())
{ // If data comes in from serial monitor, send it out to XBee
Serial1.write(Serial.read());
}
if (Serial1.available())
{ // If data comes in from the XBee, send it out to serial monitor
Serial.write(Serial1.read());
}
}
](https://www.sparkfun.com/products/9716)
Hello Chris,
thanks for your reply!
Unfortunately I’m still not able to find the xbee in X-CTU while using the Mega (only thing I didn’t try yet is the 5V ↔ Reset jumper), but I found some 5V FTDI Breakouts I used for the pro mini’s - they are working fine!
So maybe it’s a problem with the Mega itself…I’ll try with another one next weekend to check the arduino way, too.
Chris,
I’m having an issue as well with the breakout board and pixhawk. Previously we had custom built our own boards for the pixhawk and was recently made aware of your board. We have wired everything per all the specs, and the same way we wire everything else and we are getting nothing out. Power lights up but that’s it.
Based off this reference http://ardupilot.org/copter/_images/Tel … ixhawk.jpg
Which is how our custom boards wire as well.
Hi greatlakes.
I don’t know how the Pixhawk is wired. Are you absolutely sure you haven’t crossed RX and TX? Data out from the Pixhawk should be going to data in on the XBee.