Two way serial communication with raspberry Pi (radio project)

The unix 'echo' command opens the port and writes to it right away.

If the arduino is connected through the serial GPIO pins this is not important.
However, if it is connected through the USB port this will cause the arduino to reset on opening AND on closing.
However you have to eliminate the rubbish arduino code first.