Cant Make acces point when upload to ESP32

Im trying to make an access point in esp32 based on this template. when i upload it with arduino ide the access point is visible by my laptop and phone. but when i upload by using platformio my devices cannot detect the access point. i also have try to connect it independently by typing the ssid and password but it doesnt work. is there any of you having the same problem? if it yes how you fix this problem. thankyou

`#include <Arduino.h>
#include <WiFi.h>

#define led 2 
WiFiServer server(80);
WiFiClient client;

const char* ap_ssid =  "CNGO_AP";
const char* ap_password =  "Scafol123";

String http;
bool ledState =  false;
String boxMode = "None";

String header;
// put function declarations here:
int myFunction(int, int);
void sendResponse();
void updateLed();
void updateWebpage();

void setup() {
  // put your setup code here, to run once:
  pinMode(led, OUTPUT);
  Serial.print("Connecting to");

    // Create the ESP32 access point  
   * Alternative:  
   * softAP(const char* ssid,  
   *     const char* password,  
   *     int channel,  
   *     int ssid_hidden,   
   *     int max_connection  
   *     where:  
   *      ssid - this is the SSID that will be broadcast by ESP32  
   *          maximum of 63 characters  
   *      password - this is the password to connect to ESP32  
   *          minimum of 8 characters to function  
   *          Put NULL to make it open to public  
   *      channel - wifi channels (ranging from 1 to 13)  
   *      ssid_hidden - sets the SSID as broadcast or hidden  
   *          0: broadcast SSID  
   *          1: hidden SSID,   
   *           you need to type the exact SSID name in order to connect  
   *      max_connection - maximum number of connected clients  
   *          accepts 1 to 4 only  
  WiFi.softAP(ap_ssid, ap_password);  
  Serial.print("Access Point is running...");
  Serial.print("IP Address : ");

void loop() {
  // put your main code here, to run repeatedly:
  if ( client =  server.available()){
    Serial.print("New Client Detected!");
    String clientData = "";
    while (client.connected()){
        char c =;
        http += c;
        if (c == 'n'){
          if (clientData.length() == 0){
            clientData = "";
        } else if (c == 'r'){
          clientData += c;
    http = "";
    Serial.println("Client disconnected");

void sendResponse(){
  client.println("HTTP/1.1 200 OK");  
  client.println("Connection: close");  

void updateWebpage(){
  client.println("<!DOCTYPE html><html>");  
  client.println("<title>CNGO Box Station</title>");  
  client.println("<body><h1>Simple ESP32 Web Server</h1>");  

  // led control
  if (ledState == false) {  
  client.println("<h3>1. LED is OFF</h3>");    
  client.println("<p><a href=\"/led/on\"><button>Turn ON</button></a></p>");  
  } else {
    client.println("<h3>LED is OFF</h3>");   
    client.println("<p><a href=\"/led/off\"><button>Turn OFF</button></a></p>");  

void updateLed(){
    // In here we will check the HTTP request of the connected client  
  //  using the HTTP GET function,  
  //  Then turns the LED on / off according to the HTTP request  
  if    (http.indexOf("GET /led/on") >= 0) {  
  Serial.println("Request LED on");  
  ledState = true;  
  digitalWrite(led, HIGH);  
  } else if (http.indexOf("GET /led/off") >= 0) {  
  Serial.println("Request LED off");  
  ledState = false;  
  digitalWrite(led, LOW);  


; Verbose
build_flags = -DCORE_DEBUG_LEVEL=5

to your platformio.ini. What are the logs in the serial monitor?

Thank you for your suggestion
heres the output and now it works! can you explain to me whats happening bassed on that setting