• Skip to main content
  • Skip to primary sidebar

RNTLab.com

The Ultimate Shortcut to Learn Electronics and Programming with Open Source Hardware and Software

  • Courses
  • Forum
    • Forum
    • Ask Question
  • Shop
  • Account
  • Blog
  • Login

Web Server

Q&A Forum › Category: ESP32 › Web Server
0 Vote Up Vote Down
eli houngo asked 2 years ago

Hi,
I m using Platformio to upload a web server sketch  example everything is ok but if I open the serial monitor to get the ESP IP address is not connecting to my Wifi
This is the code :#include <Arduino.h>
#include <WiFi.h>
#include <AsyncTCP.h>
#include <ESPAsyncWebServer.h>
// Replace with your network credentials
const char* ssid = “REPLACE_WITH_YOUR_SSID”;
const char* password = “REPLACE_WITH_YOUR_PASSWORD”;
// Create AsyncWebServer object on port 80
AsyncWebServer server(80);
const char index_html[] PROGMEM = R”rawliteral(
<!DOCTYPE html>
<html>
<head>
<title>ESP Web Server</title>
<meta name=”viewport” content=”width=device-width, initial-scale=1″>
<link rel=”icon” href=”data:,”>
<style>
html {
font-family: Arial;
text-align: center;
}
body {
max-width: 400px;
margin:0px auto;
}
</style>
</head>
<body>
<h1>Hello World!</h1>
<p>Congratulations!<br>This is your first Web Server with the ESP.</p>
</body>
</html>
)rawliteral”;
void initWiFi() {
WiFi.mode(WIFI_STA);
WiFi.begin(ssid, password);
Serial.print(“Connecting to WiFi ..”);
while (WiFi.status() != WL_CONNECTED) {
Serial.print(‘.’);
delay(1000);
}
Serial.println(WiFi.localIP());
}
void setup() {
// Serial port for debugging purposes
Serial.begin(115200);
initWiFi();
server.on(“/”, HTTP_GET, [](AsyncWebServerRequest *request){
request->send(200, “text/html”, index_html);
});
// Start server
server.begin();
}
void loop() {
// put your main code here, to run repeatedly:
}
I need Help.

3 Answers
0 Vote Up Vote Down
Sara Santos Staff answered 2 years ago

Hi.
Did you insert the right SSID and password on the cod before uploading it to your board?
Regards,
Sara

0 Vote Up Vote Down
eli houngo answered 2 years ago

HI,
Thank you for your answer .
SSID is correct because I tray the same with IDE Arduino is Working but for Platformio the code is uploaded to the board with no problem then if I open the serial monitor only dot I restart the board but no connecting no IP Adresse 
Thank you 
 

0 Vote Up Vote Down
Sara Santos Staff answered 2 years ago

Hi.
Can you provide more details?
that sketch is working on Arduino IDE, but not on Platformio?
 
Regards,
Sara

Primary Sidebar

Login to Ask or Answer Questions

This Forum is private and it’s only available for members enrolled in our Courses.

Login »

Latest Course Updates

  • [eBook Updated] Learn Raspberry Pi Pico/Pico W with MicroPython eBook – Version 1.2 May 26, 2025
  • [New Edition] Build ESP32-CAM Projects eBook – 2nd Edition April 16, 2025

You must be logged in to view this content.

Contact Support - Refunds - Privacy - Terms - MakerAdvisor.com - Member Login

Copyright © 2013-2025 · RandomNerdTutorials.com · All Rights Reserved

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.