Skip to content
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

How do I assign port COM3 ton docker image on Windows? #553

Open
NordmeyerT opened this issue Feb 11, 2025 · 2 comments
Open

How do I assign port COM3 ton docker image on Windows? #553

NordmeyerT opened this issue Feb 11, 2025 · 2 comments

Comments

@NordmeyerT
Copy link

NordmeyerT commented Feb 11, 2025

$ docker run -it --rm --device=/dev/ttyUSB0 -v $(pwd)/esp_wifi_repeater:/home/esp/esp_wifi_repeater martinfger/iot_devel:1.0
docker: Error response from daemon: error gathering device information while adding custom device "C": not a device node.

Removing the --device option allows me to start the docker image but when flashing I get

esp@292d2c4c18bd:~/esp_wifi_repeater$ make flash
/home/esp/esp_wifi_repeater/../esp-open-sdk/xtensa-lx106-elf/bin/esptool.py --port /dev/ttyUSB0 --baud 115200 write_flash -ff 40m -fm dio -fs 32m 0x00000 firmware/0x00000.bin 0x02000 firmware/0x02000.bin
esptool.py v1.2
Traceback (most recent call last):
  File "/home/esp/esp_wifi_repeater/../esp-open-sdk/xtensa-lx106-elf/bin/esptool.py", line 1270, in <module>
    main()
  File "/home/esp/esp_wifi_repeater/../esp-open-sdk/xtensa-lx106-elf/bin/esptool.py", line 1179, in main
    esp = ESPROM(args.port, initial_baud)
  File "/home/esp/esp_wifi_repeater/../esp-open-sdk/xtensa-lx106-elf/bin/esptool.py", line 71, in __init__
    self._port = serial.serial_for_url(port)
  File "/usr/local/lib/python2.7/dist-packages/serial/__init__.py", line 90, in serial_for_url
    instance.open()
  File "/usr/local/lib/python2.7/dist-packages/serial/serialposix.py", line 325, in open
    raise SerialException(msg.errno, "could not open port {}: {}".format(self._port, msg))
serial.serialutil.SerialException: [Errno 2] could not open port /dev/ttyUSB0: [Errno 2] No such file or directory: '/dev/ttyUSB0'
Makefile:160: recipe for target 'flash' failed
make: *** [flash] Error 1

I guess I have to pass the approriate --device option but how should it look like?

@NordmeyerT
Copy link
Author

No complete solution, yet. But seems you have to attach COM3 to WSL first
Use PowerShell

usbipd bind --busid 2-3
usbipd attach --busid 2-3 --wsl

Then you can list attached ports

usbipd 

(i think I had to install usbipd first)

Makefile still contains "/dev/ttyUSB0". replaced this by "/ttyUSB0/ttyS2" as Claude says this responds to COM3 on Windows systems

now I am here

esp@28c068d7a320:~/esp_wifi_repeater$ make flash
/home/esp/esp_wifi_repeater/../esp-open-sdk/xtensa-lx106-elf/bin/esptool.py --port /dev/ttyS2 --baud 115200 write_flash -ff 40m -fm dio -fs 32m 0x00000 firmware/0x00000.bin 0x02000 firmware/0x02000.bin
esptool.py v1.2
Traceback (most recent call last):
  File "/home/esp/esp_wifi_repeater/../esp-open-sdk/xtensa-lx106-elf/bin/esptool.py", line 1270, in <module>
    main()
  File "/home/esp/esp_wifi_repeater/../esp-open-sdk/xtensa-lx106-elf/bin/esptool.py", line 1179, in main
    esp = ESPROM(args.port, initial_baud)
  File "/home/esp/esp_wifi_repeater/../esp-open-sdk/xtensa-lx106-elf/bin/esptool.py", line 71, in __init__
    self._port = serial.serial_for_url(port)
  File "/usr/local/lib/python2.7/dist-packages/serial/__init__.py", line 90, in serial_for_url
    instance.open()
  File "/usr/local/lib/python2.7/dist-packages/serial/serialposix.py", line 325, in open
    raise SerialException(msg.errno, "could not open port {}: {}".format(self._port, msg))
serial.serialutil.SerialException: [Errno 13] could not open port /dev/ttyS2: [Errno 13] Permission denied: '/dev/ttyS2'
Makefile:160: recipe for target 'flash' failed
make: *** [flash] Error 1

@hmueller01
Copy link
Contributor

Download esptool from https://github.com/espressif/esptool/releases
and flash it in Windows without docker. It didn't work for me on macOS neither.
But remember to change the -fs parameter to 4MB, or it will not work with the newer versions ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants