RTDB 100th "set" fails with ESP32 #64
Closed
HannuToppinen
started this conversation in
General
Replies: 2 comments
-
That is a ESP32 If you still want to use ESP32 |
Beta Was this translation helpful? Give feedback.
0 replies
-
Thanks for Info! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
Any idea what's wrong when 100th set to RTDB fails.
Some info & observations:
Always 100th.
In case of async "set", sw stops receiving callbacks after 99 successful "set"s.
Tested with different timings etc.
Seems like TCP gets broken (SSL error seen with WiFiClientSecure. With ESP_SSLClient: TCP receive timeout).
Tested with sync & async.
Tested with TCP keepalive.
Reconnect happens after error when using ESP_SSLClient -> works again for next 99 "sets"s.
Code based on FirebaseClient examples.
HW: ESP32.
Maybe bad quess .. but can it be so that RTDB sees each "set" as new "connection" and closes one because of 100 connection limit?
Error log sample (With ESP_SSLClient):
"
Debug msg: Terminating the server connection...
Error msg: TCP receive time out, code: -3
....
Debug msg: Terminating the server connection... >> Connecting to server...
"
Code sample :
....
static int iCBWaiting = 0;
void loop()
{
app.loop();
Database.loop();
static unsigned long last = 0;
if(millis() - last < 2000)
return;
last = millis();
if(!app.ready()) {
Serial.println("***** !app.ready() *****");
return;
}
if(iCBWaiting != 0) {
Serial.print("***** iCBWaiting:");
Serial.println(iCBWaiting);;
return;
}
Database.set(aClient, "/test/int", a, asyncCB);
iCBWaiting ++;
}
void asyncCB(AsyncResult &aResult)
{
if(aCBWaiting > 0)
aCBWaiting--;
...
Beta Was this translation helpful? Give feedback.
All reactions