• Skip to main content
  • Skip to primary sidebar

RNTLab.com

The Ultimate Shortcut to Learn Electronics and Programming with Open Source Hardware and Software

  • Courses
  • Forum
    • Forum
    • Ask Question
  • Shop
  • Account
  • Blog
  • Login

'class FirebaseStream' has no member named 'payloadLength'

Q&A Forum › Category: ESP32 › 'class FirebaseStream' has no member named 'payloadLength'
1 Vote Up Vote Down
Robert Gillespie asked 4 years ago

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

Question Tags: ESP32, Firebase
10 Answers
0 Vote Up Vote Down
Steve Mercer answered 4 years ago

Try upgrading the Firebase library to the latest version (v2.6.4 as of today).

0 Vote Up Vote Down
Robert Gillespie answered 4 years ago

Will give it a go.  Thanks much.
Bob

0 Vote Up Vote Down
Sara Santos Staff answered 4 years ago

Hi.
As Steve mentioned, please update the library version.
Then, let me know if that solves the issue.
Regards,
Sara

0 Vote Up Vote Down
Robert Gillespie answered 4 years ago

I

0 Vote Up Vote Down
Sara Santos Staff answered 4 years ago

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

0 Vote Up Vote Down
Robert Gillespie answered 4 years ago

Thanks Sara.  Will give it a go.
Bob

0 Vote Up Vote Down
Robert Gillespie answered 4 years ago

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!
 

0 Vote Up Vote Down
Sara Santos Staff answered 4 years ago

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
 

0 Vote Up Vote Down
Robert Gillespie answered 4 years ago

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

0 Vote Up Vote Down
Sara Santos Staff answered 4 years ago

No worries.
I’m glad you found the problem and everything is working now.
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

Primary Sidebar

Login to Ask or Answer Questions

This Forum is private and it’s only available for members enrolled in our Courses.

Login »

Latest Course Updates

  • [eBook Updated] Learn Raspberry Pi Pico/Pico W with MicroPython eBook – Version 1.2 May 26, 2025
  • [New Edition] Build ESP32-CAM Projects eBook – 2nd Edition April 16, 2025

You must be logged in to view this content.

Contact Support - Refunds - Privacy - Terms - MakerAdvisor.com - Member Login

Copyright © 2013-2025 · RandomNerdTutorials.com · All Rights Reserved

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.