-
• #2
Looks great!
Is line 28 correct? It's assigning the var to itself?
On the esp8266 there is way of setting the hostname, so then you can use for example http://espruino.local - is there a way of doing this on this board - then you don't need to worry about the IP address..
-
• #3
Is line 28 correct? It's assigning the var to itself?
Yes - usually calling
process.env
creates the var on the fly, but assigning it to itself stops that, so you can then have control over what's in it. It's not needed on the newest builds - it's just to ensure the IDE can still get the board info fine on old builds.Good point about the host name - yes, it should be pretty easy to call
wifi.setHostname
.Also the IDE could also cope with disconnects a bit better (maybe with auto-reconnect) in which case you really could call
reset
- it'd just require a bit of a pause while the board reconnected to WiFi.
There are still a few kinks to iron out, but if you upload this code to your Espruino WiFi board:
Then you can connect to the displayed IP address and get a full Web IDE that you can upload code from!
Obviously if you
reset()
the board then the WiFi connection is lost and the IDE stops responding so that has been disabled (and also largeprint
statements will be lost) but otherwise it's actually pretty usable. I'd recommend you use one of the latest Espruino firmwares though.This should also work on other devices with pretty minimal changes (eg.
USB
->Serial1
on disconnect) - I'd be interested to hear how you get on.