You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've build https://github.com/metachris/micropython-ctl, a TypeScript library (and cli) for talking to MicroPython devices from websites/webapps, Node.js and Electron apps, VS code extensions (and more).
I'm hoping it is useful and furthers the MicroPython developer ecosystem and convenience, and thought it might be beneficial for developers that want to build something to know this exists. Do you want to add a reference to micropython-ctl from this repository?
constmicropython=newMicroPythonDevice()// Connect to micropython device over networkawaitmicropython.connectNetwork('DEVICE_IP','WEBREPL_PASSWORD')// Or connect to micropython device over serial interfaceawaitmicropython.connectSerial('/dev/ttyUSB0')// Run a Python script and capture the outputconstoutput=awaitmicropython.runScript('import os; print(os.listdir())')console.log('runScript output:',output)// List all files in the rootconstfiles=awaitmicropython.listFiles()console.log('files:',files)// Get file contentsconstfileContents=awaitmicropython.getFile('boot.py')console.log(fileContents)// Set a terminal (REPL) data handler, and send data to the REPLmicropython.onTerminalData=(data)=>process.stdout.write(data)micropython.sendData('\x03\x02')// Ctrl+C and Ctrl+B to enter friendly repl and print version
The text was updated successfully, but these errors were encountered:
I've build https://github.com/metachris/micropython-ctl, a TypeScript library (and cli) for talking to MicroPython devices from websites/webapps, Node.js and Electron apps, VS code extensions (and more).
I'm hoping it is useful and furthers the MicroPython developer ecosystem and convenience, and thought it might be beneficial for developers that want to build something to know this exists. Do you want to add a reference to micropython-ctl from this repository?
micropython-ctl is fully async, allowing developers to await code executions and doing things with the response. Here is more documentation: https://metachris.github.io/micropython-ctl/classes/micropythondevice.html
Code samples:
The text was updated successfully, but these errors were encountered: