Re: webrepl...
Posted: Thu Nov 29, 2018 10:12 pm
This is just a headsup, I am nearly done with nodejs script mp.js running a command on remote MicroPython (like mp.py). That should allow to send remote MicroPython commands on any OS with installed nodejs. And mp.js is really small:
You can do simple stuff:
And more:
With correct escaping and imported upysh_ module you can even do pipelining in MicroPython on the command line:
Work in progress, but posting mp.js is not far away ...
Code: Select all
$ wc --lines mp.js
27 mp.js
$
$ ./mp.js
mp.js pwd host cmd [...]
$
Code: Select all
$ node mp.js abcd 192.168.4.1 5**4**3
542101086242752217003726400434970855712890625
$
$ ./mp.js abcd 192.168.4.1 'print("ab\ncd")'
ab
cd
$
Code: Select all
$ ./mp.js abcd 192.168.4.1 import utime
$ ./mp.js abcd 192.168.4.1 utime.localtime"()"
(2000, 1, 1, 6, 13, 30, 5, 1)
$ ./mp.js abcd 192.168.4.1 import ntptime
$ ./mp.js abcd 192.168.4.1 ntptime.settime"()"
$ ./mp.js abcd 192.168.4.1 utime.localtime"()"
(2018, 11, 29, 22, 9, 2, 3, 333)
$
Code: Select all
$ ./mp.js abcd 192.168.4.1 'pipe("boot.py") | (head, 14) | (tail,4) | done'
#import network
#sta_if = network.WLAN(network.STA_IF)
#sta_if.active(True)
#sta_if.connect("MicroPython-5cd6ae", "12345678")
$