/dev/ttyACM0 in Linux not reliable / can't direct output to it from shell

I'm trying to figure out if I need to do the firmware update or not and whether or not the firmware update will address my issue.

The core issue is that I have a script that sends three digits to the Arduino, no carriage return, nothing else. The Arduino then reads each character from the serial buffer and then performs actions based on the value. This part of the code works. I have tested it in a Windows VM using the Serial Monitor and it works as designed. If I open up minicom on the Linux side, it too works as designed.

If I try to echo "123" > /dev/ttyACM0, the Arduino resets. I've done a lot of research on it already and know if I hold the serial port open with "tail -f /dev/ttyACM0", it prevents the reset. I was able to momentarily get it to work using stty however the settings do not seem to be permanent and quickly reset to a nonworking state. I checked the firmware version in a Windows VM and it shows "revision 0001" according to the DFU programming page at "http://arduino.cc/en/Hacking/DFUProgramming8U2".

I'm using an Arduino Uno R2 on an Ubuntu 10.04.3 LTS "lucid" computer. According to the page, I'm supposedly running with the latest 8U2 firmware however this issue sounds a lot like the older version of the 8U2 firmware and the issue conflicts with the version information on the DFU programming page.

I would greatly appreciate any assistance with getting this working. Please feel free to ask any questions that may help get to a resolution.

Thank you.

If I try to echo "123" > /dev/ttyACM0, the Arduino resets.

Because opening the serial port resets the Arduino. There are ways to prevent this. http://www.arduino.cc/playground/Main/DisablingAutoResetOnSerialConnection

Hello Paul:

This isn't about the Arduino resetting. As stated in the original post, I have a workaround for that.

The issue is that the /dev/ttyACM0 device will work for a few minutes then stop working altogether. It's almost like something is in the background killing/modifying the serial parameters.

As a sidenote, the machine does the same thing with an Xbee transceiver pair connected to the Arduino.

Firestorm,

I have the same problem. I have a program that reads 4 digital pins and simply prints corresponding numbers on Serial. The moment one of my input pins change state, Arduino mysteriously shifts from /dev/ttyACM0 to /dev/ttyACM1. Back to ACM0 for another change.

Were you able to find the cause?

Thanks