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

auto-figure out which device is what (main or debug) #57

Open
yarikoptic opened this issue Sep 12, 2023 · 1 comment
Open

auto-figure out which device is what (main or debug) #57

yarikoptic opened this issue Sep 12, 2023 · 1 comment
Assignees

Comments

@yarikoptic
Copy link
Member

atm relies on the order of their appearance.

❯ lsusb -d 2e8a: | sed -e 's,Bus \([^ ]*\) Device \([^ ]*\) .*,\1 \2,g' | while read bus dev; do ser=$(lsusb -s $bus:$dev -v 2>/dev/null | grep iSerial | awk '{print $3;}'); echo "$bus $dev $ser" ;done
001 090: e6617c93e3706f29
001 089: e6617c93e3640d28

gives two different serials which could be used. We didn't find that serial anywhere under corresponding sys folder, which has otherwise the ttyACM* information:

❯ ls -ld /sys/bus/usb/devices/*/*/tty/ttyACM*
drwxr-xr-x 3 root root 0 Sep 12 11:54 /sys/bus/usb/devices/1-1/1-1:1.0/tty/ttyACM0/
drwxr-xr-x 3 root root 0 Sep 12 11:54 /sys/bus/usb/devices/1-9/1-9:1.0/tty/ttyACM1/
@TheChymera
Copy link
Contributor

TheChymera commented Sep 12, 2023

Solved as of 0d985e0 — the device is now auto-detected based on wiring, which spares us having to either query or keep track of serial numbers.

However, if those are needed they can more easily be obtained via MicroPython itself →

# mpremote exec 'import machine; import ubinascii as ub; a = ub.hexlify(machine.unique_id()).decode("utf-8"); print(a)'

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