logo elektroda
logo elektroda
X
logo elektroda

ESP8266 ESP12 Fails to connect to router after hanging up - power consumption

MichałS 1086 14
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
  • #1 18004814
    MichałS
    Level 35  
    A recorder based on an ESP12, an OLED and an INA measurement amplifier. The ESP12 runs on NODEMCU firmware and the program code was written in LUA.

    The logger worked for a few days then suddenly stopped logging (sending data to the server). After cutting the power for a while everything returned to normal, but the logger would not connect to the router. A characteristic feature was the increased current consumption. After re-uploading the same firmware and "ini.lua" file, the recorder came to life and is working correctly.

    What could have been the cause? It wasn't a software crash because logs were flying in the background indicating that there was no WiFi and a reconnect attempt and the OLED was displaying results normally. It wasn't a simple hang-up either, as voltage restarts didn't help. What else was peculiar was the power consumption was exactly as it is now when connecting to the router. Presumably there was a jamming/unprogramming of the radio part of the module ?
  • ADVERTISEMENT
  • #2 18004905
    TvWidget
    Level 38  
    Does the script in LUA write data to a file ?
  • #3 18004911
    MichałS
    Level 35  
    Yes; energy production is recorded.
  • Helpful post
    #4 18004926
    TvWidget
    Level 38  
    It is likely that the LUA file was corrupted during the save operation. If this happens again, load the file and compare it with the original one.
    I don't know how it is in ESP8266 but a similar error occurs in ESP32. During certain operations, data cannot be written to the file.
  • Helpful post
    #5 18005265
    Anonymous
    Level 1  
  • ADVERTISEMENT
  • #6 18005745
    MichałS
    Level 35  
    Actually a bit out of character.... It wasn't a simple 'hang-up' of the program because the measurement and results display part worked correctly before and after the restart. The radio, on the other hand, did not work; it simply 'jammed something' at some point. It did not hang up despite restarting and disconnecting the power supply, but the recorder was successfully brought back to life by reprogramming the firmware + init.lua file
  • #7 18005748
    Anonymous
    Level 1  
  • ADVERTISEMENT
  • #8 18006041
    MichałS
    Level 35  
    ESP12 module
  • #9 18572884
    MichałS
    Level 35  
    Continuing the theme;
    NodeMCU firmware provides 4 power saving modes: NONE_SLEEP - no sleep at all, 70mA current consumption; MODEM_SLEEP - saving at the expense of switching off the radio, 20mA consumption; LIGHT_SLEEP - as above + CPU load reduction, 15mA current consumption; DEEP_SLEEP - complete sleep.

    In the project the ESP8266 is counting pulses all the time so DEEP_SLEEP mode is out, and in LIGHT_SLEEP unfortunately it consumes the battery too quickly, do you have any idea how to reduce power consumption without DEEP_SLEEP?
  • Helpful post
    #10 18572926
    Anonymous
    Level 1  
  • ADVERTISEMENT
  • #11 18575170
    MichałS
    Level 35  
    Thank you for the attached material.
    I don't know to what extent the sleep modes described in the Espressif note coincide with those introduced in the NodeMCU firmware: https://nodemcu.readthedocs.io/en/latest/modules/wifi/#wifistasleeptype

    The fact is that MODEM_SLEEP reduces the current consumption to around 20mA, and LIGHT_SLEEP by a few more mA. However, they are not 2mA.
  • #12 18575192
    Anonymous
    Level 1  
  • #13 18575777
    MichałS
    Level 35  
    NodeMCU is also firmware for ESP modules, please see here: https://www.nodemcu.com/index_en.html Firmware can be uploaded to a module, e.g. ESP12 or ESP07, and the program can be written in Lua (ala Phyton).

    Regarding the reduced power consumption modes, I think it coincides with the Espressif description. In MODEM mode the power consumption is as in the document, unfortunately in LIGHT mode several times higher. Perhaps this is because the programme is running several timers.
  • #14 18575822
    Anonymous
    Level 1  
  • #15 18578096
    MichałS
    Level 35  
    So if the circuit is working and the difference between MODEM and LIGHT sleep is small then the contribution of LIGHT sleep is also small. I'll check how the module behaves with a simple program, where basically there will only be the activation of a given sleep mode, this will give an indication of what current consumption can be expected.

Topic summary

The discussion revolves around an ESP8266 ESP12-based data logger that experienced connectivity issues with a router after a period of normal operation. The device, running NodeMCU firmware and programmed in LUA, exhibited increased power consumption and failed to reconnect to WiFi despite the OLED display functioning correctly. Users speculated that the LUA file might have been corrupted, leading to the radio module's malfunction. The author confirmed that reprogramming the firmware and the init.lua file resolved the issue. Additionally, the conversation explored power-saving modes available in NodeMCU firmware, highlighting challenges in reducing power consumption while maintaining functionality, particularly in pulse counting applications.
Summary generated by the language model.
ADVERTISEMENT