Flash code via a web browser #619
Replies: 4 comments
-
Ok I've done some more on this, with these changes:
|
Beta Was this translation helpful? Give feedback.
-
There's also a video of how to use it: https://www.youtube.com/watch?v=y2u2AGnEau4 |
Beta Was this translation helpful? Give feedback.
-
Nice work! I'm looking at using Pico and the DHT11 to capture temp/humidity from our warehouse computers via our web app. I've ported this code to a class for integration with other code. It does not support flashing files, but can be used to send and receive data. Will parse read responses as JSON or fallback to original string.
let pico = new PiPico()
// will be true if user already connected previously
console.log(pico.isConnected)
// from a user action
pico.requestPort()
let resp = await pico.write('.hi')
// or listen for any pico reads
// from = "write" or "push"
pico.on('read', ({value, from})=>console.log(from, value)
pico.write('.hi') |
Beta Was this translation helpful? Give feedback.
-
is this only applicable for http to serial via browser or is there any diy endpoint for accepting and flashing the fw via http? |
Beta Was this translation helpful? Give feedback.
-
I've made (partly by copying code from @kaluma/cli ) a way to flash the Pico directly from a web browser, using the web serial API.
Try it at https://www.mathsuniverse.com/pico
I created this partly because I'm using WSL on Windows, and connecting to the Pico via WSL is a bit of a faff (having to share the USB port etc).
It's very rough-and-ready but features:
Enjoy and let me know of any bugs etc!
Beta Was this translation helpful? Give feedback.
All reactions