Actually, that's not quite right, after looking at your code file, you've got the module in your code and it would appear the Espruino Wifi Manager (I'm assuming the code belongs to that) checks the validity of the network credentials supplied by first test connecting to the Wifi network before writing to flash & rebooting (nice!) so if you bring your websocket code into there, below this line in the start_wifi function:
console.log("Connected to: " + wifi.getIP().ip);
and defer calling load() until the websocket sends the credentials (your test object) that should work.
Given this would seem to be a one way, one time exchange of data, you could probably simplify your code again by making a HTTP POST with the data, and have a backend which can handle forms (assuming that's possible).
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.
Actually, that's not quite right, after looking at your code file, you've got the module in your code and it would appear the Espruino Wifi Manager (I'm assuming the code belongs to that) checks the validity of the network credentials supplied by first test connecting to the Wifi network before writing to flash & rebooting (nice!) so if you bring your websocket code into there, below this line in the
start_wifi
function:and defer calling
load()
until the websocket sends the credentials (yourtest
object) that should work.Given this would seem to be a one way, one time exchange of data, you could probably simplify your code again by making a HTTP POST with the data, and have a backend which can handle forms (assuming that's possible).