-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Add esptool --port-filter SN filter. (ESPTOOL-950) #1027
Comments
Hello @cederom, thanks for the suggestion, this sounds reasonable. I will take a look at it and try to implement the feature as soon as possible. Not sure if you are aware of it, but on linux machines you can make alias for each USB port which will stay the same. It is not the solution how to distinguish each esp chip, but as long as you connect chip into the same port, this works. Nevertheless I will take a look at it. |
Thank you @Dzarda7 :-) I am working on FreeBSD :-) Sure various OS have options to manage USB devices on attach (i.e. devd/devfs). But having option straight in the esptool is the most universal solution and requires no system modification (i.e. this can be dynamically created VM). You can use underlying pyserial functionalities :-) |
BIG THANK YOU @Dzarda7 !! :-) |
Do you know when it will land in a release and the time of release? We will update the system package :-) |
Will let you know tomorrow. |
We are not sure when the next release will happen, but we can make dev release if this is important for you, just let me know. |
Esptool v4.9.dev1 will be released tomorrow, but won't be part of the esp-idf yet, if you are interested, you can update the version in esp-idf by yourself as stated in the documentation. |
Thank you @Dzarda7 this is perfectly fine we only need esptool package on FreeBSD :-) BIG THANK YOU!! :-) |
Esptool v4.9.dev1 was released. |
We do not have enough features for the release and we do not do dev releases on github. If you are looking for the built binaries, you can find them for example here. |
Okay, good idea to test before a release, that port filter does not work for me, and I need to build most of the pip packages as binary packages are usally not provided for FreeBSD :-)
|
If the port filter depends on pyserial I saw recenlty an update that extends the pyserial-ports verbose output. If you can provide your output or what is expected we will update pyserial so it works on FreeBSD too and provide necessary information for esptool port filter :-) |
Thanks for noticing this and great report. I tried it on my system and it works great as you can see below: (venv) ➜ esptool_test_freebsd pyserial-ports --verbose
/dev/ttyUSB0
desc: CP2102N USB to UART Bridge Controller
hwid: USB VID:PID=10C4:EA60 SER=7c98d1065267ee11bcc4c8ab93cd958c LOCATION=3-6.1.7
(venv) ➜ esptool_test_freebsd esptool.py --port-filter serial=7c98d1065267ee11bcc4c8ab93cd958c flash_id
esptool.py v4.9.dev1
Found 1 serial ports
Serial port /dev/ttyUSB0
Connecting.....
Detecting chip type... Unsupported detection protocol, switching and trying again...
Connecting....
Detecting chip type... ESP32
Chip is ESP32-D0WD-V3 (revision v3.1)
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
Crystal is 40MHz
MAC: 10:06:1c:98:2e:e0
Uploading stub...
Running stub...
Stub running...
Manufacturer: c8
Device: 4017
Detected flash size: 8MB
Flash voltage set by a strapping pin to 3.3V
Hard resetting via RTS pin...
(venv) ➜ esptool_test_freebsd esptool.py --port-filter serial=7c98d1065267ee11bcc4c8ab93cd958d flash_id
esptool.py v4.9.dev1
Found 0 serial ports
A fatal error occurred: Could not connect to an Espressif device on any of the 0 available serial ports.
I also tried it in docker with your version of python (3.9) using root@e8ff0c799bc6:/# pyserial-ports --verbose
/dev/ttyUSB0
desc: CP2102N USB to UART Bridge Controller
hwid: USB VID:PID=10C4:EA60 SER=7c98d1065267ee11bcc4c8ab93cd958c LOCATION=3-6.1.7
root@e8ff0c799bc6:/# esptool.py --port-filter serial=7c98d1065267ee11bcc4c8ab93cd958c flash_id
esptool.py v4.9.dev1
Found 1 serial ports
Serial port /dev/ttyUSB0
Connecting.....
Detecting chip type... Unsupported detection protocol, switching and trying again...
Connecting....
Detecting chip type... ESP32
Chip is ESP32-D0WD-V3 (revision v3.1)
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
Crystal is 40MHz
MAC: 10:06:1c:98:2e:e0
Uploading stub...
Running stub...
Stub running...
Manufacturer: c8
Device: 4017
Detected flash size: 8MB
Flash voltage set by a strapping pin to 3.3V
Hard resetting via RTS pin...
root@e8ff0c799bc6:/# esptool.py --port-filter serial=7c98d1065267ee11bcc4c8ab93cd958d flash_id
esptool.py v4.9.dev1
Found 0 serial ports
A fatal error occurred: Could not connect to an Espressif device on any of the 0 available serial ports. Yes, port filter depends on pyserial. As you already noticed, problem seems to be the pyserial that does not see port information. I am not really sure, what you mean by updating pyserial as version 3.5 is required by esptool: esptool_test_freebsd pip show pyserial
Name: pyserial
Version: 3.5
Summary: Python Serial Port Extension
Home-page: https://github.com/pyserial/pyserial
Author: Chris Liechti
Author-email: [email protected]
License: BSD
Location: /home/jarda/Documents/Espressif/esptool_test_freebsd/venv/lib64/python3.13/site-packages
Requires:
Required-by: esptool |
Thank you @Dzarda7 :-) Can you please double check on your Linux with two different devkits attached in different order and use port filter to one connected to /dev/ttyUSB1? If that works for you on Linux that means we need to patch pyserial to work properly on FreeBSD :-) |
ESP32H2 - /dev/ttyUSB0, ESP32 - /dev/ttyUSB1: (venv) ➜ esptool_test_freebsd pyserial-ports --verbose
/dev/ttyUSB0
desc: CP2102N USB to UART Bridge Controller
hwid: USB VID:PID=10C4:EA60 SER=14fefc9fe665ee119c09926293cd958c LOCATION=3-6.1.5
/dev/ttyUSB1
desc: CP2102N USB to UART Bridge Controller
hwid: USB VID:PID=10C4:EA60 SER=7c98d1065267ee11bcc4c8ab93cd958c LOCATION=3-6.1.7
(venv) ➜ esptool_test_freebsd esptool.py --port-filter serial=14fefc9fe665ee119c09926293cd958c flash_id
esptool.py v4.9.dev1
Found 1 serial ports
Serial port /dev/ttyUSB0
Connecting.....
Detecting chip type... ESP32-H2
Chip is ESP32-H2 (revision v0.1)
Features: BLE, IEEE802.15.4
Crystal is 32MHz
MAC: 74:4d:bd:ff:fe:63:37:06
BASE MAC: 74:4d:bd:63:37:06
MAC_EXT: ff:fe
Uploading stub...
Running stub...
Stub running...
Manufacturer: c8
Device: 4016
Detected flash size: 4MB
Hard resetting via RTS pin...
(venv) ➜ esptool_test_freebsd esptool.py --port-filter serial=7c98d1065267ee11bcc4c8ab93cd958c flash_id
esptool.py v4.9.dev1
Found 1 serial ports
Serial port /dev/ttyUSB1
Connecting.......
Detecting chip type... Unsupported detection protocol, switching and trying again...
Connecting.....
Detecting chip type... ESP32
Chip is ESP32-D0WD-V3 (revision v3.1)
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
Crystal is 40MHz
MAC: 10:06:1c:98:2e:e0
Uploading stub...
Running stub...
Stub running...
Manufacturer: c8
Device: 4017
Detected flash size: 8MB
Flash voltage set by a strapping pin to 3.3V
Hard resetting via RTS pin... ESP32H2 - /dev/ttyUSB0, ESP32 - /dev/ttyUSB1: (venv) ➜ esptool_test_freebsd pyserial-ports --verbose
/dev/ttyUSB0
desc: CP2102N USB to UART Bridge Controller
hwid: USB VID:PID=10C4:EA60 SER=7c98d1065267ee11bcc4c8ab93cd958c LOCATION=3-6.1.7
/dev/ttyUSB1
desc: CP2102N USB to UART Bridge Controller
hwid: USB VID:PID=10C4:EA60 SER=14fefc9fe665ee119c09926293cd958c LOCATION=3-6.1.5
(venv) ➜ esptool_test_freebsd esptool.py --port-filter serial=14fefc9fe665ee119c09926293cd958c flash_id
esptool.py v4.9.dev1
Found 1 serial ports
Serial port /dev/ttyUSB1
Connecting....
Detecting chip type... ESP32-H2
Chip is ESP32-H2 (revision v0.1)
Features: BLE, IEEE802.15.4
Crystal is 32MHz
MAC: 74:4d:bd:ff:fe:63:37:06
BASE MAC: 74:4d:bd:63:37:06
MAC_EXT: ff:fe
Uploading stub...
Running stub...
Stub running...
Manufacturer: c8
Device: 4016
Detected flash size: 4MB
Hard resetting via RTS pin...
(venv) ➜ esptool_test_freebsd esptool.py --port-filter serial=7c98d1065267ee11bcc4c8ab93cd958c flash_id
esptool.py v4.9.dev1
Found 1 serial ports
Serial port /dev/ttyUSB0
Connecting....
Detecting chip type... Unsupported detection protocol, switching and trying again...
Connecting......
Detecting chip type... ESP32
Chip is ESP32-D0WD-V3 (revision v3.1)
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
Crystal is 40MHz
MAC: 10:06:1c:98:2e:e0
Uploading stub...
Running stub...
Stub running...
Manufacturer: c8
Device: 4017
Detected flash size: 8MB
Flash voltage set by a strapping pin to 3.3V
Hard resetting via RTS pin...
Hope this helps, you can see that it works for me without the problem. Please beware that ends of both serial numbers are the same. |
Thank you @Dzarda7 looks like a problem on our end will try to align pyserial on FreeBSD side :-) |
Is your feature request related to a problem?
Describe the solution you'd like
--port-filter
functionality.Describe alternatives you've considered
/dev/cuaU*
device.Additional context
#1026
The text was updated successfully, but these errors were encountered: