Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"avr/pgmspace.h: No such file or directory" on ESP8266. Patch inside. #5

Open
ikarisan opened this issue Apr 6, 2016 · 11 comments
Open

Comments

@ikarisan
Copy link

ikarisan commented Apr 6, 2016

Hi!

I am using this library together with my NodeMCU and other ESP8266-12 modules.
But the library/compiler throws the following error: "fatal error: avr/pgmspace.h: No such file or directory".

I found the following solution:

In Sodaq_DS3231.cpp you have to replace

#include <avr\pgmspace.h>

with

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

This works fine for me.

@msameeruae
Copy link

Thanks a million brother. worked for me.

@davidwowa
Copy link

it worked for me to, with MPU6050, thanks!!

@shobhitdua
Copy link

avr\pgmspace.h
This file is included in EspDrv.cpp in my case, not in Sodaq_DS3231.cpp, still I did the same thing but it didn't work. By the way, I'm trying to program Arduino for using generic esp8266 as a shield(MQTT server communication ).
Plz help
Thank you

@immoslayer
Copy link

immoslayer commented Feb 9, 2018

Hey. I have a problem with "\Arduino\libraries\ESP8266wifi-master/SerialESP8266wifi.h:27:26: fatal error: avr/pgmspace.h: No such file or directory"
I did replace "#include <avr\pgmspace.h>with #if (defined(AVR)) #include <avr\pgmspace.h> #else
#include <pgmspace.h> #endif"

I tried to just "#include <pgmspace.h>" too - thats doesnt work too.
Could You help me ?

@roboter
Copy link

roboter commented Feb 9, 2018

there 2 files with this line, I replaced in both and it compiled

@immoslayer
Copy link

immoslayer commented Feb 9, 2018

I'm using in my project libraries like this: <WiFi.h>, <WiFiClient.h> <WiFiServer.h> <WiFiUdp.h> "Wire.h" "Time.h" "DS1307RTC.h" "DHT.h" "OneWire.h" "DallasTemperature.h" "LiquidCrystal.h" "TimeLib.h" <SerialESP8266wifi.h> .
In which one i should replace ? (timelib its ok)

I really really thanks for your answers

@roboter
Copy link

roboter commented Feb 9, 2018

every time you see a message "avr/pgmspace.h: No such file or directory"
there also a line and file where this error is from
replace all

@sznrbrt
Copy link

sznrbrt commented Mar 24, 2018

Sounded silly, but actually works @roboter 💯

@Rhanem
Copy link

Rhanem commented Mar 25, 2018

i downloaded this file from here :
https://github.com/mikalhart/galileo-Pgmspace.h/
next i edit the line to:
#include <pgmspace.h>
is working..

@engrmuhammadshoaib14
Copy link

In my case , I add following code in max6675.cpp. Now its working perfectly.
//#include <avr/pgmspace.h>
#if (defined(AVR))
#include <avr\pgmspace.h>
#else
#include <pgmspace.h>
#endif

#define _delay_ms(ms) delayMicroseconds((ms) * 1000)
//#include <util/delay.h>
#ifdef avr
#include <util/delay.h>
#endif

@pengwenbin7
Copy link

Install avr-libc.
see: avr-libc:<avr/pgmspace.h>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants