Arduino build error

fatal error: BlynkSimpleEsp8266.h: No such file or directory

BlynkSimpleEsp8266.h is the part of the Blynk library for an ESP8266 board. It needs the Blynk library installed and an ESP8266 board chosen.

  • Build error
  • 2 common causes
The message

What the Arduino IDE prints

Output window
sketch.ino:1:10: fatal error: BlynkSimpleEsp8266.h: No such file or directory
    1 | #include <BlynkSimpleEsp8266.h>
      |          ^~~~~~~~~~
compilation terminated.
exit status 1

The ESP32 and the Pico W have headers of their own in the same library.

Mokxi's compiler, clang, words it as 'BlynkSimpleEsp8266.h' file not found.

Causes

The 2 usual causes with the fix

1The board is not an ESP8266

Choose an ESP8266 board, or use the header that matches your board: BlynkSimpleEsp32.h for an ESP32, BlynkSimpleWifi.h for a Pico W.

Broken
#include <BlynkSimpleEsp8266.h>

void setup() {
  Serial.begin(9600);
}

void loop() {
}
Fixed
#define BLYNK_TEMPLATE_ID "TMPL3xYzAbCd"
#define BLYNK_TEMPLATE_NAME "Light Intensity Monitor"
#define BLYNK_AUTH_TOKEN "YourAuthToken"
#define BLYNK_PRINT Serial

#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>

void setup() {
  Serial.begin(115200);
  Blynk.begin(BLYNK_AUTH_TOKEN, "Mokxi-Lab", "breadboard");
}

void loop() {
  Blynk.run();
}

Mokxi’s build tab says: This code is intended to run on the ESP8266 platform!

Try this fix in Mokxi

2The Blynk library is not installed

The header comes with the Blynk library. Mokxi has it built in. In the Arduino IDE, install it once.

  1. Open Sketch, Include Library, Manage Libraries, and search for Blynk.
  2. Install the library named Blynk, by Volodymyr Shymanskyy.
  3. Choose an ESP8266 board, such as NodeMCU, under Tools, Board, and compile again.
FAQ

Questions and answers

Which header do I use for an ESP32?

BlynkSimpleEsp32.h. The ESP8266 and the ESP32 each have their own header in the Blynk library.

Does Blynk work in Mokxi?

Yes, on a simulated Blynk service. Open the Cloud panel to see the values the sketch sends.

What are the BLYNK_TEMPLATE_ID lines?

The Blynk cloud gives each project a template ID, a name and an auth token. They go above the includes.