[GH-ISSUE #1270] WiFiClient client = wm.client.available() not working #1088

Closed
opened 2026-02-28 01:28:28 +03:00 by kerem · 0 comments
Owner

Originally created by @VladimirVecera on GitHub (Jul 19, 2021).
Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/1270

I would like to load a web page and I can't. How can I do that?

ESP32 (2.0.3 wifimanager)

#include <WiFiManager.h> // https://github.com/tzapu/WiFiManager

WiFiManager wm;

void setup() {
    WiFi.mode(WIFI_STA); // explicitly set mode, esp defaults to STA+AP
    Serial.begin(115200);
    wm.setCountry("US"); 
    wm.setHostname("ESP32");

    bool res;
    res = wm.autoConnect("ESP32");

    if(!res) {
        Serial.println("Error wifi!");
        // ESP.restart();
    } 
    else {
        Serial.println(WiFi.localIP());
    }
}
void loop() {

  WiFiClient client = wm.client.available();
  String ptr = "<html><body>\n";
  ptr +="<h1>ESP32 Web Server</h1>\n";
  ptr +="<h3>Using Access Point(AP) Mode</h3>\n";
  ptr += "</html></body>\n";

  client.println(ptr);  
}
Originally created by @VladimirVecera on GitHub (Jul 19, 2021). Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/1270 I would like to load a web page and I can't. How can I do that? ESP32 (2.0.3 wifimanager) ``` #include <WiFiManager.h> // https://github.com/tzapu/WiFiManager WiFiManager wm; void setup() { WiFi.mode(WIFI_STA); // explicitly set mode, esp defaults to STA+AP Serial.begin(115200); wm.setCountry("US"); wm.setHostname("ESP32"); bool res; res = wm.autoConnect("ESP32"); if(!res) { Serial.println("Error wifi!"); // ESP.restart(); } else { Serial.println(WiFi.localIP()); } } void loop() { WiFiClient client = wm.client.available(); String ptr = "<html><body>\n"; ptr +="<h1>ESP32 Web Server</h1>\n"; ptr +="<h3>Using Access Point(AP) Mode</h3>\n"; ptr += "</html></body>\n"; client.println(ptr); } ```
kerem closed this issue 2026-02-28 01:28:28 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/WiFiManager#1088
No description provided.