HipsterBrown / xs-dev

The quickest way for getting started with JS on devices
https://xs-dev.js.org
MIT License
41 stars 13 forks source link

fix(scan): reboot pico boards in BOOTSEL before scan #46

Closed HipsterBrown closed 2 years ago

HipsterBrown commented 2 years ago

Fixes #45

Uses the suggested command picotool reboot -fa to set any connected pico board in boot select into application mode for serial discovery, and it does require a second to reboot before appearing as an available device.

The data returned by Serialport.list does not include USB bus information, so running picotool against a particular USB address is not possible unless I am able to refactor to use node-usb instead. Node-usb might actually be the more appropriate library for the use case of xs-dev, so it is worth attempting the refactor in a separate branch.

phoddie commented 2 years ago

The change is working nicely, thank you. I see now that SerialPort doesn't give all the USB info, so you are limited in scanning more than one connected Pico without switching APIs. Not a big problem!