Seeedstudio Xbee shield v2.2 with Xbee S1 Pro

Hello everyone !

I am posting here out of desesperation , it's been days I'm looking for a solution to my problem and I'm afraid this forum might not be the one to post this thread, if so, I'm sorry.
I've tried contacting Seeedstudio, without success.

Otherwise, I'm going to write my problem and everything I've tried / done before coming here :

I'm starting a personal project : building a controller for an RC Car out of a Xbox360 controller.
I had no problem using a USB host shield etc for the controller , however , I'm struggling with the xbee modules.

I am trying to make a Arduino Mega equipped with a SeeedStudio XBee shield v2.2 (Xbee S1 Pro module plugged in) communicate with an Arduino UNO with the same shield and module.

I configured both XBee modules with XCTU correctly (Same PAN ID , same CH channel , MY Adress 1000 and 1001 resprectively , AP mode disabled , DH set to 0 , DL set to the other module MY adress).

I tested both modules with XCTU (Shield jumpers set to 0RX and 1TX for USB Serial communication) and they work properly (With a empty program uploaded in both Arduinos of course).

However , when I'm trying with the arduinos , nothing work as expected.

I wrote very simple programs for both arduinos :

Receptor :

#include <SoftwareSerial.h>

#define LED 13

SoftwareSerial xbee(2, 3);

void setup()
{
  pinMode(LED, OUTPUT);
  Serial.begin(9600);
  xbee.begin(9600);
}

void loop() 
{
  while (xbee.available() > 0)
  {
    digitalWrite(LED, HIGH);
    xbee.read();
    delay(500);
    digitalWrite(LED, LOW);
    delay(500);
  }
}

Emitter :

#include <SoftwareSerial.h>

#define LED 13

SoftwareSerial xbee(10, 11);

void setup()
{
  pinMode(LED, OUTPUT);
  Serial.begin(9600);
  xbee.begin(9600);
}

void loop() 
{
  if (millis() > 5000)
  {
    xbee.println("Hello world !");
    digitalWrite(LED, HIGH);
    delay(500);
    digitalWrite(LED, LOW);

    delay(2000);
  }
}

But the receptor receive nothing , not even the red led on the shield indicating some data is being received lits up.

The code shown here uses SofwareSerial . I however tried with the Serial communication (pin 0 and 1) with the same results.

I normally use VS2013 and Visual Micro to code , but to exclude any interference possibility , I used the Arduino IDE.

This shield is also very poorly documented and there's no example code on SeeedStudio's wiki.

This is driving me really crazy , I'll appreciate any help.

Thanks for your time.

This shield is also very poorly documented

You are perpetuating that by not even posting a link.

... and there's no example code on SeeedStudio's wiki.

I already looked on the SeeedStudio's wiki , that should normally include everything to make it work at (at least) a basic level.
I am talking about Documentation , help given by the constructor to help customers , and the only thing I found by SeeedStudio is a schematic.

Moreover , there's no wiki for v2.2 shield, I assume the v2.0 wiki should be sufficient.

... it's been days I'm looking for a solution to my problem ...

I am posting here out of desesperation ...

If any link I checked did offer only one possibility of making my shield work , I would not be posting that thread.

As I said , I've tried everything I could look for and think for with my actual electronic and developing skills , and the only thing keeping me from trying to get my hand on another shield is that maybe another guy with more experience than me could get me on the right path.

As I said , the only thing left for me to check is with another shield.

Now , I know that any random forums gets peoples who don't care about the community , so you don't trust pretty much anyone with 1 or 2 posts , but I don't think making harsh comments like that is going to help anyone.

I did read the forum rules, and I do not even speak English natively.

You are perpetuating that by not even posting a link.

Even if you did not say it directly , it make me feel like my week worth of work is useless.

Maybe I took your reply wrong , and if I did I apologise.

Having the link to the shield makes it easier to see what shield you are talking about. Thank you far adding that.

I am trying to make a Arduino Mega equipped with a SeeedStudio XBee shield v2.2 (Xbee S1 Pro module plugged in) communicate with an Arduino UNO with the same shield and module.

Which device has the Emitter code and which has the Receptor code? The Mega has 4 hardware serial ports. It really doesn't make sense to be using SoftwareSerial on the Mega, and, in fact, it only works on some pins.

Not all pins on the Mega and Mega 2560 support change interrupts, so only the following can be used for RX: 10, 11, 12, 13, 14, 15, 50, 51, 52, 53, A8 (62), A9 (63), A10 (64), A11 (65), A12 (66), A13 (67), A14 (68), A15 (69).

Have you made absolutely certain that the jumpers on both shields match the pins that you are doing SoftwareSerial on?

Is there a possibility that you have TX and RX reversed?

The UNO has the Receptor code , and the Mega has the Emitter.

As for why I use SoftwareSerial , it's because the shield is made to work with the UNO pins (aka 0 to 12), while I could use some wire to use hardware Serials , I am not comfortable enough to do it on my own without being sure not to burn anything.

Also, yes , I already read the fact that the Mega does not support SoftwareSerials on all pins.

SoftwareSerial xbee(10, 11);

And finally , I am sure RX and TX aren't reversed , I checked that so many times ...

Hey Fluffy_Kaeloky,

Did you ever resolve this issue?

I am doing something similar and have not been able to get the communication working.

I am using an Arduino Mega with the Seeedstudio XBee Shield to try and communicate with computer via an XBee explorer.

I use m/f jumper wires to connect xb_tx to tx1 and xb_rx to rx1 so I could make use of the hardware UART. It's fairly foolproof as both the Mega and the XBee shield are well labelled.

I did this setup to test out the XBee communication is working and it's not apparently.

I started with a pair of S1 XBee Pros and have since changed to a regular pair of S1 XBees, because I have used them before and know they are properly configured to communicate with each other. But it is still not working.

One thing I have noticed I was doing wrong, was that I had my XBees configured through XCTU for a different baudrate than I was using in my code. You never mentioned what you configured your XBee baudrate to in XCTU so I figured I might add that here for you or anyone else that comes across this later.

My Arduino test code is :

void setup() {
  // put your setup code here, to run once:
  Serial.begin( 57600 );
  Serial1.begin( 38400 );

  Serial.println( "Setup" );
  Serial1.println( "XBee Setup" );
}

void loop() {
  // put your main code here, to run repeatedly:
  
  if( Serial1.available( ) ) {
    Serial.write( Serial1.read( ) );
  }
  if( Serial.available( ) ) {
    Serial1.write( Serial.read( ) );
  }

  delay( 2000 );
}

And my Python test script is this :

#!/usr/bin/python

import time, sys, serial, os.path

class pySerial:
    def __init__( self, ser=None, port="/dev/ttyUSB0", baud=38400 ) :
        self.exitcond = False
        if ser != None:
            self.ser = ser
        else :
            x = 0;
            while x < 10 :
                port = '/dev/ttyUSB' + str( x )
                print
                print 'Serial Port connection attempt on ' + port + ' : '
                if os.path.exists( port ) == True :
                    try :
                        self.serial = serial.Serial( )
                        self.serial.baudrate = baud
                        self.serial.port = port
                        self.serial.timeout = 3
                        self.serial.open( )    
                        self.serial.flushInput()
                        self.serial.flushOutput()
                        print "Serial Port : Opened"
                        x = 10
                    except :
                        print "Serial Port : Failed to open"
                        self.exitcond = True
                x += 1

if __name__ == "__main__":
    pyCon = pySerial( )
    try:

        while pyCon.exitcond == False :

            #time.sleep( 0.01 )
            while pyCon.serial.inWaiting > 0 :
                if pyCon.exitcond == True :
                    break

                s = pyCon.serial.readline( )
                if s != '':
                    print 'Read : "' + pyCon.serial.readline( ) + '"'
                else :
                    time.sleep( 1.33 )
                    pyCon.serial.write( "I am the serial_test.py script" )
                    print "Wrote : I am the serial_test.py script"


    except KeyboardInterrupt:
        sys.exit( 0 )

The Arduino Serial Console only ever outputs "Setup".
The Python script only ever outputs "Wrote : I am the serial_test.py script".

I am at a loss on this.

Well, I figured out my issue. I had my TX/RX lines crossed.

On the Mega, the jumper wires from TX1/RX1 need to go to XB_RX/XB_TX respectively.

I wasn't able to get the XB Explorer to work. It works in XCTU for configuring the XBees, but not for transmitting/receiving data. I have the Regulated (non-USB) version too, which I was able to get working after finally getting the setup correct.

Onwards and upwards!

I hope this helps someone else.

Cheers!