SparkFun Forums 

Where electronics enthusiasts find answers.

For the discussion of Arduino related topics.
By lugnut
#196190
Here's a long story about troubles uploading a sketch to Sparkfun Pro Micro.

I'm using an Arch Linux based distro with Arduino IDE for the first time. Installation went smooth, but the sketch would not upload. Many errors about missing serial ports or port permissions and other errors. The /dev/ttyACM0 port would appear after a double reset click, then disappear in a few seconds. Trying to upload in this window of time did not work. More errors about port permissions, port busy, etc.
sudo arduino did not help
I added my user to the uucp group to get access to ttyACM0. That changed things, but still no upload.

After a few hours of web search and trials, this looked interesting:
http://starter-kit.nettigo.eu/2015/seri ... nardo-eth/

Many Linux distros use systemctl for init and include something called ModemManager. ModemManager thinks any new serial port is a modem and checks it for network access. It grabs the port faster than arduino IDE can upload. The port is always busy when arduino IDE tries. Avrdude crashes or hangs as a result.

Step 1
sudo systemctl stop ModemManager This stopped the service. Suddenly arduino IDE started uploading. ttyACM0 stopped disappearing. It's a temporary fix since ModemManager will start at next PC boot.
Step 2
Thanks to the link above, a udev rule can be written to stop this port grabbing behavior.
Create a file with root permission in /etc/udev/rules.d Let's call it 99-arduino.rules Specify VID numbers for ModemManager to ignore. I put this text in the file:
# for arduino brand, stop ModemManager grabbing port
ATTRS{idVendor}=="2a03", ENV{ID_MM_DEVICE_IGNORE}="1"
# for sparkfun brand, stop ModemManager grabbing port
ATTRS{idVendor}=="1b4f", ENV{ID_MM_DEVICE_IGNORE}="1"

Save the rules file (as root) and reboot the PC. Arduino IDE then works great with the Pro Micro.

Your system might be different, be careful. A distro with SysVinit probably won't see this issue. I hope this long story helps someone with Linux and sketch upload issues.

Regards,
Bob U.
long long title how many chars? lets see 123 ok more? yes 60

We have created lots of YouTube videos just so you can achieve [...]

Another post test yes yes yes or no, maybe ni? :-/

The best flat phpBB theme around. Period. Fine craftmanship and [...]

Do you need a super MOD? Well here it is. chew on this

All you need is right here. Content tag, SEO, listing, Pizza and spaghetti [...]

Lasagna on me this time ok? I got plenty of cash

this should be fantastic. but what about links,images, bbcodes etc etc? [...]