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

Serial port detection fails on WSL #92

Open
WyvernSpite opened this issue Nov 15, 2021 · 3 comments
Open

Serial port detection fails on WSL #92

WyvernSpite opened this issue Nov 15, 2021 · 3 comments

Comments

@WyvernSpite
Copy link

WyvernSpite commented Nov 15, 2021

I am using WSL following the setup guide here:
https://github.com/32blit/32blit-sdk/blob/master/docs/Windows-WSL.md

While following the instructions and troubleshooting section of this page:
https://github.com/32blit/32blit-sdk/blob/master/docs/32blit.md#flasher-cant-find-32blit-port

I was unable to determine how to find which port to provide to successfully push a blit to the device

Thanks to ali1234 on the discord I was finally able to manually set the port. They asked me to include the following:

python3 -m serial.tools.list_ports -v

all results return

desc: n/a
hwid: n/a

And finally:

192 ports found
@ali1234
Copy link
Contributor

ali1234 commented Nov 15, 2021

It seems like pyserial isn't able to get the vid and pid of the serial devices when run within WSL. This causes autodetection to fail. We can report this upstream but I suspect they will be unable to fix it unless Microsoft improves their serial port wrapper. So we should document this in the SDK docs. We could perhaps also make 32blit tool print a more helpful error if detection fails. Maybe try to detect if it is being run in WSL?

@Daft-Freak
Copy link
Collaborator

WSL1 just forwards COMx -> /dev/ttySx as a raw serial port, there's no USB forwarding so no USB ids. WSL2 is somehow worse than WSL1, it doesn't even forward the serial ports...

(It's apparently possible to forward USB devices in WSL2+Win11 though: https://devblogs.microsoft.com/commandline/connecting-usb-devices-to-wsl/)

@Gadgetoid
Copy link
Contributor

You can install Python and the 32blit tools directly in Windows and run it from there IIRC.

This is one of the many reasons I ditched WSL for Linux.

IIRC there were ways to detect running in WSL via /proc/version or uname -a which could probably help direct users.

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

4 participants