I’m taking the Firebase course and I’m up to section 4.3 successfully. I get the following message when I try to compile the sketch.
‘class FirebaseStream’ has no member named ‘payloadLength’
The section of code is as follows:
// 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();
//This is the size of stream payload received (current and max value)
//Max payload size is the payload size under the stream path since the stream connected
//and read once and will not update until stream reconnection takes place.
//This max value will be zero as no payload received in case of ESP8266 which
//BearSSL reserved Rx buffer size is less than the actual stream payload.
Serial.printf(“Received stream payload size: %d (Max. %d)\n\n”,data.payloadLength(), data.maxPayloadLength());
}
I’ve searched for the references to data.payloadLength() or data.maxPayloadLength() but can’t find them. I’m using the code I think as in the ebook.
Thanks for guidance.
Bob
Hi.
As Steve mentioned, please update the library version.
Then, let me know if that solves the issue.
Regards,
Sara
Hi.
It seems the error is related to the Firebase Library version.
Use library version 2.3.7, which is the version we used for those examples.
Regards,
Sara
I have the 3.3 sketch working as shown in the ebook. I am now on 3.4 sketch. It does compile but I have an error I do not understand. The wifi connects and then I get the following message.
stream begin error, Missing required credentials e.g. path, config.database_url and auth token.
I feel that I’m missing some code but I can’t find it. Help!
Hi.
Does it display any other information?
Did you insert all the required credentials? User email and password, database URL, project API key, etc?
Regards,
Sara
Hi Sara:
I should apologize to you for always bugging you. This time I printed all of your code from the lesson and went line by line to compare with what I have in sketch. I found that I had the // Update database path for listening and the command line on the same line. The sketch never saw the listernerPath command. So sorry to keep bothering you. Have a good weekend.
Regards,
Bob