You are reading a single comment by @MaBe and its replies.
Click here to read the full conversation.
-
Hi, thaks for answear.
I test this tip and after restart device ( use func reset() ), device not loaded code from init function. What I do wrong ?
Testing code for init func :
E.on('init', function() { console.log("Device started"); });
And console output, after save(); code correctly loaded, but after reset() not load code from init function. If I call load() func after reset, code correctly run.
Connected > > =undefined Wifi.getIP: { "ip": "10.0.0.42", "netmask": "255.255.255.0", "gw": "10.0.0.138", "mac": "5c:cf:7f:24:77:e4" } > =undefined > =undefined Erasing Flash..... Writing.... Compressed 27200 bytes to 2026 Checking... DDevice started >reset(); =undefined _____ _ | __|___ ___ ___ _ _|_|___ ___ | __|_ -| . | _| | | | | . | |_____|___| _|_| |___|_|_|_|___| |_| http://espruino.com 1v89 Copyright 2016 G.Williams Espruino is Open Source. Our work is supported only by sales of official boards and donations: http://espruino.com/Donate Flash map 4MB:512/512, manuf 0xe0 chip 0x4016 >
Hi @jakub.frydrych
o setup wifi as station connected your access point (only once)
o write code you want to be started on boot='init' and upload
o after your code is completely uploaded run save, this will save, restart and run your code