Error ArduinoMega + ESP8266

hello, I upload the project in the ESP8266, which is connected to an official arduino mega.

systematically with this project I have this error message which is displayed and nothing works.

ets Jan 8 2013,rst cause:4, boot mode:(3,7)

wdt reset
load 0x4010f000, len 3460, room 16
tail 4
chksum 0xcc
load 0x3fff20b8, len 40, room 4
tail 4
chksum 0xc9
csum 0xc9
v00046870
~ld

Can you help me ?

The arduino code

#include <WiFi.h>
#include <WiFiClient.h>
#include <WiFiServer.h>
#include <WiFiUdp.h>

//**//
//
//
#include <ESP8266WiFi.h>
#include <ESP8266HTTPClient.h>
#include <WiFiClient.h>

#include <ESP8266WiFiMulti.h>
ESP8266WiFiMulti WiFiMulti;

const char WiFiPassword[] = "fegegegezg";
const char AP_NameChar[] = "sdfdfdf" ;

IPAddress IP(192, 168, 0, 61); //adresse fixe
IPAddress gateway(192, 168, 0, 254); //passerelle par défaut
IPAddress subnet(255, 255, 255, 0); //masque de sous réseau
IPAddress dns(8, 8, 8, 8); //DNS

WiFiServer server(80);

String header = "HTTP/1.1 200 OK\r\nContent-Type: text/html\r\n\r\n";
String html_1 = "body {font-size:140%;} #main {display: table; margin: auto; padding: 0 10px 0 10px; } h2,{text-align:center; } .button { padding:10px 10px 10px 10px; width:100%; background-color: #4CAF50; font-size: 120%;}.button2 { padding:10px 10px 10px 10px; width:100%; background-color: RED; font-size: 100%;}LED Control

Control des LEDs par wifi

";
String html_2 = "";
String html_3 = "";
String html_4 = "";
String html_5 = "";
String html_6 = "";
String html_7 = "";
String html_8 = "";
String html_9 = "";
String html_10 = "
";

String request = "";
int LED1_Pin = 2;
int LED2_Pin = 3;
int LED3_Pin = 4;
int LED4_Pin = 5;
int LED5_Pin = 6;
int LED6_Pin = 7;
int LED7_Pin = 8;
int LED8_Pin = 9;
int BP[12];

int i=0;

const char* startsequence[]={"http://192.168.0.55:1000/startsequence1", "http://192.168.0.55:1000/startsequence2", "http://192.168.0.55:1000/startsequence3",
"http://192.168.0.55:1000/startsequence4", "http://192.168.0.55:1000/startsequence5", "http://192.168.0.55:1000/startsequence6",
"http://192.168.0.55:1000/startsequence7", "http://192.168.0.55:1000/startsequence8","http://192.168.0.55:1000/startsequence9",
"http://192.168.0.55:1000/startsequence10", "http://192.168.0.55:1000/startsequence11","http://192.168.0.55:1000/startsequence12",};

const int buttonPin = 21; // the number of the pushbutton pin
const int ledPin = 23; // the number of the LED pin
int buttonState = 0;

void setup()
{
WiFi.disconnect();
WiFi.config(IP,gateway,subnet,dns);
WiFi.begin(AP_NameChar, WiFiPassword);
WiFi.mode(WIFI_STA); //mode station

for(i=1 ;i<13; i++) 
  {
   int BP[i];
  }

pinMode(LED1_Pin, OUTPUT);
pinMode(LED2_Pin, OUTPUT); 
pinMode(LED3_Pin, OUTPUT);
pinMode(LED4_Pin, OUTPUT);  
pinMode(LED5_Pin, OUTPUT);
pinMode(LED6_Pin, OUTPUT);
pinMode(LED7_Pin, OUTPUT);
pinMode(LED8_Pin, OUTPUT); 

for(int i=0 ;i<12; i++) 
  {
   pinMode(BP[i], INPUT); 
  }
  

Serial.println("Connecting");

while(WiFi.status() != WL_CONNECTED) 
  {
  delay(500);
  Serial.print(".");
 }
 
Serial.println("");
Serial.print("Connected to WiFi network with IP Address: ");
Serial.println(WiFi.localIP());
Serial.println("WiFi not connected,"); 
                  
boolean conn = WiFi.softAP(AP_NameChar, WiFiPassword);
server.begin();

}

void loop()
{

// Check if a client has connected
WiFiClient client = server.available();
if (!client)  {  return;  }

// Read the first line of the request
request = client.readStringUntil('\r');

if  ( request.indexOf("LED1ON") > 0 )  { digitalWrite(LED1_Pin, HIGH);  }
if  ( request.indexOf("LED1OFF") > 0 ) { digitalWrite(LED1_Pin, LOW);   }
if  ( request.indexOf("LED2ON") > 0 )  { digitalWrite(LED2_Pin, HIGH);  }
if  ( request.indexOf("LED2OFF") > 0 ) { digitalWrite(LED2_Pin, LOW);   }
if  ( request.indexOf("LED3ON") > 0 )  { digitalWrite(LED3_Pin, HIGH);  }
if  ( request.indexOf("LED3OFF") > 0 ) { digitalWrite(LED3_Pin, LOW);   }
if  ( request.indexOf("LED4ON") > 0 )  { digitalWrite(LED4_Pin, HIGH);  }
if  ( request.indexOf("LED4OFF") > 0 ) { digitalWrite(LED4_Pin, LOW);   }
if  ( request.indexOf("LED5ON") > 0 )  { digitalWrite(LED5_Pin, HIGH);  }
if  ( request.indexOf("LED5OFF") > 0 ) { digitalWrite(LED5_Pin, LOW);   }
if  ( request.indexOf("LED6ON") > 0 )  { digitalWrite(LED6_Pin, HIGH);  }
if  ( request.indexOf("LED6OFF") > 0 ) { digitalWrite(LED6_Pin, LOW);   }
if  ( request.indexOf("LED7ON") > 0 )  { digitalWrite(LED7_Pin, HIGH);  }
if  ( request.indexOf("LED7OFF") > 0 ) { digitalWrite(LED7_Pin, LOW);   }
if  ( request.indexOf("LED8ON") > 0 )  { digitalWrite(LED8_Pin, HIGH);  }
if  ( request.indexOf("LED8OFF") > 0 ) { digitalWrite(LED8_Pin, LOW);   }

client.flush();   
client.print( header );
client.print( html_1 );    
client.print( html_2 ); 
client.print( html_3 ); 
client.print( html_4 ); 
client.print( html_5 ); 
client.print( html_6 ); 
client.print( html_7 ); 
client.print( html_8 ); 
client.print( html_9 ); 
client.print( html_10 );      
delay(5); 

for(i=0;i<12;i++)
   {
    if (digitalRead(BP[i]) == HIGH) 
      { 
        WiFiClient client;
        HTTPClient http;
        http.begin(client, startsequence[i]);
        Serial.print("GET ");
        Serial.println(startsequence[i]);
        http.end();
        delay(20);
      }
   } 

}

If found several posts regarding this issue which referred to the power supply. One example is

https://bbs.espressif.com/viewtopic.php?t=3311

It might also be connected to the watchdog:

https://stackoverflow.com/questions/56820988/esp8266-01-ets-jan-8-2013-rst-cause4-boot-mode3-7

However, I recommend to check the GPIO pins first which you are using for the LEDs!

https://randomnerdtutorials.com/esp8266-pinout-reference-gpios/

(Or her, but unfortunately only abailable in German: https://www.computerhilfen.de/info/esp8266-nodemcu-loesung-fuer-ets-jan-8-2013rst-cause4-boot-mode36.html

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.