Hi, What I'd suggest is that soon after power-on you detect if the button is pressed, and if it is you put the WiFi module into access point mode with wifi.createAP("ESP123","HelloWorld",5,"wpa2_psk",function() { now connected ... })
You can then create a webserver which serves up a page where the wifi credentials are entered - and you can store those credentials using require("FlashEEPROM").write.
Then, when you boot up without the button pressed, read credentials using require("FlashEEPROM").read and connect to that WiFi network.
Either that, or if this is a toy and it needs controlling (but not an internet connection) you could just always make it create its own access point rather than connecting to another network?
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Hi, What I'd suggest is that soon after power-on you detect if the button is pressed, and if it is you put the WiFi module into access point mode with
wifi.createAP("ESP123","HelloWorld",5,"wpa2_psk",function() { now connected ... })
You can then create a webserver which serves up a page where the wifi credentials are entered - and you can store those credentials using
require("FlashEEPROM").write
.Then, when you boot up without the button pressed, read credentials using
require("FlashEEPROM").read
and connect to that WiFi network.Either that, or if this is a toy and it needs controlling (but not an internet connection) you could just always make it create its own access point rather than connecting to another network?