Esp8266 reset button

Hi! I made a project with esp8266, Sim800l, MQ2.
When the SIM800l sensor is triggered, a certain number rings.
The problem is that when the power is turned on, the esp8266 does not work immediately. That is, you need to press the reset button.
What can I do to make Esp8266 work immediately without pressing the button, how to solve this problem?)

Start by posting your sketch, using code tags when you do

int mq2 =  A0;
int value;
#include <SoftwareSerial.h>
SoftwareSerial SIM800(0, 2);
void setup() {
  Serial.begin(9600);
  SIM800.begin(9600);
  pinMode(mq2, INPUT);
}

void loop() {
  value = analogRead(mq2);

  if (value > 400)
  {
    SIM800.println("ATD+7775XXXXXXX;");
    delay(2000);
  }
  else
  {
    Serial.println("tokta");
  }
  delay(100);
  if (SIM800.available())
    Serial.write(SIM800.read());
  if (Serial.available())
    SIM800.write(Serial.read());

}

Please tell me how we can solve it?

I can close gnd reset. That won't do. Need a way to perform a reset inside the code (setup).

Please tell me how we can solve it?

By using the RST (they put it there for a reason) or Serial (SoftwareSerial)?

In the case of the latter -

"You can use command like AT+CFUN=0 and then AT+CFUN=1 to put module in flight mode and again back to normal mode. This would simulate a network reboot."

go into flight mode and back

Thank you very much for your feedback!
I will definitely try it!

Wait. . . you believe the ESP8266 is hanging.
You must be using a development board, a NodeMCU or similar.

What are you using for power - a battery, "usb"?
SIM800L is power intensive at start up (2 Amps). It could starve the "8266" during startup. Once that is over there is capacity available for the "8266" to boot (after a reset / p.b. click).

yes, it seems to be hanging Esp8266.
All are powered by a 5v 2a power supply. Sim800L is powered separately by 4V via a step-down LM2596

or should I upgrade to 4.4V?

Updated: Upgraded to 4.4V nothing has changed
The whole circuit is powered by a step-down:

  • Lm2596
    Esp8266 via VIN
    MQ2 via VIN
    Sim800l via VIN

-Lm2596
Esp8266 via GND
MQ2 via GND
Sim800l via GND

What form is the "ESP8266" ?
Is it a NodeMCU, ESP-01, WROOM, or what?

ESP8266 NodeMcu v3

If everything is running from one "5V 2A supply" then that is the problem.
When it gets going, the SIM800 leaves nothing for the NodeMCU.
Try separate sources (supply "A" for NodeMCU, supply "B" for SIM800).

Is it possible to implement an esp8266 reset in code?

Because after the reset everything works fine. It is necessary after turning on esp8266, it should reboot itself once

How could it Reset in firmware if it isn't running?
The SIM is starving out the ESP at boot.
If it's determined that everything is OK when they run from separate supplies - then what should be done will be better understandable.