Connect Arduino Yun with Arduino Uno through RX/TX pins

Hi,

I would like to use only the AR9331 of the Arduino Yun and connect it to another Arduino Uno.
As far as I have understood, RX/TX pins are used for serial communication between 32u4 and AR9331. Instead of using the 32u4 processor, I want to enable serial communication between arduino Uno and AR9331 processor.
I have disabled the serial console that is running on the serial port (comment the last line in /etc/inittab) and I have connected the RX/TX pins of the two boards with cables.
I have configured both the serial ports in Arduino Uno and Arduino Yun to Baudrate=115200.
My program is running on Arduino Uno and prints messages in the serial port (serial communication over USB), which I can see if I open the COMX port in my PC at the corresponding baud rate. I want these messages to be written also to the serial port of AR9331, so I can handle them from there.
What else I should configure in both sides?
Thanks in advance

Theodoros

That doesn't work, the 9331 doesn't have a physical connection to any RX/TX header/pins on the board. Those are 32u4 only...

Ralf

Firstly, thanks for the response!

As it is described in the http://arduino.cc/en/Main/ArduinoBoardYun in the Communication section :
"Digital pins 0 and 1 are used for serial communication between the 32U4 and the AR9331. Communication between the processors is handled by the Bridge library."
and
"A SoftwareSerial library allows for serial communication on any of the Yún's digital pins except for pins 0 and 1."

Correct me if I am wrong, but from the above, I have understood that RX,TX pins handle the connection between the two processors.
From the side of 32U4, you can access these pins reading/writing to Serial1 and from the side of AR9331 reading/writing to /dev/ttyATH0. I thought that by disabling the bridge library, I could write sth to the RX/TX (from external device, in my case Arduino Uno) and this could be read by both the 32u4 and AR9331. To confirm this, I tried to cat /dev/ttyATH0 on the side of AR9331 (after having set the baud rate to the same rate of the external device's RX/TX), but I did not get anything.
I just want to get serial data directly to AR9331. Any idea would be more than welcomed.
Thanks in advance

I have a arduino mega connected to my yun like you want to do.
simply upload a empty sketch (or a sleeping sketch) or a sketch not using the bridge or serial 1 on the leonardo of the yun.
Connect the RX TX mega pins (mega has 4 serial connections) you want to use to communicate to pin 0 and 1 of the yun.

I use a usb cable connected between the yun and the mega to upload sketches.
With the uno the upload part will be a bit more complicated as it only has 1 serial connection. you can try using softserial to connect to pin 0 and 1 of the yun.

Since the new version of the yun this all works pretty stable.

Note this has nothing todo with the bridge. This setup can be used with the bridge and without.

Best regards
Jantje

1 Like

Hi Jantje,

Thanks for your response!
What I mainly want is to achieve a communication between the AR9331 of the Yun board and an external Arduino Uno.
What is written/read in the serial port of the Arduino Uno, I want to be read/written from the Linino side.

1)I am trying to connect directly from Arduino Uno to Arduino Yun through USB host. I thought that this communication channel is better than playing with the RX/TX pins. So, I used a USB cable connecting Uno and Yun .
2)Then, I installed kmod-usb-acm and configured the /dev/ttyACM0 to a baudrate of 115200, as my Uno's serial (stty -F /dev/ttyACM0 115200).
3)I also flushed the ATmega32u4 of Yun with an empty sketch
4)I can see the TX led of arduino Uno blinking (indication of data transmitted to the serial port)
5) When I cat /dev/ttyACM0, I could see anything a couple of messages but after that it hangs. I would appreciate if anyone could give me his intuition on this issue.
Thanks in advance

Theodoros

what you are describing is what I blogged about a long time ago http://blog.baeyens.it/#home (look for yun)
It is very unstable with linino. Have you upgraded your yun? If not you are wasting time.
After i upgraded it all worked fine for me.
In your setup there is no reason to disable the bridge. you can use the leonardo part of your yun and the uno at the same time.
Best regards
Jantje

Hi Jantje,

I upgraded arduino-yun and now I can see the output in the serial port when I cat /dev/ttyACM0.
I tried again to cat /dev/ttyATH0 , connecting RX/TX pins of Arduino Uno with TX/RX pins of Arduino Yun and having set the baud rate. But still I cannot see anything.
i have also connected GND pins. Nothing as well.
I have also tried to see the output in another Arduino Uno (just to confirm), connecting RX/TX pins and that works.
So, the issue still holds in the point that Arduino Yun RX/TX pins cannot read the RX/TX pins of Arduino Uno.
You mentioned before using softserial for Arduino Yun. From the side of ATmega32u4, I can read the output of RX/TX pins, (Serial1) but I cannot read it from the side of AR9331.
Any idea?
Thanks in advance,
Theodoros

Have you disabled the bridge on the openwrt side of the yun?
Have you made sure there is no sketch running on the arduino side of the yun that uses the serial port?

Hi,

My /etc/inittab

::sysinit:/etc/init.d/rcS S boot
::shutdown:/etc/init.d/rcS K shutdown
#ttyATH0::askfirst:/bin/ash --login

I have upladed an empty sketch to Arduino Yun.
I rebooted. Arduino Uno is writing to the serial port in BR=115200
I set up stty -F /dev/ttyATH0 115200 in Arduino Yun.
I reconnected the RX/TX pins between the two boards but the other way.
RX --- > RX
TX ---> TX

It worked! Is this normal?

Theodoros

theodorosb:
BR=115200
I set up stty -F /dev/ttyATH0 115200 in Arduino Yun.
I reconnected the RX/TX pins between the two boards but the other way.
RX --- > RX
TX ---> TX

It worked! Is this normal?

IMHO yes