WiFi examples not compiling

I started haveing compiling errors with ESP32 boards thast have compiled fine in the past
I am getting the following errors
fatal error: esp32/spiram.h: No such file or directory
error: #error Touch IDF driver Not supported!

I spent time googling etc and finally I tried a basic example from the Arduino WiFi library; WIFIScan.ino.

*
 *  This sketch demonstrates how to scan WiFi networks.
 *  The API is based on the Arduino WiFi Shield library, but has significant changes as newer WiFi functions are supported.
 *  E.g. the return value of `encryptionType()` different because more modern encryption is supported.
 */
#include "WiFi.h"

void setup()
{
    Serial.begin(115200);

    // Set WiFi to station mode and disconnect from an AP if it was previously connected.
    WiFi.mode(WIFI_STA);
    WiFi.disconnect();
    delay(100);

    Serial.println("Setup done");
}

void loop()
{
    Serial.println("Scan start");

    // WiFi.scanNetworks will return the number of networks found.
    int n = WiFi.scanNetworks();
    Serial.println("Scan done");
    if (n == 0) {
        Serial.println("no networks found");
    } else {
        Serial.print(n);
        Serial.println(" networks found");
        Serial.println("Nr | SSID                             | RSSI | CH | Encryption");
        for (int i = 0; i < n; ++i) {
            // Print SSID and RSSI for each network found
            Serial.printf("%2d",i + 1);
            Serial.print(" | ");
            Serial.printf("%-32.32s", WiFi.SSID(i).c_str());
            Serial.print(" | ");
            Serial.printf("%4d", WiFi.RSSI(i));
            Serial.print(" | ");
            Serial.printf("%2d", WiFi.channel(i));
            Serial.print(" | ");
            switch (WiFi.encryptionType(i))
            {
            case WIFI_AUTH_OPEN:
                Serial.print("open");
                break;
            case WIFI_AUTH_WEP:
                Serial.print("WEP");
                break;
            case WIFI_AUTH_WPA_PSK:
                Serial.print("WPA");
                break;
            case WIFI_AUTH_WPA2_PSK:
                Serial.print("WPA2");
                break;
            case WIFI_AUTH_WPA_WPA2_PSK:
                Serial.print("WPA+WPA2");
                break;
            case WIFI_AUTH_WPA2_ENTERPRISE:
                Serial.print("WPA2-EAP");
                break;
            case WIFI_AUTH_WPA3_PSK:
                Serial.print("WPA3");
                break;
            case WIFI_AUTH_WPA2_WPA3_PSK:
                Serial.print("WPA2+WPA3");
                break;
            case WIFI_AUTH_WAPI_PSK:
                Serial.print("WAPI");
                break;
            default:
                Serial.print("unknown");
            }
            Serial.println();
            delay(10);
        }
    }
    Serial.println("");

    // Delete the scan result to free memory for code below.
    WiFi.scanDelete();

    // Wait a bit before scanning again.
    delay(5000);
}

and I get the same errors.
If you can help me fuix the examples then I can probably fix my other files.

Thanks
Bill

I forgot to add that I am using the Sparkfun ESPThing Plus C board.

Please, post the complete error report, and place it in its own code block, just like you did with the sketch.

Ensure your ESP board support is current it seems Espressif release 3.x fails, when release 2.x still works.

The Espressif company updated the core and some libraries, which broke a lot of functioning code.

Either update the code to work properly with the new core/libraries or reinstall the old version of the ESP32 board support and libraries.

An internet search with relevant parts of the error messages often turns up helpful comments on other fora.

I removed ESP32 ver 3.20(board libraries) and installed 2.0.17 and everything is fixed.
Thank you , you saved a lot of my files.
Sounds like a industry snafu.
How do I update my code to work with the new libraries; everything I GOOGLED ends up going nowhere.
Is Espressif working on a new version that does not destroy everyone's work or will all the example programs etc have to be rewritten.

Thanks for your help

That code compiles OK for me with Arduino ESP32 Core 3.1.1.

I tried ESP32 ver 3.1.1 and 3.0.0.

They didn’t compile and gave the same errors, ESP32 ver 2.017 and earlier worked.

I hope Espressif puts out an update to correct this.

Thanks for your help

Then something else is wrong. After fixing the syntax error in the beginning comment lines, the code in your first post compiled fine with v3.1.1.

It compiles, there's nothing to correct, at least with v3.1.1. I did not try compiling it with any other versions.

The file I send in first post was the most basic program I could fins. I did that so it would be easier to troubleshoot.

The file I am using include more libraries so there may be more conflicts with these extra libraries.

Attached is the file I am working on and it only compiles in ESP 2.0.17 or earlier

Thanks again for your help.

Bill

(attachments)

ESP32_STAND_ALONE_DATALOGGER.ino (18.1 KB)

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.