Skip to content

Commit

Permalink
Set some function and option obsoleted and update examples.
Browse files Browse the repository at this point in the history
  • Loading branch information
mobizt committed Sep 13, 2023
1 parent 38389c5 commit 5a196ac
Show file tree
Hide file tree
Showing 87 changed files with 266 additions and 195 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,10 @@ void setup()
config.database_url = DATABASE_URL;
config.signer.tokens.legacy_token = DATABASE_SECRET;

Firebase.reconnectWiFi(true);
Firebase.reconnectNetwork(true);

// required for large file data, increase Rx size as needed.
// Since v4.4.x, BearSSL engine was used, the SSL buffer need to be set.
// Large data transmission may require larger RX buffer, otherwise the data read time out can be occurred.
fbdo.setBSSLBufferSize(4096 /* Rx buffer size in bytes from 512 - 16384 */, 1024 /* Tx buffer size in bytes from 512 - 16384 */);

// The WiFi credentials are required for Pico W
Expand Down
5 changes: 3 additions & 2 deletions examples/Authentications/ReAuthenticate/ReAuthenticate.ino
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,10 @@ void setup()
/* Assign the RTDB URL */
config.database_url = DATABASE_URL;

Firebase.reconnectWiFi(true);
Firebase.reconnectNetwork(true);

// required for large file data, increase Rx size as needed.
// Since v4.4.x, BearSSL engine was used, the SSL buffer need to be set.
// Large data transmission may require larger RX buffer, otherwise the data read time out can be occurred.
fbdo.setBSSLBufferSize(4096 /* Rx buffer size in bytes from 512 - 16384 */, 1024 /* Tx buffer size in bytes from 512 - 16384 */);

fbdo.setResponseSize(4096);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,10 @@ void setup()
*/
// config.signer.tokens.scope = "Google Scope 1 Url, Google Scope 2 Url,..";

Firebase.reconnectWiFi(true);
Firebase.reconnectNetwork(true);

// required for large file data, increase Rx size as needed.
// Since v4.4.x, BearSSL engine was used, the SSL buffer need to be set.
// Large data transmission may require larger RX buffer, otherwise the data read time out can be occurred.
fbdo.setBSSLBufferSize(4096 /* Rx buffer size in bytes from 512 - 16384 */, 1024 /* Tx buffer size in bytes from 512 - 16384 */);

/* Assign the callback function for the long running token generation task */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ void setup()
/* Assign the RTDB URL */
config.database_url = DATABASE_URL;

Firebase.reconnectWiFi(true);
Firebase.reconnectNetwork(true);

// required for large file data, increase Rx size as needed.
fbdo.setBSSLBufferSize(4096 /* Rx buffer size in bytes from 512 - 16384 */, 1024 /* Tx buffer size in bytes from 512 - 16384 */);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,9 +196,10 @@ void setup()
/* Assign the RTDB URL */
config.database_url = DATABASE_URL;

Firebase.reconnectWiFi(true);
Firebase.reconnectNetwork(true);

// required for large file data, increase Rx size as needed.
// Since v4.4.x, BearSSL engine was used, the SSL buffer need to be set.
// Large data transmission may require larger RX buffer, otherwise the data read time out can be occurred.
fbdo.setBSSLBufferSize(4096 /* Rx buffer size in bytes from 512 - 16384 */, 1024 /* Tx buffer size in bytes from 512 - 16384 */);

fbdo.setResponseSize(4096);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,10 @@ void setup()
claims.add("admin", true);
auth.token.claims = claims.raw();

Firebase.reconnectWiFi(true);
Firebase.reconnectNetwork(true);

// required for large file data, increase Rx size as needed.
// Since v4.4.x, BearSSL engine was used, the SSL buffer need to be set.
// Large data transmission may require larger RX buffer, otherwise the data read time out can be occurred.
fbdo.setBSSLBufferSize(4096 /* Rx buffer size in bytes from 512 - 16384 */, 1024 /* Tx buffer size in bytes from 512 - 16384 */);

fbdo.setResponseSize(4096);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,10 @@ void setup()
/* Assign the RTDB URL */
config.database_url = DATABASE_URL;

Firebase.reconnectWiFi(true);
Firebase.reconnectNetwork(true);

// required for large file data, increase Rx size as needed.
// Since v4.4.x, BearSSL engine was used, the SSL buffer need to be set.
// Large data transmission may require larger RX buffer, otherwise the data read time out can be occurred.
fbdo.setBSSLBufferSize(4096 /* Rx buffer size in bytes from 512 - 16384 */, 1024 /* Tx buffer size in bytes from 512 - 16384 */);

fbdo.setResponseSize(4096);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,10 @@ void setup()
/* Assign the RTDB URL */
config.database_url = DATABASE_URL;

Firebase.reconnectWiFi(true);
Firebase.reconnectNetwork(true);

// required for large file data, increase Rx size as needed.
// Since v4.4.x, BearSSL engine was used, the SSL buffer need to be set.
// Large data transmission may require larger RX buffer, otherwise the data read time out can be occurred.
fbdo.setBSSLBufferSize(4096 /* Rx buffer size in bytes from 512 - 16384 */, 1024 /* Tx buffer size in bytes from 512 - 16384 */);

/* Assign the callback function for the long running token generation task */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,10 @@ void setup()
/* Assign the RTDB URL */
config.database_url = DATABASE_URL;

Firebase.reconnectWiFi(true);
Firebase.reconnectNetwork(true);

// required for large file data, increase Rx size as needed.
// Since v4.4.x, BearSSL engine was used, the SSL buffer need to be set.
// Large data transmission may require larger RX buffer, otherwise the data read time out can be occurred.
fbdo.setBSSLBufferSize(4096 /* Rx buffer size in bytes from 512 - 16384 */, 1024 /* Tx buffer size in bytes from 512 - 16384 */);

/* Assign the callback function for the long running token generation task */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,10 @@ void setup()
/* Assign the RTDB URL */
config.database_url = DATABASE_URL;

Firebase.reconnectWiFi(true);
Firebase.reconnectNetwork(true);

// required for large file data, increase Rx size as needed.
// Since v4.4.x, BearSSL engine was used, the SSL buffer need to be set.
// Large data transmission may require larger RX buffer, otherwise the data read time out can be occurred.
fbdo.setBSSLBufferSize(4096 /* Rx buffer size in bytes from 512 - 16384 */, 1024 /* Tx buffer size in bytes from 512 - 16384 */);

/** To sign in as anonymous user, just sign up as anonymous user
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,10 @@ void setup()
/* Assign the RTDB URL */
config.database_url = DATABASE_URL;

Firebase.reconnectWiFi(true);
Firebase.reconnectNetwork(true);

// required for large file data, increase Rx size as needed.
// Since v4.4.x, BearSSL engine was used, the SSL buffer need to be set.
// Large data transmission may require larger RX buffer, otherwise the data read time out can be occurred.
fbdo.setBSSLBufferSize(4096 /* Rx buffer size in bytes from 512 - 16384 */, 1024 /* Tx buffer size in bytes from 512 - 16384 */);

/* Assign the callback function for the long running token generation task */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,10 @@ void setup()
/* Assign the RTDB URL */
config.database_url = DATABASE_URL;

Firebase.reconnectWiFi(true);
Firebase.reconnectNetwork(true);

// required for large file data, increase Rx size as needed.
// Since v4.4.x, BearSSL engine was used, the SSL buffer need to be set.
// Large data transmission may require larger RX buffer, otherwise the data read time out can be occurred.
fbdo.setBSSLBufferSize(4096 /* Rx buffer size in bytes from 512 - 16384 */, 1024 /* Tx buffer size in bytes from 512 - 16384 */);

/* Assign the callback function for the long running token generation task */
Expand Down
5 changes: 3 additions & 2 deletions examples/Authentications/TestMode/TestMode.ino
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,10 @@ void setup()
*/

Firebase.reconnectWiFi(true);
Firebase.reconnectNetwork(true);

// required for large file data, increase Rx size as needed.
// Since v4.4.x, BearSSL engine was used, the SSL buffer need to be set.
// Large data transmission may require larger RX buffer, otherwise the data read time out can be occurred.
fbdo.setBSSLBufferSize(4096 /* Rx buffer size in bytes from 512 - 16384 */, 1024 /* Tx buffer size in bytes from 512 - 16384 */);

// The WiFi credentials are required for Pico W
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ void setup()
/* Assign the RTDB URL */
config.database_url = DATABASE_URL;

Firebase.reconnectWiFi(true);
Firebase.reconnectNetwork(true);

// The WiFi credentials are required for Pico W
// due to it does not have reconnect feature.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,10 @@ void setup()
/* Assign the RTDB URL */
config.database_url = DATABASE_URL;

Firebase.reconnectWiFi(true);
Firebase.reconnectNetwork(true);

// required for large file data, increase Rx size as needed.
// Since v4.4.x, BearSSL engine was used, the SSL buffer need to be set.
// Large data transmission may require larger RX buffer, otherwise the data read time out can be occurred.
fbdo.setBSSLBufferSize(4096 /* Rx buffer size in bytes from 512 - 16384 */, 1024 /* Tx buffer size in bytes from 512 - 16384 */);

/* Assign the user sign in credentials */
Expand Down
5 changes: 3 additions & 2 deletions examples/Authentications/UserManagement/Signup/Signup.ino
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,10 @@ void setup()
/* Assign the RTDB URL */
config.database_url = DATABASE_URL;

Firebase.reconnectWiFi(true);
Firebase.reconnectNetwork(true);

// required for large file data, increase Rx size as needed.
// Since v4.4.x, BearSSL engine was used, the SSL buffer need to be set.
// Large data transmission may require larger RX buffer, otherwise the data read time out can be occurred.
fbdo.setBSSLBufferSize(4096 /* Rx buffer size in bytes from 512 - 16384 */, 1024 /* Tx buffer size in bytes from 512 - 16384 */);

Serial.print("Sign up new user... ");
Expand Down
9 changes: 4 additions & 5 deletions examples/BackupRestore/Flash/Flash.ino
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,12 @@ void setup()
/* Assign the callback function for the long running token generation task */
config.token_status_callback = tokenStatusCallback; // see addons/TokenHelper.h

Firebase.reconnectWiFi(true);
Firebase.reconnectNetwork(true);

// required for large file data, increase Rx size as needed.
// Since v4.4.x, BearSSL engine was used, the SSL buffer need to be set.
// Large data transmission may require larger RX buffer, otherwise the data read time out can be occurred.
fbdo.setBSSLBufferSize(4096 /* Rx buffer size in bytes from 512 - 16384 */, 1024 /* Tx buffer size in bytes from 512 - 16384 */);


// The WiFi credentials are required for Pico W
// due to it does not have reconnect feature.
#if defined(ARDUINO_RASPBERRY_PI_PICO_W)
Expand All @@ -110,8 +110,7 @@ void setup()
// To connect without auth in Test Mode, see Authentications/TestMode/TestMode.ino

Firebase.begin(&config, &auth);

}
}

// The Firebase download callback function
void rtdbDownloadCallback(RTDB_DownloadStatusInfo info)
Expand Down
6 changes: 3 additions & 3 deletions examples/BackupRestore/SD/SD.ino
Original file line number Diff line number Diff line change
Expand Up @@ -95,12 +95,12 @@ void setup()
/* Assign the callback function for the long running token generation task */
config.token_status_callback = tokenStatusCallback; // see addons/TokenHelper.h

Firebase.reconnectWiFi(true);
Firebase.reconnectNetwork(true);

// required for large file data, increase Rx size as needed.
// Since v4.4.x, BearSSL engine was used, the SSL buffer need to be set.
// Large data transmission may require larger RX buffer, otherwise the data read time out can be occurred.
fbdo.setBSSLBufferSize(4096 /* Rx buffer size in bytes from 512 - 16384 */, 1024 /* Tx buffer size in bytes from 512 - 16384 */);


// The WiFi credentials are required for Pico W
// due to it does not have reconnect feature.
#if defined(ARDUINO_RASPBERRY_PI_PICO_W)
Expand Down
10 changes: 5 additions & 5 deletions examples/Basic/Basic.ino
Original file line number Diff line number Diff line change
Expand Up @@ -93,12 +93,12 @@ void setup()
/* Assign the callback function for the long running token generation task */
config.token_status_callback = tokenStatusCallback; // see addons/TokenHelper.h

Firebase.reconnectWiFi(true);
Firebase.reconnectNetwork(true);

// required for large file data, increase Rx size as needed.
// Since v4.4.x, BearSSL engine was used, the SSL buffer need to be set.
// Large data transmission may require larger RX buffer, otherwise the data read time out can be occurred.
fbdo.setBSSLBufferSize(4096 /* Rx buffer size in bytes from 512 - 16384 */, 1024 /* Tx buffer size in bytes from 512 - 16384 */);


// The WiFi credentials are required for Pico W
// due to it does not have reconnect feature.
#if defined(ARDUINO_RASPBERRY_PI_PICO_W)
Expand Down Expand Up @@ -127,8 +127,8 @@ void setup()

/** Timeout options.
//WiFi reconnect timeout (interval) in ms (10 sec - 5 min) when WiFi disconnected.
config.timeout.wifiReconnect = 10 * 1000;
//Network reconnect timeout (interval) in ms (10 sec - 5 min) when network or WiFi disconnected.
config.timeout.networkReconnect = 10 * 1000;
//Socket connection and SSL handshake timeout in ms (1 sec - 1 min).
config.timeout.socketConnection = 10 * 1000;
Expand Down
9 changes: 5 additions & 4 deletions examples/BasicCert/BasicCert.ino
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,10 @@ void setup()
// Or custom set the root certificate for each FirebaseData object
fbdo.setCert(rootCACert);

Firebase.reconnectWiFi(true);
Firebase.reconnectNetwork(true);

// required for large file data, increase Rx size as needed.
// Since v4.4.x, BearSSL engine was used, the SSL buffer need to be set.
// Large data transmission may require larger RX buffer, otherwise the data read time out can be occurred.
fbdo.setBSSLBufferSize(4096 /* Rx buffer size in bytes from 512 - 16384 */, 1024 /* Tx buffer size in bytes from 512 - 16384 */);

// The WiFi credentials are required for Pico W
Expand Down Expand Up @@ -176,8 +177,8 @@ void setup()

/** Timeout options.
//WiFi reconnect timeout (interval) in ms (10 sec - 5 min) when WiFi disconnected.
config.timeout.wifiReconnect = 10 * 1000;
//Network reconnect timeout (interval) in ms (10 sec - 5 min) when network or WiFi disconnected.
config.timeout.networkReconnect = 10 * 1000;
//Socket connection and SSL handshake timeout in ms (1 sec - 1 min).
config.timeout.socketConnection = 10 * 1000;
Expand Down
5 changes: 3 additions & 2 deletions examples/BasicEthernet/BasicEthernet.ino
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,10 @@ void setupFirebase()
/* Assign the callback function for the long running token generation task */
config.token_status_callback = tokenStatusCallback; // see addons/TokenHelper.h

Firebase.reconnectWiFi(true);
Firebase.reconnectNetwork(true);

// required for large file data, increase Rx size as needed.
// Since v4.4.x, BearSSL engine was used, the SSL buffer need to be set.
// Large data transmission may require larger RX buffer, otherwise the data read time out can be occurred.
fbdo.setBSSLBufferSize(4096 /* Rx buffer size in bytes from 512 - 16384 */, 1024 /* Tx buffer size in bytes from 512 - 16384 */);

/* Assign the pointer to Ethernet module lwip interface */
Expand Down
5 changes: 3 additions & 2 deletions examples/Blob/Blob.ino
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,10 @@ void setup()
config.wifi.addAP(WIFI_SSID, WIFI_PASSWORD);
#endif

Firebase.reconnectWiFi(true);
Firebase.reconnectNetwork(true);

// required for large file data, increase Rx size as needed.
// Since v4.4.x, BearSSL engine was used, the SSL buffer need to be set.
// Large data transmission may require larger RX buffer, otherwise the data read time out can be occurred.
fbdo.setBSSLBufferSize(4096 /* Rx buffer size in bytes from 512 - 16384 */, 1024 /* Tx buffer size in bytes from 512 - 16384 */);

// Or use legacy authenticate method
Expand Down
5 changes: 3 additions & 2 deletions examples/Blynk/Blynk.ino
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,10 @@ void setup()
/* Assign the callback function for the long running token generation task */
config.token_status_callback = tokenStatusCallback; // see addons/TokenHelper.h

Firebase.reconnectWiFi(true);
Firebase.reconnectNetwork(true);

// required for large file data, increase Rx size as needed.
// Since v4.4.x, BearSSL engine was used, the SSL buffer need to be set.
// Large data transmission may require larger RX buffer, otherwise the data read time out can be occurred.
fbdo.setBSSLBufferSize(4096 /* Rx buffer size in bytes from 512 - 16384 */, 1024 /* Tx buffer size in bytes from 512 - 16384 */);

// The WiFi credentials are required for Pico W
Expand Down
9 changes: 5 additions & 4 deletions examples/DataChangesListener/Callback/Callback.ino
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,10 @@ void setup()
/* Assign the callback function for the long running token generation task */
config.token_status_callback = tokenStatusCallback; // see addons/TokenHelper.h

Firebase.reconnectWiFi(true);
Firebase.reconnectNetwork(true);

// required for large file data, increase Rx size as needed.
// Since v4.4.x, BearSSL engine was used, the SSL buffer need to be set.
// Large data transmission may require larger RX buffer, otherwise the data read time out can be occurred.
fbdo.setBSSLBufferSize(4096 /* Rx buffer size in bytes from 512 - 16384 */, 1024 /* Tx buffer size in bytes from 512 - 16384 */);

// The WiFi credentials are required for Pico W
Expand Down Expand Up @@ -158,8 +159,8 @@ void setup()

/** Timeout options, below is default config.
//WiFi reconnect timeout (interval) in ms (10 sec - 5 min) when WiFi disconnected.
config.timeout.wifiReconnect = 10 * 1000;
//Network reconnect timeout (interval) in ms (10 sec - 5 min) when network or WiFi disconnected.
config.timeout.networkReconnect = 10 * 1000;
//Socket begin connection timeout (ESP32) or data transfer timeout (ESP8266) in ms (1 sec - 1 min).
config.timeout.socketConnection = 30 * 1000;
Expand Down
13 changes: 8 additions & 5 deletions examples/DataChangesListener/MultiPath/MultiPath.ino
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,9 @@ void setup()

Serial.printf("Firebase Client v%s\n\n", FIREBASE_CLIENT_VERSION);

Serial.println("The MultipathStream is obsoleted, please use normal stream instead.");
Serial.println("In case of ESP8266, external Static RAM is recommend for multiple streaming.");

/* Assign the api key (required) */
config.api_key = API_KEY;

Expand All @@ -133,9 +136,10 @@ void setup()
/* Assign the callback function for the long running token generation task */
config.token_status_callback = tokenStatusCallback; // see addons/TokenHelper.h

Firebase.reconnectWiFi(true);
Firebase.reconnectNetwork(true);

// required for large file data, increase Rx size as needed.
// Since v4.4.x, BearSSL engine was used, the SSL buffer need to be set.
// Large data transmission may require larger RX buffer, otherwise the data read time out can be occurred.
fbdo.setBSSLBufferSize(4096 /* Rx buffer size in bytes from 512 - 16384 */, 1024 /* Tx buffer size in bytes from 512 - 16384 */);

// The WiFi credentials are required for Pico W
Expand Down Expand Up @@ -176,8 +180,8 @@ void setup()

/** Timeout options, below is default config.
//WiFi reconnect timeout (interval) in ms (10 sec - 5 min) when WiFi disconnected.
config.timeout.wifiReconnect = 10 * 1000;
//Network reconnect timeout (interval) in ms (10 sec - 5 min) when network or WiFi disconnected.
config.timeout.networkReconnect = 10 * 1000;
//Socket begin connection timeout (ESP32) or data transfer timeout (ESP8266) in ms (1 sec - 1 min).
config.timeout.socketConnection = 30 * 1000;
Expand Down Expand Up @@ -250,7 +254,6 @@ void loop()
// stream.pauseFirebase(true);
// stream.clear(); // close session and release memory


// To resume stream with callback
// stream.pauseFirebase(false);
// Firebase.setMultiPathStreamCallback(stream, streamCallback, streamTimeoutCallback);
Loading

0 comments on commit 5a196ac

Please sign in to comment.