ESP32 .h files missing from the IDE

I inherited a project for a Feather Huzzah ESP8266 and wanted to use a Feather Huzzah ESP32.
However I have found (so far), that the sketch is using 2 .h files that are not found.

  1. ESP8266WiFi
  2. ESP8266WebServer

I have found what I think is the ESP32 equivalent for the ESP8266WiFi, named WiFi.
but, there is nothing similar for the ESP8266WebServer.

Does anyone know what it is ?
I tried WebServer and ESP32WebServer but no love.

Is this an Arduino issue ? I posted it on the ESP32 forum and have had no responses.

thanks,

hextejas:
I inherited a project for a Feather Huzzah ESP8266 and wanted to use a Feather Huzzah ESP32.
However I have found (so far), that the sketch is using 2 .h files that are not found.

  1. ESP8266WiFi
  2. ESP8266WebServer

These are libraries that come bundled with the ESP8266 boards platform you install via the Arduino IDE's Boards Manager (or manually if you feel like making things difficult for yourself). Libraries bundled with a boards platform are only available when you have one of the boards of that platform selected from the Arduino IDE's Tools > Board menu

hextejas:
I have found what I think is the ESP32 equivalent for the ESP8266WiFi, named WiFi.

That's correct. The ESP32 boards platform comes with a bundled library named WiFi that is the equivalent of the ESP8266 boards platform's bundled ESP8266WiFi library. Note that there are multiple Arduino libraries named "WiFi", so don't get confused. The WiFi library you need is automatically installed along with the ESP32 boards platform and, as long as you don't go installing some random WiFi libraries you find online, will be automatically selected by the Arduino IDE when you have an ESP32 board selected.

hextejas:
but, there is nothing similar for the ESP8266WebServer.

Does anyone know what it is ?

The ESP32 boards platform comes with a bundled library named "WebServer". If you select an ESP32 board from the ARduino IDE's Tools > Board menu and then study the nice example sketches you will find under the File > Examples > WebServer menu, you'll see how to use it.

hextejas:
I tried WebServer and ESP32WebServer but no love.

How did you try it?

hextejas:
Is this an Arduino issue ? I posted it on the ESP32 forum and have had no responses.

You haven't provided enough information for us to say whether there is even an issue. From what I can see, the ESP32 platform developers have been kind enough to provide a WebSErver library with examples along with their boards platform and the Arduino IDE is recognizing this library just fine.

It might be WiFiWebServer

Did you try what I told you to do?

pert:
If you select an ESP32 board from the ARduino IDE's Tools > Board menu and then study the nice example sketches you will find under the File > Examples > WebServer menu, you'll see how to use it.

If yes, please provide a detailed description of the problem you had.

If no, why not?

When I run the compile of the main sketch, a .cpp file calls out the .h files. as here.

/* ask op for local wifi info
 */

#include "Webpage.h"

#include <ESP8266WiFi.h>
#include <ESP8266WebServer.h>
#include <DNSServer.h>


/* set up an Access Point to ask operator for local wifi info, save in NV
 */
void Webpage::askWiFi()
{
	// AP info
	IPAddress ip(192,168,10,10);
	IPAddress gw(192,168,10,10);
	IPAddress nm(255,255,255,0);
	const char *ssid = "SatTrack";

	// start AP
	resetWatchdog();
	WiFi.disconnect(true);
	delay(200);
	WiFi.mode(WIFI_AP);
	if (!WiFi.softAPConfig(ip, gw, nm)) {
	    Serial.println ("Can not configure softAP");
	    return;
	}
	if (!WiFi.softAP (ssid)) {
	    Serial.println ("Can not set AP ssid");
	    return;
	}
	delay(500);
	Serial.print (F("AP IP: ")); Serial.println (WiFi.softAPIP());

	// start HTTP server 
	resetWatchdog();
	WiFiServer remoteServer(80);
	remoteServer.begin();

	// provide clients with an IP pointing back to us
	DNSServer dns;
	dns.start(53, "*", WiFi.softAPIP());

	// repeat until get station info

	int n_info = 0;
	while (n_info < 5) {
	    n_info = 0;

	    // listen for a connection
	    WiFiClient remoteClient;
	    Serial.println ("waiting for client");
	    dns.processNextRequest();
	    do {
		resetWatchdog();
		delay(100);
		remoteClient = remoteServer.available();
	    } while (!remoteClient);
	    Serial.print (F("client connected from ")); Serial.println (remoteClient.remoteIP());

	    // send the WiFI setup page
	    sendAskPage (remoteClient);

	    // look for GET down to blank line
	    char c, line[1024];
	    size_t linel = 0;
	    char *GET = NULL;
	    uint32_t to = millis();
	    while ((c = readNextClientChar (remoteClient, &to)) != 0) {
		if (!GET) {
		    if (c == '\n') {
			line[linel] = '\0';
			linel = 0;
			if (strstr (line, "GET "))
			    GET = line;
		    } else if (linel < sizeof(line)-1)
			line[linel++] = c;
		} else {
		    if (c == '\n') {
			if (linel == 1)	// just \r\n
			    break;
			linel = 0;
		    } else {
			linel++;
		    }
		}
	    }
	    remoteClient.stop();
	    Serial.println (line);

	    // abort if no GET
	    if (!GET) {
		Serial.println (line);
		Serial.println ("No GET");
		break;
	    }

	    // crack GET for desired info
	    char *wifi_id = strstr (line, "id=");
	    char *wifi_pw = strstr (line, "pw=");
	    char *wifi_ip = strstr (line, "ip=");
	    char *wifi_nm = strstr (line, "nm=");
	    char *wifi_gw = strstr (line, "gw=");

	    // TODO: check for special characters

	    // save if looks reasonable
	    char *eos;
	    if (wifi_id) {
		wifi_id += 3;
		eos = strchr (wifi_id, '&');
		if (eos) {
		    *eos = '\0';
		    strncpy (nv->ssid, wifi_id, sizeof(nv->ssid));
		    nv->put();
		    Serial.println(nv->ssid);
		    n_info++;
		}
	    }
	    if (wifi_pw) {
		wifi_pw += 3;
		eos = strchr (wifi_pw, '&');
		if (eos) {
		    *eos = '\0';
		    strncpy (nv->pw, wifi_pw, sizeof(nv->pw));
		    nv->put();
		    Serial.println(nv->pw);
		    n_info++;
		}
	    }
	    if (wifi_ip) {
		wifi_ip += 3;
		eos = strchr (wifi_ip, '&');
		if (eos) {
		    *eos = '\0';
		    nv->IP.fromString (wifi_ip);
		    nv->put();
		    Serial.println(nv->IP.toString());
		    n_info++;
		}
	    }
	    if (wifi_nm) {
		wifi_nm += 3;
		eos = strchr (wifi_nm, '&');
		if (eos) {
		    *eos = '\0';
		    nv->NM.fromString (wifi_nm);
		    nv->put();
		    Serial.println(nv->NM.toString());
		    n_info++;
		}
	    }
	    if (wifi_gw) {
		wifi_gw += 3;
		eos = strchr (wifi_gw, ' ');
		if (eos) {
		    *eos = '\0';
		    nv->GW.fromString (wifi_gw);
		    nv->put();
		    Serial.println(nv->GW.toString());
		    n_info++;
		}
	    }
	}

	// shut down AP
	WiFi.softAPdisconnect(true);
	delay(200);
}

/* transmit the page that lets operator enter wifi info
 */
void Webpage::sendAskPage(WiFiClient client)
{
        sendHTMLHeader (client);

        // DO NOT HAND EDIT THE FOLLOWING HTML .. use "preppage.pl"
        // DO NOT REMOVE THIS LINE 333333333333333333333333333333
        client.print (F(
            "<!DOCTYPE html> \r\n"
            "<html> \r\n"
            "<head> \r\n"
            "    <meta http-equiv='Content-Type' content='text/html; charset=UTF-8' /> \r\n"
            " \r\n"
            "    <style> \r\n"
            "        body { \r\n"
            "            background-color:#888; \r\n"
            "            font-family:sans-serif; \r\n"
            "            font-size:13px; \r\n"
            "        } \r\n"
            " \r\n"
            "        table { \r\n"
            "            border-collapse: collapse; \r\n"
            "            border: 3px solid brown; \r\n"
            "            background-color:#F8F8F8; \r\n"
            "            float:left; \r\n"
            "        } \r\n"
            " \r\n"
            "        td { \r\n"
            "            padding: 4px; \r\n"
            "        } \r\n"
            " \r\n"
            "        th { \r\n"
            "            padding: 6px; \r\n"
            "            border: 1px solid brown; \r\n"
            "        } \r\n"
            " \r\n"
            "        input { \r\n"
            "            width : 90%; \r\n"
            "        } \r\n"
            " \r\n"
            "    </style> \r\n"
            " \r\n"
            "</head> \r\n"
            "<body> \r\n"
            " \r\n"
            "    <form>  \r\n"
            "    <table> \r\n"
            "        <tr> \r\n"
            "            <th colspan='2' > \r\n"
            "                Enter local WiFi information: \r\n"
            "            </th> \r\n"
            "        </tr> \r\n"
            "        <tr> \r\n"
            "            <td> \r\n"
            "                SSID: \r\n"
            "            </td> \r\n"
            "            <td> \r\n"
            "                <input name='id'></input> \r\n"
            "            </td> \r\n"
            "        </tr> \r\n"
            "        <tr> \r\n"
            "            <td> \r\n"
            "                Password: \r\n"
            "            </td> \r\n"
            "            <td> \r\n"
            "                <input name='pw'></input> \r\n"
            "            </td> \r\n"
            "        </tr> \r\n"
            "        <tr> \r\n"
            "            <td> \r\n"
            "                IP: \r\n"
            "            </td> \r\n"
            "            <td> \r\n"
            "                <input name='ip'></input> \r\n"
            "            </td> \r\n"
            "        </tr> \r\n"
            "        <tr> \r\n"
            "            <td> \r\n"
            "                Network mask: \r\n"
            "            </td> \r\n"
            "            <td> \r\n"
            "                <input name='nm'></input> \r\n"
            "            </td> \r\n"
            "        </tr> \r\n"
            "        <tr> \r\n"
            "            <td> \r\n"
            "                Gateway: \r\n"
            "            </td> \r\n"
            "            <td> \r\n"
            "                <input name='gw'></input> \r\n"
            "            </td> \r\n"
            "        </tr> \r\n"
            "        <tr> \r\n"
            "            <td colspan='2' > \r\n"
            "                <button type='submit'>Send</button> \r\n"
            "            </td> \r\n"
            "    </table> \r\n"
            "    </form> \r\n"
            "</body> \r\n"
            "</html> \r\n"
        ));
        // DO NOT REMOVE THIS LINE 444444444444444444444444444444
}

So, I need to try and fine a suitable replacement for the missing .h files. I am hoping that I will not have to do too much re-coding to get it to work, cause this looks messy.

pert:
Did you try what I told you to do?
If yes, please provide a detailed description of the problem you had.

If no, why not?

I am looking at the WebServer examples now and there are quite a few of them.
Would anyone like to take a look at my .cpp file and tell me which WebServer example comes the closest ?