Closed djmick closed 1 year ago
The library works normally and there is nothing updated that involved this issue. This is not the library issue unless your network issue which you should use other AP to access the internet or reset your router or change your device or power supply.
I will check again and update.
I'm seeing a clear difference between 4.3.2 & 4.3.3
here's serial log using 4.3.2 Opening port Port open
Connected with IP: 10.0.0.121
Firebase Client v4.3.2
01/21/2023 05:37:03 PM Token info: type = id token (GITKit token), status = on request
01/21/2023 05:37:08 PM Token info: type = id token (GITKit token), status = ready
RTDB User Path: /users/xxxxxxxxxxxxxxxxxxxxxxxxxxxx 01/21/2023 05:37:08 PM
01/21/2023 05:37:09 PM stream timed out, resuming...
sream path, /users/xxxxxxxxxxxxxxxxxxxxxxxxxxxx event path, / data type, json event type, put
Pretty printed JSON data: { "dht": { "humitity": "19%", "lastUpdated": 1674330519425, "temperature": "71°F" }, "serverTimeStamp": 1674333984382 } Iterate JSON data:
0, Type: object, Name: dht, Value: {"humitity":"19%","lastUpdated":1674330519425,"temperature":"71°F"} 1, Type: object, Name: humitity, Value: "19%" 2, Type: object, Name: lastUpdated, Value: 1674330519425 3, Type: object, Name: temperature, Value: "71°F" 4, Type: object, Name: serverTimeStamp, Value: 1674333984382
Received stream payload size: 147 (Max. 147)
01/21/2023 05:37:39 PM
01/21/2023 05:38:09 PM Token info: type = id token (GITKit token), status = on refreshing
01/21/2023 05:38:14 PM Token info: type = id token (GITKit token), status = ready
01/21/2023 05:38:14 PM
01/21/2023 05:38:39 PM
01/21/2023 05:39:09 PM
01/21/2023 05:39:15 PM Token info: type = id token (GITKit token), status = on refreshing
01/21/2023 05:39:20 PM Token info: type = id token (GITKit token), status = ready
same code after clean install of 4.3.3 Opening port Port open
Connected with IP: 10.0.0.121
Firebase Client v4.3.3
01/21/2023 05:42:07 PM Token info: type = id token (GITKit token), status = on request
01/21/2023 05:42:08 PM Token info: type = id token (GITKit token), status = ready
RTDB User Path: /users/xxxxxxxxxxxxxxxxxxxxxxxxxxxx 01/21/2023 05:42:08 PM
01/21/2023 05:42:09 PM stream timed out, resuming...
sream path, /users/xxxxxxxxxxxxxxxxxxxxxxxxxxxx event path, / data type, json event type, put
Pretty printed JSON data: { "dht": { "humitity": "19%", "lastUpdated": 1674330519425, "temperature": "71°F" }, "serverTimeStamp": 1674333984382 } Iterate JSON data:
0, Type: object, Name: dht, Value: {"humitity":"19%","lastUpdated":1674330519425,"temperature":"71°F"} 1, Type: object, Name: humitity, Value: "19%" 2, Type: object, Name: lastUpdated, Value: 1674330519425 3, Type: object, Name: temperature, Value: "71°F" 4, Type: object, Name: serverTimeStamp, Value: 1674333984382
Received stream payload size: 147 (Max. 147)
01/21/2023 05:42:13 PM stream timed out, resuming...
error code: -3, reason: not connected
01/21/2023 05:42:19 PM stream timed out, resuming...
error code: -3, reason: not connected
Port open
01/21/2023 05:42:30 PM Token info: type = id token (GITKit token), status = ready
RTDB User Path: /users/xxxxxxxxxxxxxxxxxxxxxxxxxxxx 01/21/2023 05:42:30 PM sream path, /users/xxxxxxxxxxxxxxxxxxxxxxxxxxxx event path, / data type, json event type, put
Pretty printed JSON data: { "dht": { "humitity": "19%", "lastUpdated": 1674330519425, "temperature": "71°F" }, "serverTimeStamp": 1674333984382 } Iterate JSON data:
0, Type: object, Name: dht, Value: {"humitity":"19%","lastUpdated":1674330519425,"temperature":"71°F"} 1, Type: object, Name: humitity, Value: "19%" 2, Type: object, Name: lastUpdated, Value: 1674330519425 3, Type: object, Name: temperature, Value: "71°F" 4, Type: object, Name: serverTimeStamp, Value: 1674333984382
Received stream payload size: 147 (Max. 147)
01/21/2023 05:42:31 PM stream timed out, resuming...
error code: -3, reason: not connected
01/21/2023 05:42:31 PM stream timed out, resuming...
error code: -3, reason: not connected
01/21/2023 05:42:36 PM stream timed out, resuming...
error code: -3, reason: not connected
01/21/2023 05:42:39 PM stream timed out, resuming...
error code: -3, reason: not connected
01/21/2023 05:42:45 PM stream timed out, resuming...
error code: -3, reason: not connected
01/21/2023 05:42:49 PM stream timed out, resuming...
error code: -3, reason: not connected
01/21/2023 05:42:53 PM stream timed out, resuming...
error code: -3, reason: not connected
01/21/2023 05:42:58 PM stream timed out, resuming...
error code: -3, reason: not connected
01/21/2023 05:43:01 PM stream timed out, resuming...
error code: -3, reason: not connected
The library update is available, please update.
After initial connection to RTDB using v4.3.3 i'm repeatedly getting "stream timed out, resuming..." followed by "error code: -3, reason: not connected" every 3 seconds. As you'll see in my example code, Firebase.ready() is being called repeatedly.
Opening port Port open Connecting to Wi-Fi. Connected with IP: 10.0.0.121
Current Boot Time (EDT): 01/21/2023 04:11:37 PM
Firebase Client v4.3.3
01/21/2023 04:11:37 PM Token info: type = id token (GITKit token), status = on request
01/21/2023 04:11:38 PM Token info: type = id token (GITKit token), status = ready
RTDB User Path: /users/xxxxxxxxxxxxxxxxxxxxxxxxxxxx 01/21/2023 04:11:38 PM
01/21/2023 04:11:39 PM stream timed out, resuming...
sream path, /users/xxxxxxxxxxxxxxxxxxxxxxxxxxxx event path, / data type, json event type, put
Pretty printed JSON data: { "dht": { "humitity": "19%", "lastUpdated": 1674330519425, "temperature": "71°F" }, "serverTimeStamp": 1674333984382 } Iterate JSON data:
0, Type: object, Name: dht, Value: {"humitity":"19%","lastUpdated":1674330519425,"temperature":"71°F"} 1, Type: object, Name: humitity, Value: "19%" 2, Type: object, Name: lastUpdated, Value: 1674330519425 3, Type: object, Name: temperature, Value: "71°F" 4, Type: object, Name: serverTimeStamp, Value: 1674333984382
Received stream payload size: 147 (Max. 147)
01/21/2023 04:11:43 PM stream timed out, resuming...
error code: -3, reason: not connected
01/21/2023 04:11:46 PM stream timed out, resuming...
error code: -3, reason: not connected
01/21/2023 04:11:50 PM stream timed out, resuming...
error code: -3, reason: not connected
01/21/2023 04:11:53 PM stream timed out, resuming...
error code: -3, reason: not connected
01/21/2023 04:11:56 PM stream timed out, resuming...
error code: -3, reason: not connected
`/**
*/
include
include
include
include
include
include
include
include
include
include
include
include
include
include
include
include
include
include
include
include
include
include
if defined(ESP32) || defined(PICO_RP2040)
include
elif defined(ESP8266)
include
endif
include
// Provide the token generation process info.
include <addons/TokenHelper.h>
// Provide the RTDB payload printing info and other helper functions.
include <addons/RTDBHelper.h>
/ 1. Define the WiFi credentials /
define WIFI_SSID "WIFI_AP"
define WIFI_PASSWORD "WIFI_PASSWORD"
// For the following credentials, see examples/Authentications/SignInAsUser/EmailPassword/EmailPassword.ino
/ 2. Define the API Key /
define API_KEY "API_KEY"
/ 3. Define the RTDB URL /
define DATABASE_URL "URL" //.firebaseio.com or ..firebasedatabase.app
/ 4. Define the user Email and password that alreadey registerd or added in your project /
define USER_EMAIL "USER_EMAIL"
define USER_PASSWORD "USER_PASSWORD"
// Define Firebase Data object FirebaseData stream; FirebaseData fbdo;
FirebaseAuth auth; FirebaseConfig config;
unsigned long sendDataPrevMillis = 0;
int count = 0;
volatile bool dataChanged = false;
String fbDbPath;
void streamCallback(FirebaseStream data) { Serial.printf("sream 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();
}
void streamTimeoutCallback(bool timeout) { Serial.println("***"); printCurrentTime(true); if (timeout) Serial.println("stream timed out, resuming...\n");
}
void setup() {
}
void loop() {
}
void my_tokenStatusCallback(TokenInfo info) { /** fb_esp_auth_token_status enum
token_status_error */
Serial.println(""); printCurrentTime(true); if (info.status == token_status_error) { Serial_Printf("Token info: type = %s, status = %s\n", getTokenType(info), getTokenStatus(info)); Serial_Printf("Token error: %s\n", getTokenError(info).c_str()); } else { Serial_Printf("Token info: type = %s, status = %s\n", getTokenType(info), getTokenStatus(info)); } Serial.println(""); Serial.println(); Serial.println(); }
const char* ntpServer = "pool.ntp.org"; const long gmtOffset_sec = 18000; const int daylightOffset_sec = 3600;
define TZ "EST5EDT,M3.2.0,M11.1.0"
void ntpInit() { configTime(0, 0, ntpServer); // 0, 0 because we will use TZ in the next line setenv("TZ", TZ, 1); // Set environment variable with your time zone tzset();
}
void printCurrentTime(bool newLine) { time_t now; struct tm timeinfo;
}
`