Common ESP8266 Arduino Errors

Below is a quick reference page for some solutions to common ESP8266 errors I have run into from time to time.

#1: fatal error: avr/pgmspace.h: No such file or directory

This tends to occur when compiling code that did not cater for the ESP8266 module directly. Typically the error message will give you the full path to the offending file, eg:

The solution is simple, open the file (in my case C:\Users\Richard\Documents\Arduino\libraries\LedControl\src/LedControl.h), find the problematic line:

#include <avr/pgmspace.h>

... and replace it with the following code:

#if (defined(__AVR__))
#include <avr\pgmspace.h>
#include <pgmspace.h>

This should fix your failing build.

comments powered by Disqus