Go Down

Topic: Error compiling for board NondeMCU 1.0 (ESP-12E Module) (Read 335 times) previous topic - next topic

Alorax

I have an issue uploading the sketch code from my arduino to Nondemcu v3...
Basically, the code says to take data from the sensor and send it to the firebase but I have this error I'm not sure why is doesn't work.

My Nondemcu setting is:

Board: NondeMCU 1.0 (ESP-12E Module)
Upload speed: 115200
CPU freq: 80 MHz
flash size: 4m(no spiffs)
Debug port: disabled
Debug level: none
Iwlp variant: v2 lower memory
VTables: flash
exceptions: enabled
Erase flash: only sketch
Port: Com6

and here is the code:

Code: [Select]


#include <FirebaseArduino.h>
#include <ESP8266WiFi.h>     //wifi library
#define WIFI_SSID "wifi001"  //replace SSID with your wifi username
#define WIFI_PASSWORD "1234" //replace PWD with your wifi password
#define WIFI_LED D5          //connect a led to any of the gpio pins of the board and replace pin_number with it eg. D4
#define FIREBASE_HOST "some_firebase_host" //link of api
#define FIREBASE_AUTH "secret"             //database secret

int trig = 8;
int echo = 7;

long microsecondsToInches(float microseconds)
{
    return microseconds / 74 / 2;
}

long microsecondsToCentimeters(float microseconds)
{
    return microseconds / 29 / 2;
}


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

    pinMode(WIFI_LED, OUTPUT); //define pinmodes
    WiFi.begin(WIFI_SSID, WIFI_PASSWORD);
    //connect to wifi
    while (WiFi.status() != WL_CONNECTED)
    { //wait till connected to WiFi
        delay(100);
        digitalWrite(WIFI_LED, LOW); //Blink the light till connected to WiFi
        delay(100);
        digitalWrite(WIFI_LED, HIGH);
        Serial.print(".");
    }

    Serial.println("");
    Serial.println("WiFi connected");
    digitalWrite(WIFI_LED, HIGH);
    Serial.println("IP address: ");
    Serial.println(WiFi.localIP());

    Firebase.begin(FIREBASE_HOST, FIREBASE_AUTH); //connect to Database
    pinMode(trig, OUTPUT);
    pinMode(echo, INPUT);

    delay(1000);
}

void loop()
{
    String firebaseResult = firebaseGet();
    delay(100);

    // Transmitting pulse
    digitalWrite(trig, LOW);
    delayMicroseconds(2);
    digitalWrite(trig, HIGH);
    delayMicroseconds(10);
    digitalWrite(trig, LOW);

    float t = 0, h = 0, hp = 0, inches = 0, cm = 0, offset = 1.8;

    if (firebaseResult == "ON")
    {
        //code to happen if the status is ON

        // Waiting for pulse
        t = pulseIn(echo, HIGH);

        // Calculating distance

        h = t;
        hp = h;
        h = t / offset; //half the bottle (16)
        h = h - 7;      // water height, 0 - 50 cm   - 0-16cm
                        //
        hp = (2 * h);   // distance in %, 0-100 %

        cm = microsecondsToCentimeters(hp);
        Serial.print(cm);
        Serial.print("\n");

        delay(1000);
    }
    else
    {
        //code to happen if the status is OFF
    }
}

srnet

Quote
Basically, the code says to take data from the sensor and send it to the firebase but I have this error I'm not sure why is doesn't work.
And 'this error' is ?
$50SAT is now Silent (but probably still running)
http://www.50dollarsat.info/
http://www.loratracker.uk/

Alorax

The compilation terminates with this error message "Error compiling for board NodeMCU 1.0 (ESP-12E Module)."

pert

Please do this:
  • File > Preferences > Show verbose output during: > compilation (check)  > OK
  • Sketch > Verify/Compile
  • After the compilation fails you'll see a button on the right side of the orange bar "Copy error messages". Click that button.
  • Paste the error messages in a reply here USING CODE TAGS (</> button on the forum toolbar).


If the length of the output exceeds the forum's 9000 character limit, save it in a txt file and post it here as an attachment. If you click the "Reply" button you'll see the "Attachments and other options" link.

Alorax

Please do this:
  • File > Preferences > Show verbose output during: > compilation (check)  > OK
  • Sketch > Verify/Compile
  • After the compilation fails you'll see a button on the right side of the orange bar "Copy error messages". Click that button.
  • Paste the error messages in a reply here USING CODE TAGS (</> button on the forum toolbar).


If the length of the output exceeds the forum's 9000 character limit, save it in a txt file and post it here as an attachment. If you click the "Reply" button you'll see the "Attachments and other options" link.
Code: [Select]
Arduino: 1.8.8 (Windows 10), Board: "NodeMCU 1.0 (ESP-12E Module), 80 MHz, Flash, Enabled, 4M (no SPIFFS), v2 Lower Memory, Disabled, None, Only Sketch, 115200"

C:\Program Files (x86)\Arduino\arduino-builder -dump-prefs -logger=machine -hardware C:\Program Files (x86)\Arduino\hardware -hardware C:\Users\Elias\AppData\Local\Arduino15\packages -tools C:\Program Files (x86)\Arduino\tools-builder -tools C:\Program Files (x86)\Arduino\hardware\tools\avr -tools C:\Users\Elias\AppData\Local\Arduino15\packages -built-in-libraries C:\Program Files (x86)\Arduino\libraries -libraries C:\Users\Elias\Documents\Arduino\libraries -fqbn=esp8266:esp8266:nodemcuv2:xtal=80,vt=flash,exception=enabled,eesz=4M,ip=lm2f,dbg=Disabled,lvl=None____,wipe=none,baud=115200 -ide-version=10808 -build-path C:\Users\Elias\AppData\Local\Temp\arduino_build_11798 -warnings=none -build-cache C:\Users\Elias\AppData\Local\Temp\arduino_cache_920460 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.esptool.path=C:\Users\Elias\AppData\Local\Arduino15\packages\esp8266\tools\esptool\2.5.0-3-20ed2b9 -prefs=runtime.tools.esptool-2.5.0-3-20ed2b9.path=C:\Users\Elias\AppData\Local\Arduino15\packages\esp8266\tools\esptool\2.5.0-3-20ed2b9 -prefs=runtime.tools.xtensa-lx106-elf-gcc.path=C:\Users\Elias\AppData\Local\Arduino15\packages\esp8266\tools\xtensa-lx106-elf-gcc\2.5.0-3-20ed2b9 -prefs=runtime.tools.xtensa-lx106-elf-gcc-2.5.0-3-20ed2b9.path=C:\Users\Elias\AppData\Local\Arduino15\packages\esp8266\tools\xtensa-lx106-elf-gcc\2.5.0-3-20ed2b9 -prefs=runtime.tools.mkspiffs.path=C:\Users\Elias\AppData\Local\Arduino15\packages\esp8266\tools\mkspiffs\2.5.0-3-20ed2b9 -prefs=runtime.tools.mkspiffs-2.5.0-3-20ed2b9.path=C:\Users\Elias\AppData\Local\Arduino15\packages\esp8266\tools\mkspiffs\2.5.0-3-20ed2b9 -verbose C:\Users\Elias\Desktop\level_meter\mustwork\water_level_fb\water_level_fb.ino
C:\Program Files (x86)\Arduino\arduino-builder -compile -logger=machine -hardware C:\Program Files (x86)\Arduino\hardware -hardware C:\Users\Elias\AppData\Local\Arduino15\packages -tools C:\Program Files (x86)\Arduino\tools-builder -tools C:\Program Files (x86)\Arduino\hardware\tools\avr -tools C:\Users\Elias\AppData\Local\Arduino15\packages -built-in-libraries C:\Program Files (x86)\Arduino\libraries -libraries C:\Users\Elias\Documents\Arduino\libraries -fqbn=esp8266:esp8266:nodemcuv2:xtal=80,vt=flash,exception=enabled,eesz=4M,ip=lm2f,dbg=Disabled,lvl=None____,wipe=none,baud=115200 -ide-version=10808 -build-path C:\Users\Elias\AppData\Local\Temp\arduino_build_11798 -warnings=none -build-cache C:\Users\Elias\AppData\Local\Temp\arduino_cache_920460 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.esptool.path=C:\Users\Elias\AppData\Local\Arduino15\packages\esp8266\tools\esptool\2.5.0-3-20ed2b9 -prefs=runtime.tools.esptool-2.5.0-3-20ed2b9.path=C:\Users\Elias\AppData\Local\Arduino15\packages\esp8266\tools\esptool\2.5.0-3-20ed2b9 -prefs=runtime.tools.xtensa-lx106-elf-gcc.path=C:\Users\Elias\AppData\Local\Arduino15\packages\esp8266\tools\xtensa-lx106-elf-gcc\2.5.0-3-20ed2b9 -prefs=runtime.tools.xtensa-lx106-elf-gcc-2.5.0-3-20ed2b9.path=C:\Users\Elias\AppData\Local\Arduino15\packages\esp8266\tools\xtensa-lx106-elf-gcc\2.5.0-3-20ed2b9 -prefs=runtime.tools.mkspiffs.path=C:\Users\Elias\AppData\Local\Arduino15\packages\esp8266\tools\mkspiffs\2.5.0-3-20ed2b9 -prefs=runtime.tools.mkspiffs-2.5.0-3-20ed2b9.path=C:\Users\Elias\AppData\Local\Arduino15\packages\esp8266\tools\mkspiffs\2.5.0-3-20ed2b9 -verbose C:\Users\Elias\Desktop\level_meter\mustwork\water_level_fb\water_level_fb.ino
Using board 'nodemcuv2' from platform in folder: C:\Users\Elias\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.0-beta2
Using core 'esp8266' from platform in folder: C:\Users\Elias\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.0-beta2
Detecting libraries used...
"C:\\Users\\Elias\\AppData\\Local\\Arduino15\\packages\\esp8266\\tools\\xtensa-lx106-elf-gcc\\2.5.0-3-20ed2b9/bin/xtensa-lx106-elf-g++" -D__ets__ -DICACHE_FLASH -U__STRICT_ANSI__ "-IC:\\Users\\Elias\\AppData\\Local\\Arduino15\\packages\\esp8266\\hardware\\esp8266\\2.5.0-beta2/tools/sdk/include" "-IC:\\Users\\Elias\\AppData\\Local\\Arduino15\\packages\\esp8266\\hardware\\esp8266\\2.5.0-beta2/tools/sdk/lwip2/include" "-IC:\\Users\\Elias\\AppData\\Local\\Arduino15\\packages\\esp8266\\hardware\\esp8266\\2.5.0-beta2/tools/sdk/libc/xtensa-lx106-elf/include" "-IC:\\Users\\Elias\\AppData\\Local\\Temp\\arduino_build_11798/core" -c -w -Os -g -mlongcalls -mtext-section-literals -fno-rtti -falign-functions=4 -std=c++11 -ffunction-sections -fdata-sections -fexceptions -w -x c++ -E -CC -DF_CPU=80000000L -DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 -DARDUINO=10808 -DARDUINO_ESP8266_NODEMCU -DARDUINO_ARCH_ESP8266 "-DARDUINO_BOARD=\"ESP8266_NODEMCU\"" -DESP8266 "-IC:\\Users\\Elias\\AppData\\Local\\Arduino15\\packages\\esp8266\\hardware\\esp8266\\2.5.0-beta2\\cores\\esp8266" "-IC:\\Users\\Elias\\AppData\\Local\\Arduino15\\packages\\esp8266\\hardware\\esp8266\\2.5.0-beta2\\variants\\nodemcu" "C:\\Users\\Elias\\AppData\\Local\\Temp\\arduino_build_11798\\sketch\\water_level_fb.ino.cpp" -o nul
"C:\\Users\\Elias\\AppData\\Local\\Arduino15\\packages\\esp8266\\tools\\xtensa-lx106-elf-gcc\\2.5.0-3-20ed2b9/bin/xtensa-lx106-elf-g++" -D__ets__ -DICACHE_FLASH -U__STRICT_ANSI__ "-IC:\\Users\\Elias\\AppData\\Local\\Arduino15\\packages\\esp8266\\hardware\\esp8266\\2.5.0-beta2/tools/sdk/include" "-IC:\\Users\\Elias\\AppData\\Local\\Arduino15\\packages\\esp8266\\hardware\\esp8266\\2.5.0-beta2/tools/sdk/lwip2/include" "-IC:\\Users\\Elias\\AppData\\Local\\Arduino15\\packages\\esp8266\\hardware\\esp8266\\2.5.0-beta2/tools/sdk/libc/xtensa-lx106-elf/include" "-IC:\\Users\\Elias\\AppData\\Local\\Temp\\arduino_build_11798/core" -c -w -Os -g -mlongcalls -mtext-section-literals -fno-rtti -falign-functions=4 -std=c++11 -ffunction-sections -fdata-sections -fexceptions -w -x c++ -E -CC -DF_CPU=80000000L -DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 -DARDUINO=10808 -DARDUINO_ESP8266_NODEMCU -DARDUINO_ARCH_ESP8266 "-DARDUINO_BOARD=\"ESP8266_NODEMCU\"" -DESP8266 "-IC:\\Users\\Elias\\AppData\\Local\\Arduino15\\packages\\esp8266\\hardware\\esp8266\\2.5.0-beta2\\cores\\esp8266" "-IC:\\Users\\Elias\\AppData\\Local\\Arduino15\\packages\\esp8266\\hardware\\esp8266\\2.5.0-beta2\\variants\\nodemcu" "-IC:\\Users\\Elias\\Documents\\Arduino\\libraries\\firebase-arduino-master\\src" "C:\\Users\\Elias\\AppData\\Local\\Temp\\arduino_build_11798\\sketch\\water_level_fb.ino.cpp" -o nul
In file included from C:\Users\Elias\Documents\Arduino\libraries\firebase-arduino-master\src/FirebaseArduino.h:22:0,

                 from C:\Users\Elias\Desktop\level_meter\mustwork\water_level_fb\water_level_fb.ino:2:

C:\Users\Elias\Documents\Arduino\libraries\firebase-arduino-master\src/Firebase.h:26:25: fatal error: ArduinoJson.h: No such file or directory

 #include <ArduinoJson.h>

                         ^

compilation terminated.

Using library firebase-arduino-master at version 0.1 in folder: C:\Users\Elias\Documents\Arduino\libraries\firebase-arduino-master
exit status 1
Error compiling for board NodeMCU 1.0 (ESP-12E Module).

Alorax

Update: I have uninstalled the latest version and downloaded the 1.6.9 and right now I am facing this error now. Not sure why it says error but I'm quite certain that the code is correct

Code: [Select]
Arduino: 1.6.9 (Windows 10), Board: "NodeMCU 1.0 (ESP-12E Module), 80 MHz, Serial, 115200, 4M (3M SPIFFS)"

C:\Users\Elias\Desktop\arduino-1.6.9\arduino-builder -dump-prefs -logger=machine -hardware "C:\Users\Elias\Desktop\arduino-1.6.9\hardware" -hardware "C:\Users\Elias\AppData\Local\Arduino15\packages" -tools "C:\Users\Elias\Desktop\arduino-1.6.9\tools-builder" -tools "C:\Users\Elias\Desktop\arduino-1.6.9\hardware\tools\avr" -tools "C:\Users\Elias\AppData\Local\Arduino15\packages" -built-in-libraries "C:\Users\Elias\Desktop\arduino-1.6.9\libraries" -libraries "C:\Users\Elias\Documents\Arduino\libraries" -fqbn=esp8266:esp8266:nodemcuv2:CpuFrequency=80,UploadTool=esptool,UploadSpeed=115200,FlashSize=4M3M -ide-version=10609 -build-path "C:\Users\Elias\AppData\Local\Temp\build04e7d75336a0c7c2dc5483bb757a53d2.tmp" -warnings=none -prefs=build.warn_data_percentage=75 -verbose "C:\Users\Elias\Desktop\level_meter\mustwork\now\now.ino"
C:\Users\Elias\Desktop\arduino-1.6.9\arduino-builder -compile -logger=machine -hardware "C:\Users\Elias\Desktop\arduino-1.6.9\hardware" -hardware "C:\Users\Elias\AppData\Local\Arduino15\packages" -tools "C:\Users\Elias\Desktop\arduino-1.6.9\tools-builder" -tools "C:\Users\Elias\Desktop\arduino-1.6.9\hardware\tools\avr" -tools "C:\Users\Elias\AppData\Local\Arduino15\packages" -built-in-libraries "C:\Users\Elias\Desktop\arduino-1.6.9\libraries" -libraries "C:\Users\Elias\Documents\Arduino\libraries" -fqbn=esp8266:esp8266:nodemcuv2:CpuFrequency=80,UploadTool=esptool,UploadSpeed=115200,FlashSize=4M3M -ide-version=10609 -build-path "C:\Users\Elias\AppData\Local\Temp\build04e7d75336a0c7c2dc5483bb757a53d2.tmp" -warnings=none -prefs=build.warn_data_percentage=75 -verbose "C:\Users\Elias\Desktop\level_meter\mustwork\now\now.ino"
"C:\Users\Elias\AppData\Local\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\Elias\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.1.0/tools/sdk/include" -c -w -Os -g -mlongcalls -mtext-section-literals -fno-exceptions -fno-rtti -falign-functions=4 -std=c++11  -ffunction-sections -fdata-sections -w -x c++ -E -CC -DF_CPU=80000000L   -DARDUINO=10609 -DARDUINO_ESP8266_ESP12 -DARDUINO_ARCH_ESP8266  -DESP8266 "-IC:\Users\Elias\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.1.0\cores\esp8266" "-IC:\Users\Elias\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.1.0\variants\nodemcu" "C:\Users\Elias\AppData\Local\Temp\build04e7d75336a0c7c2dc5483bb757a53d2.tmp\sketch\now.ino.cpp" -o "nul"
"C:\Users\Elias\AppData\Local\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\Elias\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.1.0/tools/sdk/include" -c -w -Os -g -mlongcalls -mtext-section-literals -fno-exceptions -fno-rtti -falign-functions=4 -std=c++11  -ffunction-sections -fdata-sections -w -x c++ -E -CC -DF_CPU=80000000L   -DARDUINO=10609 -DARDUINO_ESP8266_ESP12 -DARDUINO_ARCH_ESP8266  -DESP8266 "-IC:\Users\Elias\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.1.0\cores\esp8266" "-IC:\Users\Elias\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.1.0\variants\nodemcu" "-IC:\Users\Elias\Documents\Arduino\libraries\firebase-arduino-master\src" "C:\Users\Elias\AppData\Local\Temp\build04e7d75336a0c7c2dc5483bb757a53d2.tmp\sketch\now.ino.cpp" -o "nul"
"C:\Users\Elias\AppData\Local\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\Elias\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.1.0/tools/sdk/include" -c -w -Os -g -mlongcalls -mtext-section-literals -fno-exceptions -fno-rtti -falign-functions=4 -std=c++11  -ffunction-sections -fdata-sections -w -x c++ -E -CC -DF_CPU=80000000L   -DARDUINO=10609 -DARDUINO_ESP8266_ESP12 -DARDUINO_ARCH_ESP8266  -DESP8266 "-IC:\Users\Elias\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.1.0\cores\esp8266" "-IC:\Users\Elias\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.1.0\variants\nodemcu" "-IC:\Users\Elias\Documents\Arduino\libraries\firebase-arduino-master\src" "C:\Users\Elias\AppData\Local\Temp\build04e7d75336a0c7c2dc5483bb757a53d2.tmp\sketch\now.ino.cpp" -o "C:\Users\Elias\AppData\Local\Temp\build04e7d75336a0c7c2dc5483bb757a53d2.tmp\preproc\ctags_target_for_gcc_minus_e.cpp"
In file included from C:\Users\Elias\Documents\Arduino\libraries\firebase-arduino-master\src/FirebaseArduino.h:22:0,

                from C:\Users\Elias\Desktop\level_meter\mustwork\now\now.ino:1:

C:\Users\Elias\Documents\Arduino\libraries\firebase-arduino-master\src/Firebase.h:26:25: fatal error: ArduinoJson.h: No such file or directory

#include <ArduinoJson.h>

                        ^

compilation terminated.

Using library firebase-arduino-master at version 0.1 in folder: C:\Users\Elias\Documents\Arduino\libraries\firebase-arduino-master
exit status 1
Error compiling for board NodeMCU 1.0 (ESP-12E Module).

pert

When you see a "No such file or directory" error it almost always means you need to install the library that contains the missing file.

Often the code you're compiling will come with documentation (either a comment or separate document) that tells you where to get the library dependencies.

In other cases the author of the code will not have been so kind and you'll need to go on a hunt for the missing library.

A good place to start is the Arduino IDE's Library Manager:
  • Sketch > Include Library > Manage Libraries...
  • In the "Filter your search..." box, type some keywords you have gleaned from the missing file name.
  • Scroll through the results for the right library. Click on it.
  • Click "Install".
  • Wait for installation to finish.
  • Click "Close".
  • Try compiling your code again.


If you have no luck in Library Manager then load up your favorite search engine and do a search for the missing filename. You will often get multiple results. If you have a lot of results you might add "arduino" as an additional search keyword. I will usually prefer results on github.com since that is where most Arduino libraries are hosted and downloading from there is fast and easy. In some cases there will be multiple libraries that contain the given filename and you'll need to do some evaluation to determine which seems the most appropriate, then try it out. After downloading the library you found you'll need to install it. This requires a different process than the Library Manager installation. You will find instructions here:

Go Up