Go Down

Topic: Missing libraries when compiling with Arduino IDE? (Read 275 times) previous topic - next topic

nikko4913

Jul 02, 2016, 11:45 am Last Edit: Jul 02, 2016, 11:58 am by nikko4913
Hello.
First up, i'm new to this way of using the Arduino IDE. Installing packages from downloaded content and installing new boards. That's probably also where the problem to this is, but i just need to get it pointed out.

The thing is, that whenever i try to compile a piece of code in the Arduino IDE, and want to upload it to my ESP8266-01, I always get an error when there's a normal arduino library included in the sketch. It seems the IDE can't find the normal Arduino modules, when compiling for a Generic ESP8266 Module. This is an example of what i get, when trying to compile a sketch with the library avr/eeprom.h included:


Code: [Select]
C:\Users\XXXX\Documents\Arduino\libraries\Esp8266EasyIoT/Esp8266EasyIoT.h:28:24: fatal error: avr/eeprom.h: No such file or directory

 #include <avr/eeprom.h>

                        ^

compilation terminated.

exit status 1
Error compiling for board Generic ESP8266 Module.



The weird thing is that this doesn't seem to happen when compiling for one of the standard boards.

Obviuosly the libraries i added myself are there, but the standard ones that should work for all boards, doesn't work. Or what? Am i mistaken, and do i have to download the missing libraries, because they are not available by standard?

Here's some information on my setup:
- ESP8266-01 connected to a FT232RL FTDI with 2xAA batteries as power supply.
- Arduino IDE version 1.6.9 (Also tried 1.6.5 and also 1.6.5 as portable, but no luck)
- Added this: https://github.com/esp8266/Arduino on version 2.3.0-rc2 (Also tried: 2.2.0, 2.1.0, 2.0.0 and both stable and staging)

It is worth noting that i can upload sketches without libraries in them.

I have no idea what i'm doing wrong.... Do you know it?

Thank you :))

pert

you need to change
Code: [Select]
#include <avr/eeprom.h>
to
Code: [Select]
#include <EEPROM.h>
The esp8266 core's EEPROM library works similar to the Arduino EEPROM library(https://www.arduino.cc/en/Reference/EEPROM) but is a bit different in some important ways, see the EEPROM section of https://github.com/esp8266/Arduino/blob/master/doc/libraries.md. This library is already included with the esp8266 core. You can find examples in File > Examples > EEPROM when you have one of the ESP8266 boards selected in Tools > Board.

Both these libraries have a different API from avr/eeprom.h so you will need to make some changes to any code you have written for that API. The avr on avr/eeprom.h is a reference to the AVR architecture of the standard Arduino boards such as the Uno. The ESP8266 is a completely different architecture and any code written specifically for AVR won't work on ESP8266. The authors of the esp8266 Arduino core have done a very good job of trying to make things work in a similar way to the standard Arduino boards but there are definitely some differences you will encounter that make it not so beginner friendly to work with.

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy