Troubleshooting

Common issues that we faced in testing the devices

The Serial_Node will not connect to the Arduino Board!

Often, this issue is caused by an issue with the baud rate. In your Arduino Sketch, there should be a line where you establish the baud rate (often using the Serial.begin() command). Make sure that number is set to 9600.

For example, this example sketch will have the XBee radio run at a baud rate of 9600. Therefore, when you run rosserial in the bash terminal, you will also need to run it with a baud rate of 9600.

XBee-Test-Script.ino
// We'll use SoftwareSerial to communicate with the XBee:
#include <SoftwareSerial.h>

//For Atmega328P's
// XBee's DOUT (TX) is connected to pin 2 (Arduino's Software RX)
// XBee's DIN (RX) is connected to pin 3 (Arduino's Software TX)
SoftwareSerial XBee(2, 3); // RX, TX

//For Atmega2560, ATmega32U4, etc.
// XBee's DOUT (TX) is connected to pin 10 (Arduino's Software RX)
// XBee's DIN (RX) is connected to pin 11 (Arduino's Software TX)
//SoftwareSerial XBee(10, 11); // RX, TX

void setup()
{
  // Set up both ports at 9600 baud. This value is most important
  // for the XBee. Make sure the baud rate matches the config
  // setting of your XBee.
  XBee.begin(9600);
  Serial.begin(9600);
}

void loop()
{
  if (Serial.available())
  { // If data comes in from serial monitor, send it out to XBee
    XBee.write(Serial.read());
  }
  if (XBee.available())
  { // If data comes in from XBee, send it out to serial monitor
    Serial.write(XBee.read());
  }
}

Last updated