Arduino yun and I/O expansion shield compatibility

Hi all

for my actual project i need to use rs485 with my arduino yun and so I decide to use the I/O expansion shield v5 .

i've already tested the sketch with a UNO and it works fine. when i use it on Yun i've some problem.
i see the data coming via serial monitor but not from the rs485 interface. There is some problemshield with the YUN/leonardo?
there's something to modify to make it works?
Or in alternative ther is any rs485 shield that works with Yun ?

thank you for your help

Hi all,

About my problem:

Of course, in the I/O expansion v5 I move the three jumpers to select the rs485.
After reading a lot of the documentation regard the Yun, I understand that this arduino, like the arduino Leonardo is different respect to the oldest arduino. BUT i have read that there can be problems ONLY if I use the SPI library.... but I don't use it.....
in theory I should use only the RX, TX, and digital 2 pin..... and use the Serial1 class in the firmware....

I used first the example code from the shield's wiki doc to test it (appropriately modified) , first on the arduino uno (the original code) and then on the yun (the modified code), and while the first works well ( I can see trough my rs485-usb interface for pc the letter A), with the yun I just can see only FF packets ( that I think they are only noises)

Anyway this is the modified sample code that I used:

#include <Bridge.h>
#include <Console.h>
#include <FileIO.h>
#include <HttpClient.h>
#include <Mailbox.h>
#include <Process.h>
#include <YunClient.h>
#include <YunServer.h>

int EN = 2; //RS485 has a enable/disable pin to transmit or receive data. Arduino Digital Pin 2 = Rx/Tx 'Enable'; High to Transmit, Low to Receive
 
void setup() 
{
  pinMode(EN, OUTPUT);
  Serial1.begin(9600);
  Serial.begin(9600);
} 
 
void loop()
{
// send data 
  digitalWrite(EN, HIGH);//Enable data transmit
  Serial1.print('A');
  Serial.print('A');
  delay(1000);
}

I use the Serial class for the serial monitor (otherwise I wouldn't see anything on the monitoring program) and the Serial1 class to use the rs485 interface on the shield.

Edit:

I found this older topic :

http://forum.arduino.cc//index.php?topic=190709.msg1422995#msg1422995

In this topic they say that I have to change the pin connections and, moreover, that I can't use at the same time Linino and the TTL serial (TX, ad RX ) :

This brings us to Serial1. Serial1 is a hardware UART you can use, connected to pins D0 and D1. You could use this to communicate with your XBee shield, altough I wouldn't recommend it, as those pins are used for bridge communications (Between the "Arduino" and the "Linux"). If you want to used these pins anyways and not use Linio, then just get a Leonardo. Eats less power and it's cheaper.

my project should collect data sent via RS485, store them on sd and send them to a remote server. So I choose arduino yun since it integrates all of these features ...
But if I can not use at the same time linino and serial rs485 this is a strong limitation for my project .....

you have any advice on this?

Thank you for any your help

some news:
I've used the SoftwareSerial Library changing the tx-rx pins to 8 & 9

what I try to do it's to comunicate with a Phoenix Contact device via rs485 ModBus/RTU
yun send correctly the query to the device and the device correctly responds (I see this with a usb-rs485 interface and Hercules Software) but Yun doesn't read the packet ( try to send the string to Serial monitor and there isn't any data)

any idea?