logo elektroda
logo elektroda
X
logo elektroda

ESP8266 ESP-07 Lua Server Stops Responding After Several Refreshes—Why?

oskar777 2556 3
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
  • #1 15272179
    oskar777

    Level 26  
    Hello you,
    below is the code for esp07

    The script is to display the temperature, turn on the diode and refresh after some time.
    The whole thing generally works, the problem is that after some refresh I get in the browser "connection has been reset, no connection etc" generally I have to issue node.restart() from the lualoder console to make the program revive. In summary the section falls down

    Code: Lua
    Log in, to see the code

    eSP itself is fine, because in the timer
    Code: Lua
    Log in, to see the code

    shows me the network data all the time, even though the server section above has died.

    i solved the problem using this workaround
    Code: Lua
    Log in, to see the code

    When the server section is suspended, the timeralarm variable will always have the same value, so if after receiving the variable value twice both values are the same it restarts the module.

    Now to you a question if it is possible to do it nicer?
    Why do these suspensions happen?

    I would be very grateful for your help

    The whole code below.
    Code: Lua
    Log in, to see the code
    Company Account:
    Oskar-info
    Gidzińskiego 24/1, Warszawa, 02-293 | Tel.: 501XXXXXX (Show) | Company Website: http://oskar-info.pl
  • ADVERTISEMENT
  • #2 15304662
    Defozo
    Level 17  
    I'm a layman in this field, but I've dabbled a bit with ESP8266 and I know that the NodeMCU has problems with insufficient memory.
    It probably doesn't matter, but you could try generating a customised NodeMCU for your needs on this site (not containing unused features anyway):
    http://nodemcu-build.com/

    It might just help.
  • ADVERTISEMENT
  • #3 15304869
    oskar777

    Level 26  
    Thank you for your help, unfortunately I had to give up on nodemcu, the environment itself is very friendly but writing something bigger than one DS sensor was missing the point. I moved to Arduino for ESP and the problem is solved, the server is stable, I have DS18b20, DHT11 connected and I still have 35kb of ram and 40kb of memory left.
    Company Account:
    Oskar-info
    Gidzińskiego 24/1, Warszawa, 02-293 | Tel.: 501XXXXXX (Show) | Company Website: http://oskar-info.pl
  • #4 16946790
    kogiel
    Level 17  
    These resets were caused by old underdeveloped software (I had this too) after uploading the new one generated on http://nodemcu-build.com/ everything works OK even with more complicated programs
ADVERTISEMENT