Problem using XBee with Yun

I recently started experimenting with XBees and since my Yun runs a sketch 24/7 I did my initial work with a Uno. I have Series 1 XBees and am connecting to the Arduinos using the Sparkfun Arduino shield. If I plug this shield onto an Uno the sketches work fine - I'm able to communicate with the XBee (send '+++', send AT commands, receive packets from other XBees etc). The sketches are all set up to communicate with the Arduino using SoftwareSerial on pins 2 & 3.

However if I take this shield and plug it into the Yun it fails to communicate with the XBee. Sending a '+++' results in no response. I've tried all my usual debugging tricks and can't yet figure out why it isn't working. It seems to be a basic failure to communicate over pins 2 & 3 (but it works fine on the Uno...).

I'm hoping someone can give me some pointers to help me track this down. I feel I'm missing something obvious but I'm not sure what it is. When I am doing these tests on the Yun there are no other connections to the Arduinos.

I was doing some additional forum searching and found a comment about pin limitations on the Leonardo that might apply here. On the Leonardo page it says "Not all pins on the Leonardo support change interrupts, so only the following can be used for RX: 8, 9, 10, 11, 14 (MISO), 15 (SCK), 16 (MOSI)".

So this seems to say I can't use pin 2 for RX with SoftwareSerial. Is this likely the issue, and if so would I be safe in using Pin 8 for RX and pin 9 for TX? If so I'll have to hack the Sparkfun board as its switch only has the option for 0/1 or 2/3.

Thanks.

Hi roadfun,

I have already posted a solution for the same problem: http://forum.arduino.cc//index.php?topic=190709.msg1422995#msg1422995
You have to modify the Sparkfun XBee shield. You can see a picture attached to the post.
Please also note my follow-up post regardings periodic hangs if you are using the YunServer + SoftwareSerial.
Here is a link to the other post: YunServer + SoftwareSerial = periodic hangs - #3 by system - Arduino Yún - Arduino Forum
Maybe you will get the same problem. Currently I am using a watchdog to recover from the hangs.

Bye,
Sebastian

Thanks very much Sebastian. A picture is worth a thousand words - now I clearly understand what to do. And I discovered that if I view the Forum on my iPad there is no indication at all there is a picture attached. I had to look for it using a computer to view the forum instead.

I had seen your post on the SoftwareSerial issue and will keep an eye out. I'm first going to modify the board for pins 8/9 and test it on an Uno. If that seems stable I'll move it all over to my Yun.

roadfun:
Thanks very much Sebastian. A picture is worth a thousand words - now I clearly understand what to do. And I discovered that if I view the Forum on my iPad there is no indication at all there is a picture attached. I had to look for it using a computer to view the forum instead.

Maybe you weren't logged in: images are available only to logged in users. I've pinged the webmaster to fix the issue

You are right Federico. I didn't notice I wasn't logged in and once I did I could see the image on my iPad.

Good, in the meanwhile the webmaster fixed that and now images are available even to not logged in users