Closed
Description
It would be nice if one (a person or a tool) could reliably locate device's host mount path when given a serial port and vice versa.
Example situations:
- Thonny users need to select their device by serial port but as serial REPL can't be used for saving files, Thonny needs to locate device's filesystem mount as well. It currently uses
storage.getmount('/')
to retrieve volume label and hopes to find single volume with given name. This doesn't work out when there are several CP boards plugged in. - Pipkin allows users to select their device by mount path. I'd like pipkin to consult device's list of frozen modules (
help("modules")
) before performing an install, so that it can see whetheradafruit_bus_device
is built-in for this device or not (here's a related discussion: build_bundles: Ignore more packages that exist only on pypi circuitpython-build-tools#90 (comment)). For this it is necessary to find the serial port corresponding to given mount path.
I assume it is not possible for CircuitPython to directly report its mount path or serial port, but would it be possible to append another line to boot_out.txt, which reports device's USB serial number? If I'm not mistaken, this is a unique identifier, which means tools could use it for reliably finding the right port given the mount path and vice versa.