我刚买了一个 ARDUINO MICRO,它看起来被系统识别了,因为它显示在/dev/ttyS0
. 我写的草图编译没有错误,但是当我尝试上传时,我得到:
如果我按照建议按下重置按钮,在开始加载过程后,我得到
Arduino: 1.8.13 (Linux), Board: "Arduino Micro"
Sketch uses 4026 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.
An error occurred while uploading the sketch
avrdude: ser_open(): can't open device "/dev/ttyACM0": Permission denied
使用详细输出,我得到:
Arduino: 1.8.13 (Linux), Board: "Arduino Micro"
Sketch uses 4026 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.
PORTS {/dev/ttyACM0, } / {/dev/ttyACM0, } => {}
...
PORTS {/dev/ttyACM0, } / {} => {}
PORTS {} / {} => {}
...
PORTS {} / {} => {}
PORTS {} / {/dev/ttyACM0, } => {/dev/ttyACM0, }
Found upload port: /dev/ttyACM0
/home/gigiux/src/arduino/hardware/tools/avr/bin/avrdude -C/home/gigiux/src/arduino/hardware/tools/avr/etc/avrdude.conf -v -patmega32u4 -cavr109 -P/dev/ttyACM0 -b57600 -D -Uflash:w:/tmp/arduino_build_442878/pushLED.ino.ino.hex:i
avrdude: Version 6.3-20190619
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2014 Joerg Wunsch
System wide configuration file is "/home/gigiux/src/arduino/hardware/tools/avr/etc/avrdude.conf"
User configuration file is "/home/gigiux/.avrduderc"
User configuration file does not exist or is not a regular file, skipping
Using Port : /dev/ttyACM0
Using Programmer : avr109
Overriding Baud Rate : 57600
avrdude: ser_open(): can't open device "/dev/ttyACM0": Permission denied
avrdude done. Thank you.
Problem uploading to board. See http://www.arduino.cc/en/Guide/Troubleshooting#upload for suggestions.
它看起来更像是系统错误而不是电路板的问题。会有什么问题?故障排除列表没有针对此问题提供适当的解决方案,因为它没有提及拒绝访问端口...
谢谢
发生这种情况是因为您的用户帐户没有访问 USB 串行端口的权限。
您可以通过运行
sudo usermod -a -G dialout $USER
并重新启动计算机来解决此问题。之后,再次启动 Arduino IDE,再次选择端口并再次上传固件。注意:一般来说,我建议从 Ubuntu 软件安装“Arduino IDE”Snap,而不是从 Arduino 网站手动安装 Arduino IDE。快照应检查您是否具有正确的权限并说明如何解决该问题。