Your new topic does not fit any of the above??? Check first. Then post here. Thanks.

Moderator: igrr

User avatar
By AdrianM
#38900 I've been introduced to the ESP8266 with a nodemcu/lua setup. So far it's It's been very productive for me and suits my way of working - making incremental code development advances and breaking projects into small code units. If the code in some units doesn't change, they don't have to be reloaded so typically I'm ony uploading a couple of Kb for the unit I'm working on and then running it again. This takes no more than a couple of seconds. The same goes for resouces e.g. HTML files that are to be served, which can be edited and uploaded individually.

However, I'm running into the constraints of the interpreted language and the reliance on the nodemcu dev. team (who do a fantastic job but are resource limited). In particular I can find no way of getting "zero configuration" whereby I can point a browser to something like "MyESP8266.local" to get to my embeded webserver - as the Arduino mDNS library allows.

Having set up on the Arduino IDE though, I'm finding everything to be painfully slow (compiling and uploading everything each time I change one line of code) and wonder if there are tricks I'm missing?
User avatar
By WereCatf
#38913
AdrianM wrote:Having set up on the Arduino IDE though, I'm finding everything to be painfully slow (compiling and uploading everything each time I change one line of code) and wonder if there are tricks I'm missing?


That's just something you have to live with. Lua is an interpreted language and C++ is not and there just aren't any magic-tricks to it -- I often use PHP (it's also an interpreted language) on my web-server for projects and I enjoy the ease and simplicity of quickly hammering out small changes and testing them with no compiling needed in-between, so I understand you, but it's a trade-off; on one hand you lose that ease and simplicity, but on the other hand on the ESP's side you get double the free RAM and a *LOT* faster code than when using Lua and can therefore do things Lua would struggle with.
User avatar
By AdrianM
#38939
WereCatf wrote:That's just something you have to live with.

Alright, thanks for the reply. Do you think it's worth looking at OTA as a way of speeding the flashing process? I think I read somewhere that its faster that way.
User avatar
By WereCatf
#38941
AdrianM wrote:Alright, thanks for the reply. Do you think it's worth looking at OTA as a way of speeding the flashing process? I think I read somewhere that its faster that way.


I use OTA all the time, it's exceedingly handy and yes, it also seems slightly faster at flashing, too -- not much, but still. Just remember to attach a function to ArduinoOTA.onBegin to stop anything that might interfere with the flashing -- personally, I just trigger a flag and turn the web-server off in that function and my loop() is basically
Code: Select allArduinoOTA.handle();
if(OTAFlag) { //DoStuff }
delay(1);