Skip to content

WiFi.persistent(false) does not allow ESP-12 module to work properly when connect to Wifi #5147

@ioTataryn

Description

@ioTataryn

Basic Infos

Platform

  • Hardware: ESP-12
  • Core Version: 2.4.2
  • Development Env: Arduino IDE
  • Operating System: Windows

Settings in IDE

  • Module: Generic ESP8266 Module
  • Flash Mode: DIO
  • Flash Size: 4MB/1mb
  • lwip Variant: v2 Lower Memory
  • Reset Method: ck
  • Flash Frequency: 40Mhz
  • CPU Frequency: 80Mhz
  • Upload Using: SERIAL
  • Upload Speed: 256000

Problem Description

I have been running the ESP-12 in a deployed environment where it will wake up and send a sensor reading once every 30 minutes. This had been going well until the modules stopped responding after anywhere between 15-30 days. They would constantly reboot once they connected to the wifi network.

I had read the fix was to set WiFi.persistent(false) at the top of the sketch before calling Wifi.begin(), however this does not work, module will still reboot once connected to wifi.
The code below still causes the corrupted module to reboot. Is there any fix to restore this module?
I have also tried static IP with no change..

Debug info attached below.

  1. Is the wifi flash corrupt now?
  2. does the WiFi.persistent(false) need to be set before flash becomes corrupt?
  3. Will this only work on a new module?

MCVE Sketch

#include <ESP8266WiFi.h>
#include <ESP8266HTTPClient.h>

ADC_MODE(ADC_VCC); //vcc read
#define LEDPINOUT 2 // GPIO2 of ESP8266
#define ESPDEEPSLEEPSECONDS 1000000

void setup() 
{

  //setup serial outputs
  Serial.begin(115200);
  Serial.setDebugOutput(true);
  WiFi.printDiag(Serial);

  Serial.print("Connecting to ");

  WiFi.persistent(false);
  WiFi.mode(WIFI_STA);
  //WiFi.forceSleepBegin();

  //turn on wifi and connect
  // WiFi.forceSleepWake();
  //WiFi.config({192, 168, 0, 66}, {192, 168, 0, 1}, {255, 255, 255, 0}, {192, 168, 0, 1});
    if (WiFi.status() != WL_CONNECTED) 
    {
      WiFi.begin("ssid", "pwd");  //connect to wifi    
      delay (500);
    }
}//end setup loop
 
void loop() 
{
 Serial.print(".");
 delay(100);

}  //end main loop

Debug Messages

Mode: STA+AP
PHY mode: N
Channel: 1
AP id: 0
Status: 1
Auto connect: 1
SSID (5): XXXXX
Passphrase (8): XXXXXXXX
BSSID set: 0
Connecting to bcn 0
del if1
mode : sta(xx:xx:xx:xx:xx:xx)
scandone
........................scandone
state: 0 -> 2 (b0)

---------------------------------------
 ets Jan  8 2013,rst cause:2, boot mode:(3,6)

load 0x4010f000, len 1384, room 16 
tail 8
chksum 0x2d
csum 0x2d
vbb28d4a3
~ld

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions