title: fatal error: ESP8266WiFi.h: No such file or directory
body: <p>I'm trying to make a &quot;home weight&quot; with my ESP32 and display the value using IBMCloud, however I'm running into some issues with the Arduino IDE and my code.</p>
  <p>I get this error:</p>
  <blockquote>
  <p>Arduino:1.8.5 (Windows 10), Tarjeta:&quot;ESP32 Dev Module, QIO, 80MHz, 4MB (32Mb), 921600, None&quot;</p>
  <p>C:\Users\XX\Documents\Arduino\IBM_Watson_Connect\IBM_Watson_Connect.ino:8:25: fatal error: ESP8266WiFi.h: No such file or directory</p>
  <p>compilation terminated.</p>
  <p>exit status 1
  Compiling error for the ESP32 Dev Module card.</p>
  </blockquote>
  <p>I'm using a ESP32 dev board. My code is this:</p>
  <pre><code>    #include &lt;ESP8266WiFi.h&gt;
      #include &lt;PubSubClient.h&gt; // https://github.com/knolleary/pubsubclient/releases/tag/v2.3
  
      #include &quot;HX711.h&quot; //Load Cell Amplifier
      HX711 cell(D2, D4); //Amplifier is connected to these pins on the NodeMCU ESP8266 Board
  
      #define WLAN_SSID       &quot;XXXXX&quot;  
      #define WLAN_PASS       &quot;XXXXX&quot;  
  
      #define ORG &quot;XXXXX&quot;
      #define DEVICE_TYPE &quot;XXXXXX&quot;
      #define DEVICE_ID &quot;XXXXX&quot;
      #define TOKEN &quot;XXXXXXXX&quot;
  
      char server[] = ORG &quot;.messaging.internetofthings.ibmcloud.com&quot;;
      char topic[] = &quot;iot-2/evt/status/fmt/json&quot;;
      char authMethod[] = &quot;use-token-auth&quot;;
      char token[] = TOKEN;
      char clientId[] = &quot;d:&quot; ORG &quot;:&quot; DEVICE_TYPE &quot;:&quot; DEVICE_ID;
  
      WiFiClient wifiClient;
      PubSubClient client(server, 1883, NULL, wifiClient);
  
      void setup() {
  
  
       Serial.begin(115200);
       Serial.println();
  
        // Connect to WiFi access point.
        Serial.println(); Serial.println();
        Serial.print(&quot;Connecting to &quot;);
        Serial.println(WLAN_SSID);
  
        WiFi.begin(WLAN_SSID, WLAN_PASS);
        while (WiFi.status() != WL_CONNECTED) {
          delay(500);
          Serial.print(&quot;.&quot;);
        }
        Serial.println();
  
        Serial.println(&quot;WiFi connected&quot;);
        Serial.println(&quot;IP address: &quot;); Serial.println(WiFi.localIP());
  
      }
  
      int counter = 0;
  
      void loop() {
  
       if (!!!client.connected()) {
       Serial.print(&quot;Reconnecting client to &quot;);
       Serial.println(server);
       while (!!!client.connect(clientId, authMethod, token)) {
       Serial.print(&quot;.&quot;);
       delay(500);
       }
       Serial.println();
       }
  
  
      //----------Get data from load cell and amplifier
  
        long valCalibrated = 0;
        long val = 0;
        float count = 0;
  
  
        count = count + 1;
        val = 0.5 * val    +   0.5 * cell.read();
        valCalibrated =  (val - 4137240) / 234.20;
  
      //----------Send data to IBM Waton IoT Service
  
       String payload = &quot;{\&quot;d\&quot;:{\&quot;weight\&quot;:&quot;;
       payload += valCalibrated;
       payload += &quot;}}&quot;;
  
       Serial.print(&quot;Sending payload: &quot;);
       Serial.println(payload);
  
       if (client.publish(topic, (char*) payload.c_str())) {
       Serial.println(&quot;Publish ok&quot;);
       } else {
       Serial.println(&quot;Publish failed&quot;);
       }
  
       ++counter;
       delay(100); //adjust delay to send more or less reads per unit time
      }
  </code></pre>
  <p>Some places mentioned that the library was missing, that the board wasn't properly selected, the library wasn't updated.. I checked them all.. Arduino is updated, libraries are installed and updated, proper board is selected (I actually have tried all the other Esp32 related boards with the same result)</p>