Yun wont start when UNO connected on Serial port

I have a yun and an uno connected using a serial connection.
But the YUN won't start when the uno is connected.
If i disconnect the uno the yun respond but when its started and i connect the uno again the yun stop responding.

I did the same thing with a mega and uno and no problem.

is there something i can do to get serial communications from my uno.
I cannot use anything else than Serial because the uno is only to prototype the yun code. and the pcb which contains a atmega328 is already finished which will be the production pcb for our product.
now we have a Mega with Ethernet SHield

Kind regards

Johan

Can you please show us ALL of the wiring connections between the two boards? This sounds like a wiring issue to me, perhaps power related. (Be aware that the rules for powering a Yun are somewhat different than most of the other Arduino boards.)

When you connect the Uno to the Yun, and the Yun stops responding, is the Uno working as expected? Or does it have issues as well?

DP0 - DP1
DP1 - DP0
GND - GND

Thats it.
If i open the serial monitor when the uno is connected i see nothing.
when i disconnect the RX at the yun site the yun (arduino site) boot. and i see my Serial.println("Setup Finished");

OK, that makes it clear. digital pins 0 and 1 on the Yun are hard-wired to the Linux processor. On the Yun, you can't use those pins for general I/O, especially serial communications. At best, there will be some contention as two different drivers (the Linux processor and the Uno) fight to drive the same signal. At worst, the serial data sent to the Yun from the Uno will be picked up by the Linux processor, where there are a couple places where the boot process will be stopped if there is incoming data ("Press any key to stop boot" situations.)

If you want to do serial communications from the Uno to the Arduino processor on the Yun, you will either have to come in on the USB port (using a USB Host shield on the Uno) or come in on some other pair of pins and use SoftwareSerial for your communications.

An alternative is to plug the USB port of the Uno into the USB host port on the Yun, and handle the Uno communications on the Linux side.

I was already affraid of that.
Although the serial monitor from the ide works perfect. so i hoped it would be the same as the uno.
The issue is that i cannot upload my program anymore when i insert the softserial. because of the really tiny amount of flash space.

i alread compressed my application so its unreadable. but yeah it fits now (i normaly work with due's)

The only thing i need is to send one int between 0 and 32 from another PCB with a ATMEGA328.
any idea how to do this an easy way because the softserial.begin takes me to 103%

jl-p:
Although the serial monitor from the ide works perfect. so i hoped it would be the same as the uno.

I'm not sure what you're saying here. It seems like you are saying that since the IDE serial monitor works the same on both boards, you are thinking that digital pins 0 and 1 should work the same?

The Uno and the Yun behave very differently as far as serial connections are concerned.

On the Uno, the Serial class talks on digital pins 0 and 1. Besides going to the shield connectors, these pins are also routed to an on-board chip that does a serial to USB conversion. The IDE serial monitor goes uses a USB connection and goes through this USB to serial converter chip, then talks to the main Arduino processor through pins 0 and 1, and on to the Serial interface object.

On the Yun, it works much like a Leonardo. There is no separate USB interface chip. Instead, the main Arduino processor is a '32U4 which has the USB interface built in. The Serial interface object talks to the IDE serial monitor over this internal USB connection, and the shield connector pins 0 and 1 are not affected. Instead, these two pins are connected to the Linux processor, and can be accessed using Serial1 (not the "1" on the end) or by the Bridge library (which talks through Serial1.)

So both board can talk to the IDE serial monitor using the Serial interface object, but the way that happens behind the scenes is very different.

Does all of this explain it better, or does it just cause confusion? Or do I not understand what you are trying to say?

The issue is that i cannot upload my program anymore when i insert the softserial. because of the really tiny amount of flash space.

Yes, that can definitely be an issue.

jl-p:
The only thing i need is to send one int between 0 and 32 from another PCB with a ATMEGA328.
any idea how to do this an easy way because the softserial.begin takes me to 103%

If I understand you right, the Uno is sending the value (single integer from 0 to 32) to the Yun, and when you use SoftwareSerial to try and read that directly into the sketch running on the Yun, you run out of memory. Is that right?

Since it's such a limited amount of data, it might be reasonable to do the communications on the Linux side. It's a bit convoluted, but maybe not that complicated. Plug a USB cable between the Uno and the Yun's host port (the large vertical Type A connector.) It will show up on the Linux side as a /dev/tty*** port. Write a small Python script to open the serial port (will need the PySerial library) and read the value from the serial port. When you get the value, use the Bridge to put() that value so that the sketch can call Bridge.read() to read the value into the sketch.

If it's the other way around, and the Yun needs to send the value to the Uno, it's pretty much the same idea, except that the sketch calls Bridge.put() to send the value to the Linux side, and the Python script reads the value from the Bridge with get() and then sends it out the tty port to the Uno.

The Yun is very powerful, but it does some things a bit different and sometimes requires a different way of thinking about the problem. With all other Arduino's, the sketch is the center of the universe and does everything, but with the Yun you have a second processor that gives you some powerful additional abilities (although it sometimes gets complicated.)

The Communication between the 32U4 and linux is so slow that i cannot slow it more down.

I now send one command like GD from the website to the 32U4 and have to wait 30 seconds to receive d2=0;d3=1;d4=1;d5=0;d6=1@

so thats no option.
We almost decided to stop the production of our new product because of this performance. although the customers don't care i pulling my hears out every demo i have to give.

so i'm gonna try to get the softserial inplace

Why this won't work.

#include <SoftwareSerial.h>

SoftwareSerial mySerial(2, 3); // RX, TX

void setup()  
{   Serial.begin(115200);
   mySerial.begin(115200);
   delay(3000);
   Serial.println("Start Loop");
}

void loop() 
{  if (mySerial.available())
    Serial.write(mySerial.read());
}

jl-p:
I now send one command like GD from the website to the 32U4 and have to wait 30 seconds to receive d2=0;d3=1;d4=1;d5=0;d6=1@

so thats no option.

That doesn't sound right. While it's not blazing fast, 30 seconds sounds much slower than what I and others have been seeing. Perhaps there's something else going on that is slowing it down for you?

so i'm gonna try to get the softserial inplace

Why this won't work.

You're using pin 3 to receive. The Yun's processor is the same as the Leonardo, so the same limitations come into play. From the limitations section of the Software Serial Reference page:

Not all pins on the Leonardo and Micro support change interrupts, so only the following can be used for RX: 8, 9, 10, 11, 14 (MISO), 15 (SCK), 16 (MOSI).

Okay thx i will try pin 8 and 9
And okay the 30 seconds was not 30 after measuring it. it was 17. but stil much slower then an arduino with ethernet.

Yes it works finaly.
I had to rebuild the softserial so there is no send code in it. but i now have 2 bytes left.

thx

17 seconds is an eternity. It really shouldn't be that slow.

How are you sending that command? Are you using http://arduino.local/adruino/... and trying to catch it with a YunServer/YunClient? If so, what else is your sketch doing? Is it spending a long time doing something before it gets around to calling YunServer.accept()?