-1

I use ESP32 board. I want to get the content from google sheet. my reference code is as below The error was ESP8266WiFi.h: No such file or directory. Does anyone give me some suggestion? Thanks

`#include <ESP8266WiFi.h>
 #include "HTTPSRedirect.h"
 const char* ssid = " ";
 const char* password = " ";
 const char* host = "script.google.com";
 const char *GScriptId = "";
 const int httpsPort = 443;
 HTTPSRedirect* client ;
 void setup(){
     WiFi.begin(ssid, password);
     client = new HTTPSRedirect(httpsPort);
     client->setPrintResponseBody(true);
     client->setContentTypeHeader("application/json");
     client->connect(host, httpsPort);
 }
 void loop() {
     String url3 = String("/macros/s/") + GScriptId + "/exec?&id=";       
     if (client->GET(url3, host)){
         Serial.println("GET SUCCESS");
     }  
     delay(4000);                          
 }`
user1430445
  • 13
  • 1
  • 6

1 Answers1

3

You're building for an ESP32. The ESP32 is not an ESP8266. ESP8266WiFi.h is, oddly enough, for the ESP8266, not the ESP32. It's just WiFi.h on the ESP32.

romkey
  • 6,218
  • 3
  • 16
  • 12
  • i have tryied the wifi.h. compiler can pass but i can not get the information from google sheet. – user1430445 Dec 18 '20 at 21:35
  • That’s a different problem. You should post that as a new StackOverflow question with details to get help with it. – romkey Dec 18 '20 at 21:48