【问题标题】:Arduino Pro Micro not uploading any code (avrdude: ser_open(): can't open device "/dev/ttyACM0": Permission denied)Arduino Pro Micro 没有上传任何代码(avrdude: ser_open(): can't open device "/dev/ttyACM0": Permission denied)
【发布时间】:2021-05-10 06:51:06
【问题描述】:

我尝试上传任何类型的草图(包括裸骨草图),但没有任何效果。其他人说这个错误是由于端口权限不足引起的,所以我按照其他几个人和 arduino 网站(适用于 linux)的建议做了。

Sketch uses 3462 bytes (12%) 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/ttyACM0
PORTS {/dev/ttyACM0, /dev/ttyS4, } / {/dev/ttyACM0, /dev/ttyS4, } => {}
PORTS {/dev/ttyACM0, /dev/ttyS4, } / {/dev/ttyS4, } => {}
PORTS {/dev/ttyS4, } / {/dev/ttyACM0, /dev/ttyS4, } => {/dev/ttyACM0, }
Found upload port: /dev/ttyACM0
/home/kalin/Downloads/arduino-1.8.13/hardware/tools/avr/bin/avrdude -C/home/kalin/Downloads/arduino-1.8.13/hardware/tools/avr/etc/avrdude.conf -v -patmega32u4 -cavr109 -P/dev/ttyACM0 -b57600 -D -Uflash:w:/tmp/arduino_build_767551/sketch_feb05a.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/kalin/Downloads/arduino-1.8.13/hardware/tools/avr/etc/avrdude.conf"
         User configuration file is "/home/kalin/.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.

来自documentation

打开终端并输入:

ls -l /dev/ttyACM* 你会得到类似的东西:

crw-rw---- 1 root dialout 188, 0 5 apr 23.01 ttyACM0 The "0" at the ACM 的结尾可能是不同的数字,或者可能是多个条目 回来。我们需要的数据是“拨出”(是 文件)。

现在我们只需要将我们的用户添加到组中:

sudo usermod -a -G dialout $USER 然后:

sudo chmod a+rw /dev/ttyACM0 你需要退出并重新登录 使此更改生效。

但是每次我启动 arduino 时,权限都会被清除回原来的状态。如果我将 arduino 作为 sudo 运行,它可以工作,但我显然不需要这样做。

【问题讨论】:

    标签: arduino


    【解决方案1】:

    我没有足够的经验知道要为 arduino 使用什么程序员,但问题是我使用的是“AVR ISP”,但是当我切换到“ArduinoISP”时,一切都完美地上传了。无需更改任何权限。

    【讨论】:

    • 这没有意义。如果您不使用“使用编程器上传”的硬件编程器,则编程器选择没有用。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2015-03-07
    • 1970-01-01
    • 2013-11-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多