Hi i am working on making a wifi drone and is almost complete im testing it but im facing an issue.
The issue being that when i connect the esp with my drone and press then up button it works but the esp32 then glitches & it dissconects. I can not connect it to my mobile again as it does not show up in the search. i have to reupload the code for it to work
im powering my esp32 and motors separately.

The code for wifi connectivity
void initializeWiFi()
{
WiFi.mode(WIFI_AP);
WiFi.softAP(ssid, password);
IPAddress myIP = WiFi.softAPIP();
Serial.print("AP IP address: ");
Serial.println(myIP);
server.on("/", HTTP_handleRoot);
server.onNotFound( HTTP_handleRoot );
server.begin();
}
void setup()
{
Serial.begin(921600);
initializeWiFi();
read_MPU6050(); //this only sets up the MPU6050 read mpu6050 in updatePID()
motorState(); //state of motor pins
}
void loop()
{
updatePID(); // Update PID controllers by reading from mpu6050
handleMotorControl(); // Handle motor control based on the received command
updateMotorValues(); // Update motor values based on PID,
writeMotor(); // Write motor values to pins
}


