mobizt / Firebase-ESP32

[DEPRECATED]🔥 Firebase RTDB Arduino Library for ESP32. The complete, fast, secured and reliable Firebase Arduino client library that supports CRUD (create, read, update, delete) and Stream operations.
MIT License
414 stars 119 forks source link

Assistance Needed: "Response Payload Read Timed Out" #293

Closed Helmar0 closed 9 months ago

Helmar0 commented 9 months ago

Dear Suwatchai K., I hope this message finds you well. I'm reaching out regarding an issue I've encountered while using the Firebase ESP32 library (version 4.4.8) for my project. After following your advice and utilizing the new example for version 4.4.x, I've noticed that while the random "Connection Refused" error has reduced, a new issue has emerged. This new issue, "response payload read timed out," is not random; it consistently occurs after every 20th transaction.

The Problem:

My Request: I would greatly appreciate your assistance in diagnosing and resolving this specific issue. Given your expertise with the Firebase ESP32 library, any insights or suggestions you can provide to tackle this problem would be invaluable.

Thank you for your prompt attention to this matter, and for maintaining this essential library.

Best regards, Helmar Alvares

Here is an example of the code I am using to update Firebase data:

include

// ... FirebaseJson jsontest; FirebaseData fbdo; FirebaseAuth auth; FirebaseConfig config; // ... config.api_key = API_KEY; config.database_url = FIREBASE_HOST; config.signer.tokens.legacy_token = FIREBASE_AUTH; config.token_status_callback = tokenStatusCallback; Firebase.reconnectNetwork(true); fbdo.setBSSLBufferSize(16384 / Rx buffer size in bytes from 512 - 16384 /, 16384 / Tx buffer size in bytes from 512 - 16384 /); Firebase.begin(&config, &auth); Firebase.setDoubleDigits(5); config.timeout.networkReconnect = 10 * 1000;

jsontest.clear(); // ... Setting various Firebase values ...

if (Firebase.updateNode(fbdo, "test", jsontest)) { Serial.println(" ---> test PASSED: updateNode!"); } else { Serial.println(" ---> REASON: " + fbdo.errorReason()); }

// ...

mobizt commented 9 months ago

This is too much memory reserved, only 2k or 4k is recommended.

fbdo.setBSSLBufferSize(16384 /* Rx buffer size in bytes from 512 - 16384 /, 16384 / Tx buffer size in bytes from 512 - 16384 */);

This error is because, your data at the node, you want to update is large or your internet connection is slow or unstable.

If you confirm that your internet is fine, you should keep in mind that you are working with limited memory device, the returned payload may be larger than device can be handled.

I recommend using updateNodeSilent instead for silently update.