esp8266easyiot examples not compiling.

7 years 6 months ago - 7 years 6 months ago #3519 by nuesome
For some reason, none of the examples esp8266 examples wont compile on arduino ide 1.6.12. Error compilling for board nodemcu 12e is the error message. The simple blink code works fine. I am very new to all this so any help is greatly appreciated. /*
V1.0 - first version
V1.1 - adopt to new library

Created by Igor Jarc <This email address is being protected from spambots. You need JavaScript enabled to view it.>
See iot-playground.com for details

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
version 2 as published by the Free Software Foundation.
*/
#include <Esp8266EasyIoT.h>
#include <SoftwareSerial.h>

Esp8266EasyIoT esp;

SoftwareSerial serialEsp(10, 11);



#define RELAY_1 13 // Arduino Digital I/O pin number for first relay (second on pin+1 etc)
#define RELAY_ON 1 // GPIO value to write to turn on attached relay
#define RELAY_OFF 0 // GPIO value to write to turn off attached relay


void setup()
{
serialEsp.begin(9600);
Serial.begin(115200);

Serial.println("EasyIoTEsp init");

esp.begin(incomingMessage, 3, &serialEsp, &Serial);
//esp.begin(incomingMessage, 3, &serialEsp);

pinMode(RELAY_1, OUTPUT);

esp.present(1, S_DIGITAL_OUTPUT);
}

void loop()
{
esp.process();
}

void incomingMessage(const Esp8266EasyIoTMsg &message) {
// We only expect one type of message from controller. But we better check anyway.

Serial.println("New message");
if (message.type==V_DIGITAL_VALUE) {
// Change relay state
digitalWrite(message.sensor-1+RELAY_1, message.getBool()?RELAY_ON:RELAY_OFF);

Serial.print("Incoming change for sensor:");
Serial.print(message.sensor);
Serial.print(", New status: ");
Serial.println(message.getBool());
}
}

Please Log in or Create an account to join the conversation.

7 years 6 months ago #3522 by EasyIoT

nuesome wrote: For some reason, none of the examples esp8266 examples wont compile on arduino ide 1.6.12. Error compilling for board nodemcu 12e is the error message. The simple blink code works fine. I am very new to all this so any help is greatly appreciated. /*
V1.0 - first version
V1.1 - adopt to new library

Created by Igor Jarc <This email address is being protected from spambots. You need JavaScript enabled to view it.>
See iot-playground.com for details

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
version 2 as published by the Free Software Foundation.
*/
#include <Esp8266EasyIoT.h>
#include <SoftwareSerial.h>

Esp8266EasyIoT esp;

SoftwareSerial serialEsp(10, 11);



#define RELAY_1 13 // Arduino Digital I/O pin number for first relay (second on pin+1 etc)
#define RELAY_ON 1 // GPIO value to write to turn on attached relay
#define RELAY_OFF 0 // GPIO value to write to turn off attached relay


void setup()
{
serialEsp.begin(9600);
Serial.begin(115200);

Serial.println("EasyIoTEsp init");

esp.begin(incomingMessage, 3, &serialEsp, &Serial);
//esp.begin(incomingMessage, 3, &serialEsp);

pinMode(RELAY_1, OUTPUT);

esp.present(1, S_DIGITAL_OUTPUT);
}

void loop()
{
esp.process();
}

void incomingMessage(const Esp8266EasyIoTMsg &message) {
// We only expect one type of message from controller. But we better check anyway.

Serial.println("New message");
if (message.type==V_DIGITAL_VALUE) {
// Change relay state
digitalWrite(message.sensor-1+RELAY_1, message.getBool()?RELAY_ON:RELAY_OFF);

Serial.print("Incoming change for sensor:");
Serial.print(message.sensor);
Serial.print(", New status: ");
Serial.println(message.getBool());
}
}



If you post compiling errors then maybe someone will know solution. Samples were compiled with Arduino IDE 1.6.5.

Please Log in or Create an account to join the conversation.

7 years 6 months ago #3526 by nuesome
Arduino: 1.6.5 (Windows 7), Board: "NodeMCU 1.0 (ESP-12E Module), 80 MHz, 115200, 4M (1M SPIFFS)"

In file included from esp8266_relay.ino:12:0:
C:\Users\Amber\Documents\Arduino\libraries\Esp8266EasyIoT/Esp8266EasyIoT.h:28:24: fatal error: avr/eeprom.h: No such file or directory
#include <avr/eeprom.h>
^
compilation terminated.
Error compiling.

This report would have more information with
"Show verbose output during compilation"
enabled in File > Preferences.
changed back to 1.6.5 and still have errors. PLEASE HELP

Please Log in or Create an account to join the conversation.

7 years 6 months ago #3527 by nuesome
Arduino: 1.6.5 (Windows 7), Board: "NodeMCU 1.0 (ESP-12E Module), 80 MHz, 115200, 4M (1M SPIFFS)"

Build options changed, rebuilding all

Using library Esp8266EasyIoT in folder: C:\Users\Amber\Documents\Arduino\libraries\Esp8266EasyIoT (legacy)

Using library SoftwareSerial in folder: C:\Users\Amber\AppData\Roaming\Arduino15\packages\esp8266\hardware\esp8266\2.3.0\libraries\SoftwareSerial



C:\Users\Amber\AppData\Roaming\Arduino15\packages\esp8266\tools\xtensa-lx106-elf-gcc\1.20.0-26-gb404fb9-2/bin/xtensa-lx106-elf-g++ -D__ets__ -DICACHE_FLASH -U__STRICT_ANSI__ -IC:\Users\Amber\AppData\Roaming\Arduino15\packages\esp8266\hardware\esp8266\2.3.0/tools/sdk/include -IC:\Users\Amber\AppData\Roaming\Arduino15\packages\esp8266\hardware\esp8266\2.3.0/tools/sdk/lwip/include -IC:\Users\Amber\AppData\Local\Temp\build1707270639065551292.tmp/core -c -w -Os -g -mlongcalls -mtext-section-literals -fno-exceptions -fno-rtti -falign-functions=4 -std=c++11 -MMD -ffunction-sections -fdata-sections -DF_CPU=80000000L -DLWIP_OPEN_SRC -DARDUINO=10605 -DARDUINO_ESP8266_NODEMCU -DARDUINO_ARCH_ESP8266 -DARDUINO_BOARD="ESP8266_NODEMCU" -DESP8266 -IC:\Users\Amber\AppData\Roaming\Arduino15\packages\esp8266\hardware\esp8266\2.3.0\cores\esp8266 -IC:\Users\Amber\AppData\Roaming\Arduino15\packages\esp8266\hardware\esp8266\2.3.0\variants\nodemcu -IC:\Users\Amber\Documents\Arduino\libraries\Esp8266EasyIoT -IC:\Users\Amber\AppData\Roaming\Arduino15\packages\esp8266\hardware\esp8266\2.3.0\libraries\SoftwareSerial C:\Users\Amber\AppData\Local\Temp\build1707270639065551292.tmp\esp8266_relay.cpp -o C:\Users\Amber\AppData\Local\Temp\build1707270639065551292.tmp\esp8266_relay.cpp.o

In file included from esp8266_relay.ino:12:0:
C:\Users\Amber\Documents\Arduino\libraries\Esp8266EasyIoT/Esp8266EasyIoT.h:28:24: fatal error: avr/eeprom.h: No such file or directory
#include <avr/eeprom.h>
^
compilation terminated.
Error compiling.

Please Log in or Create an account to join the conversation.

7 years 2 months ago #3667 by tboldog
The problem is, that you are trying to upload a program to a variant of ESP8266, but the code is made for Arduino and it will not compile for ESP8266. Code using Esp8266EasyIoT.h is made for Arduino using ESP8266 as a wifi modul.
The following user(s) said Thank You: eakin

Please Log in or Create an account to join the conversation.

Time to create page: 0.354 seconds

Forum latest

  • No posts to display.