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 · 10 comments

Comments

Projects
None yet
9 participants
@ikarisan

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

This comment has been minimized.

Show comment
Hide comment
@msameeruae

msameeruae May 9, 2017

Thanks a million brother. worked for me.

msameeruae commented May 9, 2017

Thanks a million brother. worked for me.

@davidwowa

This comment has been minimized.

Show comment
Hide comment
@davidwowa

davidwowa Jun 24, 2017

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

davidwowa commented Jun 24, 2017

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

@shobhitdua

This comment has been minimized.

Show comment
Hide comment
@shobhitdua

shobhitdua Nov 3, 2017

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

shobhitdua commented Nov 3, 2017

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

This comment has been minimized.

Show comment
Hide comment
@immoslayer

immoslayer 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 ?

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

This comment has been minimized.

Show comment
Hide comment
@roboter

roboter Feb 9, 2018

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

roboter commented Feb 9, 2018

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

@immoslayer

This comment has been minimized.

Show comment
Hide comment
@immoslayer

immoslayer 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

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

This comment has been minimized.

Show comment
Hide comment
@roboter

roboter 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

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

This comment has been minimized.

Show comment
Hide comment
@sznrbrt

sznrbrt Mar 24, 2018

Sounded silly, but actually works @roboter 💯

sznrbrt commented Mar 24, 2018

Sounded silly, but actually works @roboter 💯

@Rhanem

This comment has been minimized.

Show comment
Hide comment
@Rhanem

Rhanem 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..

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

This comment has been minimized.

Show comment
Hide comment
@engrmuhammadshoaib14

engrmuhammadshoaib14 Apr 11, 2018

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

engrmuhammadshoaib14 commented Apr 11, 2018

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment