My esp is consuming 180mA with a led blink. The same consumption happens when I put it in WIFI_STA mode with the WiFi.mode(WIFI_STA); function.
What should I do to reduce consumption? Used AMS1117 CI as tension regulator.

My code:

void setup() {
  pinMode(2, OUTPUT); // pin number 2 is on board blue led

void loop() {
  digitalWrite(2, LOW); // blue led highlight with LOW level
  digitalWrite(2, HIGH);

enter image description here

Why all this consumption?

  • if it's in WIFI_STA and not doing anything network-related, it should eventually go into modem sleep and draw a lot less.
    – dandavis
    Oct 13, 2018 at 15:04

1 Answer 1


The SDK library of the ESP8266 remembers on flash memory the mode, SSID and password of the last WiFi network it connected. At start or by enabling STA mode it tries to connect to that network. The SDK library is always part of the compiled sketch for the esp8266.

The esp8266 WiFi library has some functions to control this:

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.