Working through the examples from Firebase Web App with ESP32 and ESP8266 ebook and came across the following compilation error in Streaming_Database_ESP32_Arduino_IDE.ino:
‘class FirebaseStream’ has no member named ‘to’
Same error with the Streaming_Database_ESP8266_Arduino_IDE.ino file.
Here is the code segment, last line is where the error occurs:
// Callback function that runs on database changes
void streamCallback(FirebaseStream data){
Serial.printf(“stream path, %s\nevent path, %s\ndata type, %s\nevent type, %s\n\n”,
data.streamPath().c_str(),
data.dataPath().c_str(),
data.dataType().c_str(),
data.eventType().c_str());
printResult(data); //see addons/RTDBHelper.h
Serial.println();
// Get the path that triggered the function
String streamPath = String(data.dataPath());
/* When it first runs, it is triggered on the root (/) path and returns a JSON with all key
and values of that path.So, we can get all values from the database and updated the GPIO
states, PWM, and message on OLED*/
if (data.dataTypeEnum() == fb_esp_rtdb_data_type_json){
FirebaseJson *json = data.to<FirebaseJson *>();
Typo?
Yes. This happened me after copy paste, First bring Serial.printf code in one line and then split.
Hi.
What is the Firebase library version you have installed in your Arduino IDE?
Regards,
Sara
I’ve resolved the issue. I had installed version 2.3.7 of the of the Firebase library, as illustrated on page 41 of the Firebase Web App eBook. Everything worked fine until I tried to compile the Streaming_Database_ESP32_Arduino_IDE.ino example.
After upgrading the library to the latest version, 2.6.2, the example compiles with no errors.
Love your site and you’re examples always excellent! Keep up the good work.
Great!
I’m glad the issue is solved.
Thanks for following and supporting our work.
I’ll mark this issue as resolved.
If you need further help, you just need to open a new question in our forum.
Regards,
Sara