gpt4 book ai didi

Arduino Pro Micro 未上传任何代码(avrdude : ser_open(): can't open device "/dev/ttyACM0": Permission denied)

转载 作者:行者123 更新时间:2023-12-05 06:05:15 26 4
gpt4 key购买 nike

我尝试上传任何类型的草图(包括最基本的草图),但没有任何效果。其他人说这个错误是由于端口权限不足引起的,所以我按照其他几个人和 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 :

Open Terminal and type:

ls -l /dev/ttyACM* you will get something like:

crw-rw---- 1 root dialout 188, 0 5 apr 23.01 ttyACM0 The "0" at theend of ACM might be a different number, or multiple entries might bereturned. The data we need is "dialout" (is the group owner of thefile).

Now we just need to add our user to the group:

sudo usermod -a -G dialout $USER then:

sudo chmod a+rw /dev/ttyACM0 You will need to log out and log in againfor this change to take effect.

然而,每次我启动 arduino 时,权限都会被清除回原来的状态。如果我以 sudo 的方式运行 arduino,它会起作用,但我显然不需要这样做。

最佳答案

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

关于Arduino Pro Micro 未上传任何代码(avrdude : ser_open(): can't open device "/dev/ttyACM0": Permission denied),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66071580/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com