> For the complete documentation index, see [llms.txt](https://clemson-autonomous-systems.gitbook.io/clemson-university-autonomous-systems/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://clemson-autonomous-systems.gitbook.io/clemson-university-autonomous-systems/multi-agent-development/multi-agent-networking-guide/rosserial-guide/troubleshooting.md).

# 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.

{% tabs %}
{% tab title="Arduino Sketch" %}
{% code title="XBee-Test-Script.ino" %}

```cpp
// 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());
  }
}
```

{% endcode %}
{% endtab %}

{% tab title="Terminal A" %}

```bash
# Start ROS Master
roscore
```

{% endtab %}

{% tab title="Terminal B" %}

```bash
# Start Rosserial Node
rosrun rosserial_python serial_node.py _port:=/dev/ttyUSB0_baud:=9600
```

{% endtab %}
{% endtabs %}
