FirebaseExtended / firebase-arduino

Arduino samples for Firebase.
Apache License 2.0
943 stars 494 forks source link

Sometimes showing error and auto reset my nod mcu #495

Closed ScitiveR closed 4 years ago

ScitiveR commented 4 years ago

Sometimes showing this -

Exception (9): epc1=0x4020b254 epc2=0x00000000 epc3=0x00000000 excvaddr=0x38707399 depc=0x00000000

stack>>>

ctx: cont sp: 3ffffc80 end: 3fffffc0 offset: 0190 3ffffe10: 00000000 00000001 3ffffed4 3ffee978
3ffffe20: 0000000b 3ffee940 3ffefff0 40205848
3ffffe30: 3ffe8794 000001bb 3ffefff0 40206710
3ffffe40: 3ffe8848 0000003b 3ffefff0 40206b3c
3ffffe50: 0000003b 3ffee940 0000002e 402035b8
3ffffe60: 3ffffea8 0000003b 3ffffe90 402074d8
3ffffe70: 3ffee93c 3ffffe90 3ffe8848 3fffff10
3ffffe80: 3ffee93c 3ffffed4 3ffeffec 40204e7b
3ffffe90: 3fff02ec 003b003f 00fffed4 3fff00ac
3ffffea0: 003e003f 00ffff8c 3fff0084 001d001f
3ffffeb0: 00fe87de 3ffee938 3fffff96 3fffff10
3ffffec0: 3ffee93c 3ffe87c5 3ffefd94 40202bf4
3ffffed0: 3ffe87de 3fff0120 3ffefe54 3ffeea14
3ffffee0: 3fffff8c 3fffff10 3ffe87de 4020357c
3ffffef0: 3fffff18 3fffff30 3fffff30 3ffeea14
3fffff00: 3fffff8c 3ffefd94 3ffee938 40203e6d
3fffff10: 3ffee978 3ffefe60 004e4f20 40209219
3fffff20: 3fffdad0 3ffee938 3fffff80 40203eae
3fffff30: 4010528d 04cb628d 3ffeea70 00000000
3fffff40: 0000000a 3ffeea70 000007d0 3ffeea14
3fffff50: 3fffdad0 0000000a 3fffff8c 402074d8
3fffff60: 3fffdad0 3fffff8c 3ffe873f 4020750e
3fffff70: 3fffdad0 00000000 3ffee9d4 40201194
3fffff80: 00000000 00000000 00000001 5f44454c
3fffff90: 54415453 8a005355 3ffee9d4 40100175
3fffffa0: 3fffdad0 00000000 3ffee9d4 40208358
3fffffb0: feefeffe feefeffe 3ffe8580 40100c5d
<<<stack<<<

//---------------------------------------------------------------------------------------------------------- // json library used - ArduinoJson-5.13.2

`#include // esp8266 library

include // firebase library

define FIREBASE_HOST "xxxxxxxxx.firebaseio.com" // the project name address from firebase id

define FIREBASE_AUTH "xxxxxxxxxxxxxxxxxxxxxxxx" // the secret key generated from firebase

define WIFI_SSID "xx" // input your home or public wifi name

define WIFI_PASSWORD "xxxxxxxxxxx" //password of wifi ssid

String fireStatus = ""; // led status received from firebase int led = 4; // for external led void setup() { Serial.begin(9600); delay(1000); pinMode(LED_BUILTIN, OUTPUT);
pinMode(led, OUTPUT);
WiFi.begin(WIFI_SSID, WIFI_PASSWORD); //try to connect with wifi Serial.print("Connecting to "); Serial.print(WIFI_SSID); while (WiFi.status() != WL_CONNECTED) { Serial.print("."); delay(500); } Serial.println(); Serial.print("Connected to "); Serial.println(WIFI_SSID); Serial.print("IP Address is : "); Serial.println(WiFi.localIP()); //print local IP address Firebase.begin(FIREBASE_HOST, FIREBASE_AUTH); // connect to firebase //Firebase.setString("LED_STATUS", "OFF"); //send initial string of led status }

void loop() { delay(2000); fireStatus = Firebase.getString("LED_STATUS"); // get ld status input from firebase if (fireStatus == "1") { // compare the input of led status received from firebase Serial.println("Led Turned ON");
digitalWrite(LED_BUILTIN, LOW); // make bultin led ON digitalWrite(led, HIGH); delay(20);// make external led ON } else if (fireStatus == "0") { // compare the input of led status received from firebase Serial.println("Led Turned OFF"); digitalWrite(LED_BUILTIN, HIGH); // make bultin led OFF digitalWrite(led, LOW); delay(10);// make external led OFF } else { Serial.println("Wrong Credential! Please send ON/OFF"); } }`

angelbarusta commented 4 years ago

The same happens to me, I have loaded the example and the same happens, the firebasearduino library is the most current (02-2020)

angelbarusta commented 4 years ago

I am having the following problem just like @ScitiveR, when updating Firebase-arduino-master library

I receive the Exception after a few minutes when using Firebase.getInt(); , if i don't use Firebase.getInt(); the problem does not arise. clarifying that I have corroborated my credentials #define FIREBASE_HOST and #define FIREBASE_AUTH correctly

Annex data for the reproduction of the problem:

BOARD: NODEMCU V3 ESP8266: V2.7.1 IDE: V1.8.5 json library used - ArduinoJson-5.13.2 : https://github.com/bblanchon/ArduinoJson/tree/v5.13.1 firebase-arduino: https://github.com/FirebaseExtended/firebase-arduino

FINGERPRINT: static const char kFirebaseFingerprint[] = "03:D6:42:23:03:D1:0C:06:73:F7:E2:BD:29:47:13:C3:22:71:37:1B"; // 2020-02

CODE:

`[code]

include

include

include

include

include

include

// // Copyright 2015 Google Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // FirebaseDemo_ESP8266 is a sample that demo the different functions // of the FirebaseArduino API.

include

include

// Set these to run example.

define FIREBASE_HOST "***.firebaseio.com"

define FIREBASE_AUTH "***"

define WIFI_SSID "**"

define WIFI_PASSWORD "*****"

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

// connect to wifi. WiFi.begin(WIFI_SSID, WIFI_PASSWORD); Serial.print("connecting"); while (WiFi.status() != WL_CONNECTED) { Serial.print("."); delay(500); } Serial.println(); Serial.print("connected: "); Serial.println(WiFi.localIP());

Firebase.begin(FIREBASE_HOST, FIREBASE_AUTH); }

int n = 0;

void loop() { // set value Firebase.setInt("HOME/number", 42); int number = Firebase.getInt("HOME/number"); // handle error if (Firebase.failed()) { Serial.print("setting /number failed:"); Serial.println(Firebase.error());
return; }

Serial.println(number);

} [/code] `

image

EXCEPTION: Exception 9: LoadStoreAlignmentCause: Load or store to an unaligned address PC: 0x4020b4d8: HTTPClient::connected() at C:\Users\NAME\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.1\libraries\ESP 8266HTTPClient\src\ESP8266HTTPClient.cpp line 471 EXCVADDR: 0x6e616bad

Decoding stack results 0x40205a1c: HTTPClient::disconnect(bool) at C:\Users\NAME\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.1\libraries\ESP8266HTTPClient\src\ESP8266HTTPClient.cpp line 434 0x402068e4: HTTPClient::end() at C:\Users\NAME\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.1\libraries\ESP8266HTTPClient\src\ESP8266HTTPClient.cpp line 425 0x40206d10: HTTPClient::begin(String, unsigned short, String, String) at C:\Users\NAME\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.1\libraries\ESP8266HTTPClient\src\ESP8266HTTPClient.cpp line 379 0x40201e7c: std::string::_Rep::_M_destroy(std::allocator const&) at c:\users\NAME\appdata\local\arduino15\packages\esp8266\tools\xtensa-lx106-elf-gcc\2.5.0-4-b40a506\xtensa-lx106-elf\include\c++\4.8.2\bits/basic_string.tcc line 452 0x4020775c: String::copy(char const, unsigned int) at C:\Users\NAME\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.1\cores\esp8266\WString.cpp line 214 0x402037b7: FirebaseHttpClientEsp8266::begin(std::string const&, std::string const&) at C:\Users\NAME\Documents\Arduino\libraries\firebase-arduino-master\src\FirebaseHttpClient_Esp8266.cpp line 51 0x402014ac: FirebaseRequest::sendRequest(std::string const&, std::string const&, char, std::string const&, std::string const&) at C:\Users\USER\Documents\Arduino\libraries\firebase-arduino-master\src\Firebase.cpp line 73 0x40206d8c: HardwareSerial::write(unsigned char const, unsigned int) at C:\Users\NAME\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.1\cores\esp8266/HardwareSerial.h line 164 0x40201e40: std::basic_string , std::allocator >::basic_string(char const, std::allocator const&) at c:\users\NAME\appdata\local\arduino15\packages\esp8266\tools\xtensa-lx106-elf-gcc\2.5.0-4-b40a506\xtensa-lx106-elf\include\c++\4.8.2\bits/basic_string.tcc line 218 0x402035f8: FirebaseArduino::set(String const&, ArduinoJson::JsonVariant const&) at C:\Users\NAME\Documents\Arduino\libraries\firebase-arduino-master\src\FirebaseArduino.cpp line 94 0x40207713: String::reserve(unsigned int) at C:\Users\NAME\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.1\cores\esp8266\WString.cpp line 146 0x4020364d: FirebaseArduino::setInt(String const&, int) at C:\Users\NAME\Documents\Arduino\libraries\firebase-arduino-master\src\FirebaseArduino.cpp line 74 0x40207792: String::String(char const*) at C:\Users\NAME\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.1\cores\esp8266\WString.cpp line 36 0x4020110c: loop() at C:\Users\NAME\Documents\Arduino\FirebaseDemo_ESP8266/FirebaseDemo_ESP8266.ino line 62 0x40100175: esp_schedule() at C:\Users\NAME\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.1\cores\esp8266\core_esp8266_main.cpp line 125 0x40208574: loop_wrapper() at C:\Users\NAME\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.1\cores\esp8266\core_esp8266_main.cpp line 197 `

The problem persists since the new update of the firebase-arduino-master library, despite changing cards and with the direct example codes of the library, my temporary solution is to use firebase.stream() to control the get(), or just change your library for now.

we wait for a solution ...

angelbarusta commented 4 years ago

2.7.1

@ScitiveR I have solved the above by changing the ESP8266 library from version 2.7.1 to version 2.5.2 I will be testing the same code that so far has worked correctly for me, If it works after a while I will notify you to close this issue.

ScitiveR commented 4 years ago

I am having the following problem just like @ScitiveR, when updating Firebase-arduino-master library

I receive the Exception after a few minutes when using Firebase.getInt(); , if i don't use Firebase.getInt(); the problem does not arise. clarifying that I have corroborated my credentials #define FIREBASE_HOST and #define FIREBASE_AUTH correctly

Annex data for the reproduction of the problem:

BOARD: NODEMCU V3 ESP8266: V2.7.1 IDE: V1.8.5 json library used - ArduinoJson-5.13.2 : https://github.com/bblanchon/ArduinoJson/tree/v5.13.1 firebase-arduino: https://github.com/FirebaseExtended/firebase-arduino

FINGERPRINT: static const char kFirebaseFingerprint[] = "03:D6:42:23:03:D1:0C:06:73:F7:E2:BD:29:47:13:C3:22:71:37:1B"; // 2020-02

CODE:

`[code]

include

include

include

include

include

include

// // Copyright 2015 Google Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // FirebaseDemo_ESP8266 is a sample that demo the different functions // of the FirebaseArduino API.

include

include

// Set these to run example.

define FIREBASE_HOST "***.firebaseio.com"

define FIREBASEAUTH "**" #define WIFI_SSID "**" #define WIFIPASSWORD "********"

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

// connect to wifi. WiFi.begin(WIFI_SSID, WIFI_PASSWORD); Serial.print("connecting"); while (WiFi.status() != WL_CONNECTED) { Serial.print("."); delay(500); } Serial.println(); Serial.print("connected: "); Serial.println(WiFi.localIP());

Firebase.begin(FIREBASE_HOST, FIREBASE_AUTH); }

int n = 0;

void loop() { // set value Firebase.setInt("HOME/number", 42); int number = Firebase.getInt("HOME/number"); // handle error if (Firebase.failed()) { Serial.print("setting /number failed:"); Serial.println(Firebase.error()); return; }

Serial.println(number);

} [/code] `

image

EXCEPTION: Exception 9: LoadStoreAlignmentCause: Load or store to an unaligned address PC: 0x4020b4d8: HTTPClient::connected() at C:\Users\NAME\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.1\libraries\ESP 8266HTTPClient\src\ESP8266HTTPClient.cpp line 471 EXCVADDR: 0x6e616bad

Decoding stack results 0x40205a1c: HTTPClient::disconnect(bool) at C:\Users\NAME\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.1\libraries\ESP8266HTTPClient\src\ESP8266HTTPClient.cpp line 434 0x402068e4: HTTPClient::end() at C:\Users\NAME\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.1\libraries\ESP8266HTTPClient\src\ESP8266HTTPClient.cpp line 425 0x40206d10: HTTPClient::begin(String, unsigned short, String, String) at C:\Users\NAME\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.1\libraries\ESP8266HTTPClient\src\ESP8266HTTPClient.cpp line 379 0x40201e7c: std::string::_Rep::_M_destroy(std::allocator const&) at c:\users\NAME\appdata\local\arduino15\packages\esp8266\tools\xtensa-lx106-elf-gcc\2.5.0-4-b40a506\xtensa-lx106-elf\include\c++\4.8.2\bits/basic_string.tcc line 452 0x4020775c: String::copy(char const, unsigned int) at C:\Users\NAME\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.1\cores\esp8266\WString.cpp line 214 0x402037b7: FirebaseHttpClientEsp8266::begin(std::string const&, std::string const&) at C:\Users\NAME\Documents\Arduino\libraries\firebase-arduino-master\src\FirebaseHttpClient_Esp8266.cpp line 51 0x402014ac: FirebaseRequest::sendRequest(std::string const&, std::string const&, char, std::string const&, std::string const&) at C:\Users\USER\Documents\Arduino\libraries\firebase-arduino-master\src\Firebase.cpp line 73 0x40206d8c: HardwareSerial::write(unsigned char const, unsigned int) at C:\Users\NAME\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.1\cores\esp8266/HardwareSerial.h line 164 0x40201e40: std::basic_string , std::allocator >::basic_string(char const, std::allocator const&) at c:\users\NAME\appdata\local\arduino15\packages\esp8266\tools\xtensa-lx106-elf-gcc\2.5.0-4-b40a506\xtensa-lx106-elf\include\c++\4.8.2\bits/basic_string.tcc line 218 0x402035f8: FirebaseArduino::set(String const&, ArduinoJson::JsonVariant const&) at C:\Users\NAME\Documents\Arduino\libraries\firebase-arduino-master\src\FirebaseArduino.cpp line 94 0x40207713: String::reserve(unsigned int) at C:\Users\NAME\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.1\cores\esp8266\WString.cpp line 146 0x4020364d: FirebaseArduino::setInt(String const&, int) at C:\Users\NAME\Documents\Arduino\libraries\firebase-arduino-master\src\FirebaseArduino.cpp line 74 0x40207792: String::String(char const*) at C:\Users\NAME\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.1\cores\esp8266\WString.cpp line 36 0x4020110c: loop() at C:\Users\NAME\Documents\Arduino\FirebaseDemo_ESP8266/FirebaseDemo_ESP8266.ino line 62 0x40100175: esp_schedule() at C:\Users\NAME\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.1\cores\esp8266\core_esp8266_main.cpp line 125 0x40208574: loop_wrapper() at C:\Users\NAME\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.1\cores\esp8266\core_esp8266_main.cpp line 197 `

The problem persists since the new update of the firebase-arduino-master library, despite changing cards and with the direct example codes of the library, my temporary solution is to use firebase.stream() to control the get(), or just change your library for now.

we wait for a solution ...

hi found a solution. other firebase library working perfect. please go to arduino library manager and search firebase and then install another 2 firebase libraries named "Firebase ESP8266 Client"and "FirebaseJason". Hope it'll help.

angelbarusta commented 4 years ago

2.7.1

@ScitiveR He resuelto lo anterior cambiando la biblioteca ESP8266 de la versión 2.7.1 a la versión 2.5.2. Probaré el mismo código que hasta ahora ha funcionado correctamente para mí. Si funciona después de un tiempo, le notificaré que cierre este problema.

This solution has been perfect since I have had no failures.

ScitiveR commented 4 years ago

2.7.1

@ScitiveR He resuelto lo anterior cambiando la biblioteca ESP8266 de la versión 2.7.1 a la versión 2.5.2. Probaré el mismo código que hasta ahora ha funcionado correctamente para mí. Si funciona después de un tiempo, le notificaré que cierre este problema.

This solution has been perfect since I have had no failures.

ok