Deprecated, use
pico-mpy-com
instead.
A straightforward library for establishing communication with Raspberry Pi Pico (W) boards using the pyboard.py
utility (from the MicroPython project) via the serial port.
Now with experimental ESP32-WROOM, ESP32-S3, ESP32-C3, ESP32-S3-Pico and Teensy 4.0 support!
This projects main/initial purpose is to offload the communication core and utilities from the MicroPico repo into a seperate repository for development and usability reasons. Also it is/was meant to replace the old ugly asynchronous mess of a communication piece to allow the developement of new more complex features based on the official
pyboard.py
module developed on the MicroPython repo.
Before installing, make sure to authenticate with GitHub Package Registry or using a .npmrc
file. See "Configuring npm for use with GitHub Package Registry."
$ npm install @paulober/pyboard-serial-com
Or add this package to your package.json
file:
"dependencies": {
"@paulober/pyboard-serial-com": "3.1.2"
}
NOTE: requires the scripts directory to be present in your work-/output directory
Platform | Architectures |
---|---|
Windows | x64 |
Linux | x64, arm64, (armhf) |
macOS (10.9 or higher) | x64, arm64 |
import { PyboardRunner } from "@paulober/pyboard-serial-com"
const pyboardRunner = new PyboardRunner(
"COM3",
115200,
(data: Buffer | undefined) => {
if (data !== undefined) {
console.error(`stderr: ${data?.toString()}`)
} else {
// connected sucessfully
console.debug("Connected!")
}
},
(code: number, signal: string) => {
if (code) {
console.error(`child process exited with code ${code}`)
}
if (signal) {
console.error(`child process killed with signal ${signal}`)
}
console.debug("Done - exit")
}
)
pyboardRunner.disconnect()
- Maybe switch to RXJS compared to the current custom solution for queueing
...