widora-AIR esp32 make flash download failed



  • hank@pc:~/espressif/myapp$ ls /dev/ttyUSB0
    /dev/ttyUSB0
    hank@pc:~/espressif/myapp$ make flash
    Flashing binaries to serial port /dev/ttyUSB0 (app at offset 0x10000)...
    esptool.py v2.0-beta1
    Traceback (most recent call last):
    File "/home/hank/espressif/esp-idf/components/esptool_py/esptool/esptool.py", line 2261, in <module>
    main()
    File "/home/hank/espressif/esp-idf/components/esptool_py/esptool/esptool.py", line 2037, in main
    esp = chip_class(args.port, initial_baud)
    File "/home/hank/espressif/esp-idf/components/esptool_py/esptool/esptool.py", line 166, in init
    self._port = serial.serial_for_url(port)
    File "/usr/lib/python2.7/dist-packages/serial/init.py", line 78, in serial_for_url
    instance.open()
    File "/usr/lib/python2.7/dist-packages/serial/serialposix.py", line 278, in open
    raise SerialException("could not open port %s: %s" % (self._port, msg))
    serial.serialutil.SerialException: could not open port /dev/ttyUSB0: [Errno 13] Permission denied: '/dev/ttyUSB0'
    make: *** [flash] 错误 1
    hank@fanhang:~/espressif/myapp$ sudo chmod 777 /dev/ttyUSB0
    [sudo] password for hank:
    hank@fanhang:~/espressif/myapp$ make flash
    Flashing binaries to serial port /dev/ttyUSB0 (app at offset 0x10000)...
    esptool.py v2.0-beta1
    Traceback (most recent call last):
    File "/home/hank/espressif/esp-idf/components/esptool_py/esptool/esptool.py", line 2261, in <module>
    main()
    File "/home/hank/espressif/esp-idf/components/esptool_py/esptool/esptool.py", line 2037, in main
    esp = chip_class(args.port, initial_baud)
    File "/home/hank/espressif/esp-idf/components/esptool_py/esptool/esptool.py", line 166, in init
    self._port = serial.serial_for_url(port)
    File "/usr/lib/python2.7/dist-packages/serial/init.py", line 78, in serial_for_url
    instance.open()
    File "/usr/lib/python2.7/dist-packages/serial/serialposix.py", line 278, in open
    raise SerialException("could not open port %s: %s" % (self._port, msg))
    serial.serialutil.SerialException: could not open port /dev/ttyUSB0: [Errno 5] Input/output error: '/dev/ttyUSB0'
    make: *** [flash] 错误 1

    刚买的esp32板子,一直没下载成功,这个错误谁遇到过?求大神知道!!!


  • administrators

    检查你的USB口


  • administrators

    尝试使用minicom是否可以打开对应的串口?如果打不开,检查外部硬件连接或者驱动的问题



  • make flash 需要有root才可以,因为需要对ttyUSB0进行写入操作,普通用户没有这个权限。所以还有一个另外的解决方案就是chmod 777 /dev/ttyUSB0 这样就不需要root权限了。



  • 对的,就是这样。