Blynk.Edgent Compilation ERROR: 'WIFI' was not declared is this scope

I’m using an ESP32 and I took the example code and this message appears. How do I resolve it?

Compilation ERROR: ‘WIFI’ was not declared is this scope.

I’m trying to use Blynk.Edgent.
I’m using an ESP32 WROOM 32 - I selected the “ESP32-WROOM-DA Module” from the device list.

It helps if you do a quick search before starting a new topic…

Pete.

I have the same problem and I does not find the solution …

What core version are you using?

Pete.

I am using at the time an ESP32S ( with esp WROOM), but I have exactly the same problem with an ESP32-DevKit (with esp WROOM) and with an ESP32-H2-Devkit M1

That doesn’t answer my question.
You’ve clearly either not read, or not understood the solution in the link I provided in post #2 of this topic.

Downgrade to v2.0.14 of the ESP32 core and it’ll fix your issue.

Pete.

Thank you.

Compiles perfectly now !

Compilation error: ‘WiFi’ was not declared in this scope
I do not understand how it possible, the simple example is not working 6 monthes…

The Edgent example is far from simple, and has been broken by 3rd party changes to the ESP32 core files - something beyond Blynk’s control.

If there was a simple fix to the example then I’m sure it would have been updated to resolve the issue.

There’s a simple workaround.

Pete.

With the updated Espressif ESP32 3.x.x board configuration, I find the Blynk Edgent_ESP32.ino example does not compile.

Solutions is simple: insert this line BEFORE the #include "BlynkEdgent.h" statement
#include "WiFi.h" // <============== I HAD TO ADD THIS TO BLYNK'S EXAMPLE FOR IT TO COMPILE

The updated Edgent_ESP32.ino Example is below. This has been working for me.

/*************************************************************
  Blynk is a platform with iOS and Android apps to control
  ESP32, Arduino, Raspberry Pi and the likes over the Internet.
  You can easily build mobile and web interfaces for any
  projects by simply dragging and dropping widgets.

    Downloads, docs, tutorials: https://www.blynk.io
    Sketch generator:           https://examples.blynk.cc
    Blynk community:            https://community.blynk.cc
    Follow us:                  https://www.fb.com/blynkapp
                                https://twitter.com/blynk_app

  Blynk library is licensed under MIT license
 *************************************************************
  Blynk.Edgent implements:
  - Blynk.Inject - Dynamic WiFi credentials provisioning
  - Blynk.Air    - Over The Air firmware updates
  - Device state indication using a physical LED
  - Credentials reset using a physical Button
 *************************************************************/

/* Fill in information from your Blynk Template here */
/* Read more: https://bit.ly/BlynkInject */
//#define BLYNK_TEMPLATE_ID           "TMPxxxxxx"
//#define BLYNK_TEMPLATE_NAME         "Device"

#define BLYNK_FIRMWARE_VERSION        "0.1.0"

#define BLYNK_PRINT Serial
//#define BLYNK_DEBUG

#define APP_DEBUG

// Uncomment your board, or configure a custom board in Settings.h
//#define USE_ESP32_DEV_MODULE
//#define USE_ESP32C3_DEV_MODULE
//#define USE_ESP32S2_DEV_KIT
//#define USE_WROVER_BOARD
//#define USE_TTGO_T7
//#define USE_TTGO_T_OI

#include "WiFi.h" // <==============  I HAD TO ADD THIS TO BLYNK'S EXAMPLE FOR IT TO COMPILE
#include "BlynkEdgent.h"

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

  BlynkEdgent.begin();
}

void loop() {
  BlynkEdgent.run();
}
2 Likes