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