-
• #2
I found that I had to wait a few seconds after startup to do the createServer() call - try putting that in a 5 second timeout.
-
• #3
Please send me an code example.
-
• #4
remove save() from function onInit();
If you want to save your code add this as last line:
setTimeout(save,2000);
-
• #5
Thanks a lot by the answers. Its works!
-
• #6
@MaBe, #4 is nice alternative to my suggestion of having this as last line
setTimeout(onInit,1000); // while developing only
and remove it before the last upload that I then finish with a
save()
in the console.I came up with my suggestion in order to write to the flash only when I need to keep wear and tear as low as possible... but this show only the wear-phoby of mine...
-
• #7
this is what i like to do
testing = true ; // false; ..... if (testing) setTimeout(onInit,1E3); else setTimeout(save,1E3);
-
• #8
or like this ;-)
testing = true ; // false; ..... // upload start or save if (testing) { setTimeout(() => { onInit(); }, 1E3); } else { setTimeout(() => { save(); }, 1E3); }
-
• #9
I see. You can then add even more testing-only things because you already have the testing variable available... and you change the set value before the 'last' upload after all is just working fine.
Hi,
Please help me with this trouble, i tried to start an http server on a ESP8266 (Nodemcu v3) with this code:
But its doesnt start the http server on port 80. When connect to telnet at port 23, and run
httpServer.createServer(onRequest).listen(80);
its works. What's happening with httpServer and why doesnt run at start?Thanks a lot
Bunny