Yun: Serial input on SoftwareSerial and Serial1 not working

Have a working app I am moving to the Yun. Was running on UNO.

All working and finally went to hook up the real hardware. Weather controller through a TTL to RS232 converter. Am able to see the output of the TTL side in a terminal app. OScope shows the TTL serial signal. But when I tried connecting to pin0 for serial1 or a pin for soft serial ( pins 7&8) I am not getting an input from either.

Anyone else having an issue with Serial1 or softserial on the YUN.

I am using Bridge, since the app publishes a webpage.

yun_weather_reader.ino (7.47 KB)

Yun's Serial port:

  • Serial - open serial connection via USB-Serial
  • Serial1 - open serial connection to Linino

You should use other name than those as SoftwareSerial since no more hardware port. Both Serial and Serial1 are reserve.

Yún's 32U4 processor is same as Leonardo's.

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


SoftwareSerial mySerial(10, 11); // RX, TX

Thanks tried. Even followed the documentation and set the pin modes for input and output. Used pins 8 & 9. Pin 8 rx/input.

got garbage characters.

Again, connected the ttl level output into the a USB serial port and used OSx coolterm. It showed the expected data.

Using this same weather controller and rs232/ttl converter board board on a UNO on pins 6 & 7. worked perfectly. also used NewSoftSerial, which is the same as the current softwareserial.

Plan B:

AltSoftSerial library.

Plan C:

Use USB to RS232 Converter, connect weather controller directly to Linino side. The 32U4 processor is off the loop.

Plan B I'll try.

Plan C is just telling me there is some bug in the YUN or the softwareserial library. If this is the case, I'll just stick to the bluetooth version of this project that has been working for multiple years using newsoftserial on pins 6 & 7 or use the try the adafruit wifi board and skip the yun.

But I am trying to so that so show off the Yun at the Makerfaire in May. Lets hope this can get working somehow.

Do you need to change every verison of serial to serial1? Or just the first? Thanks

I changed everyone. Then last night I changed back to softserial. So references changed again.


I tried SoftwareSerial on the YUN: it doesnt work I tried AltSortSerial on the YUN: it doesnt work

But both libraries works on the UNO. Somebody else tried to use any Serial on the YUN ? Because I have no more solutions. Maybe desable the wireless processor?

Yun uses Serial1 (UART) to talk to the AR9331 only when your sketch uses Bridge library Any other issue with serial and yun is the same issue you have with a leonardo. If you are in trouble using a particular shield and you find no yun related help, try looking for leonardo related help

[quote author=Federico Fissore link=topic=228470.msg1721457#msg1721457 date=1399995969] Yun uses Serial1 (UART) to talk to the AR9331 only when your sketch uses Bridge library [/quote] Nope. Sadly this is not true, because Linino sends a lot of data to the Leonardo part while booting. And when sending data the other way round, you have to get rid of the listener (askfirst ash) by manipulating initab.

I think @dilonb issue is with shields/sensors/other. If you plug in a shield made to use pins 0 and 1 (Serial1 on yun/leonardo), 32u4 <->Ar9331 communication is interrupted. Am I missing something? (may be...)

[quote author=Federico Fissore link=topic=228470.msg1721780#msg1721780 date=1400008820] I think @dilonb issue is with shields/sensors/other. If you plug in a shield made to use pins 0 and 1 (Serial1 on yun/leonardo), 32u4 <->Ar9331 communication is interrupted.[/quote] How does it detect if a shield is plugged in?

It does not. My previous message was misleading: communication is not interrupted, it's disturbed

I think that is probably what happening, you will need to reroute your pins on the shield (see

I don't use a shield, I connect a Serial 4 digit Display direct on the digital bloc of the Yun.

I used a led connected to the TX to see if data were transmitted (every second). I can see the LED blinking when the Yun is transmitting data, but the display doesn't work (with the UNO, all works). So maybe it's a problem of Levels or perturbations. I can't check the signal form because i have no scope. I tried to add a RC filter (100n - 220ohm) on the TX but no changes.

Did you find the solution? I'm stuck at the same point.


I'm stuck at the same point.

And what point is that? There are a couple issues mentioned in this thread. You are probably better off starting a new thread and giving a lot more details, rather than post "me too" to an old thread that may or may not be the same as your problem.

For the record, I've not had any issues with SoftwareSerial, and Serial1 is indeed not available for general use.

Plan D:

Use Yun Shield + Arduino Mega.

The Arduino Mega has three additional serial ports: Serial1 on pins 19 (RX) and 18 (TX), Serial2 on pins 17 (RX) and 16 (TX), Serial3 on pins 15 (RX) and 14 (TX).

In total of 4:

  1. Baking. Shirring.
  2. Broiling.
  3. Frying. Deep fat frying. Sautéing and pan-frying. Stir-Frying. Deglazing.
  4. Grilling.

Do it in half asleep half awake.