I have an Arduino Uno connected through USB to my Ubuntu PC (one USB hub in between).
I run a program that communicate through serial and use then the port /dev/ttyACM0
It works well though not stable, the Arduino, every now and then, suddenly change to \dev\ttyACM1
, making the code crash. I can change the port in my code and restart. It will then run well until the Arduino decides to go back to /dev/ttyACM0
.
I can't figure out the reason, and even less the solution. Would there be any help here?
\dev\ttyACM1
is a typo? and yes "udev" is the way to do this. Here is an example creating a softlink; http://playground.arduino.cc/Linux/Udev – Rinzwind Jun 24 '16 at 07:20\dev\ttyACM1
was a typo. I tried udev, it solved half of the problem. It does not change port anymore because it is always on the created Symlink. Well, it appeared that if the Arduino is always changing port it is because there is an underlying issue that makes it disconnect. This is what needed to be tackled. In my case, a view todmesg | grep usb
indicated me that the USB hub was ending the connection to Arduino, then reconnecting it. Further debug made me found out that my relays (what my arduino pilots) are firing back some EMI. I need now to take care of that. – Memes Jun 27 '16 at 02:04