-
Notifications
You must be signed in to change notification settings - Fork 492
Firebase stream and firebase setString causing crash! #266
Comments
Hi! |
This is a duplicate of #48. As far as I know there isn't a solution. |
Yes, this looks similar to #48 |
This should be tried again. Due to the following change in upstream repo: And prior changes in this repo that uses external ArduinoJson, this problem might no longer exist. |
@kotl woot! maybe we can keep the streaming connection open thanks to this change now? |
I tested a sketch that I used before when I tried to fix it. It works beautifully now with two instances of FirebaseArduino where one is used for streaming and the other one for setting values. Still 10k of heap left. FirebaseArduino MyFirebaseStream; So I think you can close this one as fixed, including everything else that's open due to crashes with streaming or simultaneous connections. It is probably good idea to recommend everyone to use 2.4.1: The only concern I have left is with intermittent _canReuse still being set to false sometimes in ESP8266HTTPClient.cpp, but I can't reproduce it consistently. I have some ideas to fix this, but really need to reproduce it consistently first. |
@kotl I wonder if we could keep two |
Hi, I have a similar code and I'm using the version 2.4.1 and it works :) |
I have refactored it and code is working and almost ready. Probably in several weeks I will send pull request when I finish the unit tests. You can check it out in my fork: https://github.com/kotl/firebase-arduino |
Pull request #330 |
Closing now that #330 is merged. |
Hi folks,
On LinkNode R8 (relay board equipped with ESP 8266), I am writing an application that I need to run "setString" while firebase streaming. However, as soon as I run "setString" after firebase stream begin function, the board crashes (error shown below). The interesting part is that, sometimes it sets the values in database and it crashes afterwards and sometimes it doesn't even set the value.
I tried many different solutions offered on other relevant issues with no luck. Below is the error code, my code and settings. Any help appreciated.
Error:
Exception (28):
epc1=0x40207f26 epc2=0x00000000 epc3=0x00000000 excvaddr=0x00000000 depc=0x00000000
ctx: cont
sp: 3fff1070 end: 3fff14b0 offset: 01a0
Code:
#include <FirebaseArduino.h>
#include <ESP8266WiFi.h>
// Set these to run example.
#define FIREBASE_HOST "xxx"
#define FIREBASE_AUTH "xxx"
#define WIFI_SSID "xxx"
#define WIFI_PASSWORD "xxx"
String eventType, eventPath, eventData;
FirebaseArduino FirebaseStream, FirebaseShaboo;
// Setup-----------------------------------------------------------------------------------------------
void setup() {
Serial.begin(9800);
pinMode(13, OUTPUT);
pinMode(14, OUTPUT);
byte mac[6];
WiFi.macAddress(mac);
// 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());
FirebaseShaboo.begin(FIREBASE_HOST, FIREBASE_AUTH);
delay(1000);
FirebaseShaboo.setString("message", "Bahoo");
delay(1000);
//Firebase.begin(FIREBASE_HOST, FIREBASE_AUTH);
FirebaseStream.begin(FIREBASE_HOST, FIREBASE_AUTH);
FirebaseStream.stream("/test");
}
int n = 0;
bool set_en = 0;
void loop() {
if (FirebaseStream.available()) {
FirebaseObject event = FirebaseStream.readEvent();
} else if(eventData.indexOf("on")>=0){
digitalWrite(13, HIGH);
digitalWrite(14, HIGH);
Serial.println("ON,ON");
} else if(eventData.indexOf("send")>=0){
set_en = 1;
}
}
Serial.println(ESP.getFreeHeap());
delay(1000);
if (set_en == 1){
set_en = 0;
FirebaseShaboo.setString("message", "Nikki");
delay(1000);
}
Serial.println("Loop");
}
Settings:

The text was updated successfully, but these errors were encountered: