Skip to content

Bug: Arduino IDE 1.8.5 Linux is not working with the Arduino Micro #7690

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jtdaling opened this issue Jun 13, 2018 · 24 comments
Closed

Bug: Arduino IDE 1.8.5 Linux is not working with the Arduino Micro #7690

jtdaling opened this issue Jun 13, 2018 · 24 comments
Labels
Component: Avrdude 6.3 Specific to AVRDUDE version 6.3 Component: Uploading Uploading programs to an Arduino board Waiting for feedback More information must be provided before we can proceed

Comments

@jtdaling
Copy link

Hello, I would like to report a bug.
I installed Arduino IDE (version 1.8.5) on a Manjaro Linux distro.
When I tried to upload a sketch I received the warning:
avrdude: Expected signature for ATmega32U4 is 1E 95 87

I was sure to have selected the right arduino board, port and I had sufficient rights to use the port.
I installed the same version (1.8.5) on a windows computer and uploaded the same script with the same settings and on Windows it worked.

I tried out some different versions of Arduino IDE and discovered that version 1.6.2 was the latest version that was able to upload sketches under Linux

@per1234
Copy link
Collaborator

per1234 commented Jun 13, 2018

Please do this:

  1. File > Preferences > Show verbose output during: > compilation (uncheck) > upload (check) > OK
  2. Sketch > Upload
  3. After the upload fails you'll see a button on the right side of the orange bar "Copy error messages". Click that button.
  4. Paste the error messages in a reply here using code fencing.

@per1234 per1234 added the Component: Uploading Uploading programs to an Arduino board label Jun 13, 2018
@jtdaling
Copy link
Author

jtdaling commented Jun 13, 2018

Here is the error message:

Arduino: 1.8.5 (Linux), Board: "Arduino/Genuino Micro"

Sketch uses 4130 bytes (14%) of program storage space. Maximum is 28672 bytes.
Global variables use 149 bytes (5%) of dynamic memory, leaving 2411 bytes for local variables. Maximum is 2560 bytes.
Forcing reset using 1200bps open/close on port /dev/ttyACM1
PORTS {/dev/ttyACM1, } / {} => {}
PORTS {} / {} => {}
PORTS {} / {/dev/ttyACM1, } => {/dev/ttyACM1, }
Found upload port: /dev/ttyACM1
/home/jantinus/.arduino15/packages/arduino/tools/avrdude/6.3.0-arduino9/bin/avrdude -C/home/jantinus/.arduino15/packages/arduino/tools/avrdude/6.3.0-arduino9/etc/avrdude.conf -v -patmega32u4 -cavr109 -P/dev/ttyACM1 -b57600 -D -Uflash:w:/tmp/arduino_build_93539/Blink.ino.hex:i 

avrdude: Version 6.3, compiled on Jan 17 2017 at 11:00:16
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2014 Joerg Wunsch

         System wide configuration file is "/home/jantinus/.arduino15/packages/arduino/tools/avrdude/6.3.0-arduino9/etc/avrdude.conf"
         User configuration file is "/home/jantinus/.avrduderc"
         User configuration file does not exist or is not a regular file, skipping

         Using Port                    : /dev/ttyACM1
         Using Programmer              : avr109
         Overriding Baud Rate          : 57600
         AVR Part                      : ATmega32U4
         Chip Erase delay              : 9000 us
         PAGEL                         : PD7
         BS2                           : PA0
         RESET disposition             : dedicated
         RETRY pulse                   : SCK
         serial program mode           : yes
         parallel program mode         : yes
         Timeout                       : 200
         StabDelay                     : 100
         CmdexeDelay                   : 25
         SyncLoops                     : 32
         ByteDelay                     : 0
         PollIndex                     : 3
         PollValue                     : 0x53
         Memory Detail                 :

                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           eeprom        65    20     4    0 no       1024    4      0  9000  9000 0x00 0x00
           flash         65     6   128    0 yes     32768  128    256  4500  4500 0x00 0x00
           lfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           hfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           efuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           lock           0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           calibration    0     0     0    0 no          1    0      0     0     0 0x00 0x00
           signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00

         Programmer Type : butterfly
         Description     : Atmel AppNote AVR109 Boot Loader

Connecting to programmer: .
Found programmer: Id = "CATERIN"; type = S
    Software Version = 1.0; No Hardware Version given.
Programmer supports auto addr increment.
Programmer supports buffered memory access with buffersize=128 bytes.

Programmer supports the following devices:
    Device code: 0x44

avrdude: devcode selected: 0x44
avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.19s

avrdude: Device signature = 0x433f0d
avrdude: Expected signature for ATmega32U4 is 1E 95 87
         Double check chip, or use -F to override this check.
avrdude: error: programmer did not respond to command: leave prog mode
avrdude: error: programmer did not respond to command: exit bootloader

avrdude done.  Thank you.

the selected serial port 
 does not exist or your board is not connected
Invalid library found in /home/jantinus/Arduino/libraries/sketch_jun13a: /home/jantinus/Arduino/libraries/sketch_jun13a
Invalid library found in /home/jantinus/Arduino/libraries/sketch_jun13a: /home/jantinus/Arduino/libraries/sketch_jun13a

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

@facchinm facchinm added the Component: Avrdude 6.3 Specific to AVRDUDE version 6.3 label Jun 14, 2018
@facchinm
Copy link
Member

@jtdaling I've never seen something like this; I'm on Arch so the distro is 99% the same. Is there a chance that your bootloader is not the default one? If so, you could try a couple of things:

  • try the Beta, which contains an updated avrdude (based on master branch)
  • test using avrdude shipped with your distro (pacman -S avrdude will work); double click the reset button on the board and the LED should start fading; then run
avrdude -v -patmega32u4 -cavr109 -P/dev/ttyACM1 -b57600 -D -Uflash:w:Blink.ino.hex:i 

Let me know if any of those strategies work!

@facchinm facchinm added the Waiting for feedback More information must be provided before we can proceed label Jun 14, 2018
@nseidle
Copy link

nseidle commented Jun 14, 2018

This may or may not be related but in the last ~20 hours we've seen micro support break in Windows and Mac (reported but not confirmed).

We can't tell if it's a windows update (not likely since Linux and Mac are reporting similar issue), Java update (we've reverted all the way back to 7 without fix), or something with Arduino (we've tried back to v1.6.x). We are currently dumbfounded, but are starting to hear from customers.

Turning on verbose, the port is correctly found, but Arduino just hangs at the port.

image

Programming freezes at this point for ~30 seconds. After 8 seconds the Pro Micro exits the bootloader and starts running code. The bootloader COM port (7 in this example) is closed. After 30 seconds avrdude then tries to run and since COM 7 no longer exists, it fails.

If I replicate the avrdude command at CLI it works flawlessly (once I force the Pro Micro into bootloader mode by double-tapping the reset).

May be related: I am seeing the Tools->Ports menu lag behind Windows Device Manager by 20 to 30 seconds. It seems the Arduino IDE can't see the port but avrdude and Windows can.

@PaulStoffregen
Copy link
Contributor

Is this Linux? I see lots of talk of COM ports...

@nseidle
Copy link

nseidle commented Jun 14, 2018

Sorry if I'm conflating issues but it seems related: My screenshot is from my Windows box. We have multiple windows users and a Mac user reporting the same behavior (failed/timeout at point of avrdude call) as jtdaling (serial port does not exist).

@gdsports
Copy link

I noticed the IDE accesses api-builder.arduino.cc on startup (thank you wireshark) so I blocked access to this host. I added an entry to /etc/hosts like this to blacklist the host.

127.0.0.1 api-builder.arduino.cc

Now the IDE starts up with the serial ports listed immediately without having to disconnect the network cable.

Perhaps something has changed on api-builder.arduino.cc.

Lots of discussion at forum.arduino.cc. JP2222 at the forum discovered disconnecting the network cable makes the serial problem go away.

https://forum.arduino.cc/index.php?topic=553078.0

@ghost
Copy link

ghost commented Jun 14, 2018

After considerable time spent trying to figure out the problem which showed up late yesterday, I too have found that switching off the wireless adapter in my Windows 7 laptop eliminates the serial problem. I encountered the problem with Arduino 1.8.5 and 1.8.2, using two different computers, seven different USB ports between the two, and 8 ProMicro boards. None of the permutations previously evaluated worked. On advice from SparkFun tech support, I tried Arduino 1.6.3, which worked correctly even with wireless network access available. With wireless network access switched off, I am able to use Arduino 1.8.5 without any serial problems. Anyone know how to tell 1.8.5 to quit talking on the internet without permission?

@NPoole
Copy link

NPoole commented Jun 14, 2018

As suggested by gdsports above, adding "127.0.0.1 api-builder.arduino.cc" to your Windows\System32\drivers\etc\hosts file will prevent anything on your machine from talking to that particular domain and it's a good fix for now. (I'm running 1.8.5 on Win10)

An "Application Rule" for Windows Defender Firewall may also work to block the IDE from calling the web. I haven't tested though.

@facchinm
Copy link
Member

Hi everyone, let's stop the confusion a bit:

  • the first reported issue is strictly about avrdude on Linux (or a board with old bootloader). @jtdaling setup is perfectly able to open the port after restarting in bootloader mode but fails to read the chip signature.
  • The issue reported by @nseidle is about the IDE not being able to properly open the port after it restarted in bootloader mode; it might be related with api-builder.arduino.cc issue (if the bootloader VID/PID is not listed in the IDE).

Now the third problem, that ABSOLUTELY needs a discussion on its own: interrogating our cloud backend to get the board name based on VID/PID.

That API endpoint suffered recently from a lot of problems that made it respond REALLY slowly and (my fault) we don't implement any timeout when calling getBoardWithMatchingVidPidFromCloud() (see

platform.getBoardWithMatchingVidPidFromCloud(parts[1], parts[2]);
and
public synchronized void getBoardWithMatchingVidPidFromCloud(String vid, String pid) {
for the implementation).

Also, there is not a real opt-out procedure, leaving the blacklist using etc/hosts the only feasible way to get rid of it. #7575 might be related as well so maybe we could use that issue to follow.
In the meantime, the api endpoint has been fixed but it would be important to define an opt-out strategy (via Preferences menu or configuration key).

@jtdaling
Copy link
Author

I can confirm that the solution that rmadsen61 suggested, also works for Linux (Arch).
I switched my wireless adapter off and was able to upload scripts without any problems and without having to force the micro into bootloader mode.
After the upload the connection over the serial port was immediately established and started to receive data send by the Arduino.

@kshestov
Copy link

I have this problem with IDE 1.8.5 on Arch too

@l0ud
Copy link

l0ud commented May 7, 2019

I know the issue is pretty old, but it still happens on Arch and possibly other linux distros.
For me the problem was ModemManager, which was talking to ttyACM0 device (arduino) thinking it's some sort of USB modem. The simplest solution is to remove "modemmanager" from distro package manager.

@bjett80
Copy link

bjett80 commented Jun 8, 2019

10ud .... you just brought 2 days of frustration to an end !
Changing udev rules didn't seem to work on Ubuntu 18.10 but removing modemmanager fixed all my problems. My Pro Micro is now uploading sketches without issue.
Thanks !

@matthijskooijman
Copy link
Collaborator

Note that some issues with modemmanager might have recently (in the last two years) surfaced or resurfaced by changes in modemmanager's probe policy. For a fix in the Arduino side for this, see arduino/ArduinoCore-avr#92.

@jonmacd
Copy link

jonmacd commented Jun 12, 2019

I know the issue is pretty old, but it still happens on Arch and possibly other linux distros.
For me the problem was ModemManager, which was talking to ttyACM0 device (arduino) thinking it's some sort of USB modem. The simplest solution is to remove "modemmanager" from distro package manager.

Thank you. This solved it for me as well running Manjaro.
sudo pacman -R modemmanager
Code is uploading like normal now.

I imagine disabling the modemmanager service would resolve things as well:
systemctl disable modemmanager.service
I don't need though so I just removed it.

@JazzTp
Copy link

JazzTp commented Jun 16, 2019

I know the issue is pretty old, but it still happens on Arch and possibly other linux distros.
For me the problem was ModemManager, which was talking to ttyACM0 device (arduino) thinking it's some sort of USB modem. The simplest solution is to remove "modemmanager" from distro package manager.

THANKS! That solved the same problem with Arduino IDE 1.8.9 on Ubuntu 18.04.2 (with Arduino Leonardo R3).

@facchinm
Copy link
Member

Should be fixed now, please reopen if needed

@leobel96
Copy link

Same issue with actual version of Arduino Web Editor. Removing modemmanager resolved the problem.

Should be fixed now, please reopen if needed

@AshiqMehmood
Copy link

AshiqMehmood commented Nov 4, 2019

@l0ud Thanks for suggesting this method !! i am using debian10 and had the same problem of uploading the sketch to Pro-micro. Try not to remove the package. you can disable it.

@andreiva
Copy link

Holy ******! This saved me a lot of frustration.
After uploading any sketch to a pro micro (Leonardo) the board would become unresponsive, and the only way to bring it back is to burn the bootloader.

After removing modemmanager, all works fine like before :)
Arduino IDE 1.8.10
Linux Mint 19.2

@erikjber
Copy link

10ud .... you just brought 2 days of frustration to an end !
Changing udev rules didn't seem to work on Ubuntu 18.10 but removing modemmanager fixed all my problems. My Pro Micro is now uploading sketches without issue.
Thanks !

Awesome! Uninstalling modemmanager from Xubuntu 19.10 solved the issue for me as well. Thank you.

@andymanning
Copy link

I was struggling with getting it all to work on Linux (PopOS) but I found that In the latest version of the Linux download package (1.8.12), there's a script called arduino-linux-setup.sh . I ran that and it automatically set up the system and the IDE then just worked!

@delphir-com
Copy link

sudo apt remove modemmanager helped on Ubuntu 18.04

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Avrdude 6.3 Specific to AVRDUDE version 6.3 Component: Uploading Uploading programs to an Arduino board Waiting for feedback More information must be provided before we can proceed
Projects
None yet
Development

No branches or pull requests