-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Provide means for reliably relating serial port and filesystem mount path #6621
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
Comments
How about discotool ? |
Or https://github.com/adafruit/Adafruit_Board_Toolkit, which uses most of the same insides as discotool? |
The |
@Neradoc thanks for the clarification. @aivarannamaa: We have had some issues about the nibble and byte order of |
@Neradoc, thanks for the library and explanations! Somehow it never occurred to me that I could turn to OS for getting the match between serial port and mount point. Your library's deps are rather heavy, though... I'll need to give it some thought. @dhalbert, I tried your advice on Cytron Maker Pi RP2040, but |
The >>> [hex(b) for b in b'\xe6`\xc0b\x13B\x155']
['0xe6', '0x60', '0xc0', '0x62', '0x13', '0x42', '0x15', '0x35'] whose digits match the concatenated digits in |
@dhalbert, thank you! I thought It looks like with this I can really implement the mount point lookup in Thonny. It's not good solution for going from mount point to serial port, though, so I'll think about alternative solutions for pipkin. Please decide whether to close this issue or leave it open. For pipkin I would still like this extra line in boot_out.txt, but I understand that you have limited time and that making the file larger/more complex has its own downsides. |
Oops, I just realized I got my thinking messed up. By learning the USB serial ID via MicroPython code I can easily find only the right serial port, which I already know. If I understood @Neradoc correctly, then the hard part is finding the mount point by serial port information. Having the serial ID explicitly written out at the mount point should make it easy. |
I'd be ok with adding serial to boot_out.txt. Maybe it'd be better to write a json file with info we get from boot_out.txt. That'd make version agnostic parsing much easier. (It'd be bad for tiny filesystems though.) |
A line in boot_out.txt would be good enough for my projects. If I simply had to find a line with specific prefix (eg. |
I'm adding a |
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:
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.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.
The text was updated successfully, but these errors were encountered: