diff --git a/README.md b/README.md index b65fe8c7c..bc7059a74 100644 --- a/README.md +++ b/README.md @@ -85,6 +85,8 @@ The flash and SD filesystems supports depend on the devices and third party file This library required **ESP8266 or ESP32 Core SDK**. +ESP8266 Core SDK v2.5.0 and older versions are not supported. + For Arduino IDE, ESP8266 Core SDK can be installed through **Boards Manager**. For PlatfoemIO IDE, ESP8266 Core SDK can be installed through **PIO Home** > **Platforms** > **Espressif 8266 or Espressif 32**. diff --git a/examples/ExternalClient/RTDB/Ethernet/ESP32/Basic/Basic.ino b/examples/ExternalClient/RTDB/Ethernet/ESP32/Basic/Basic.ino index 25fb29081..f7b4e788e 100644 --- a/examples/ExternalClient/RTDB/Ethernet/ESP32/Basic/Basic.ino +++ b/examples/ExternalClient/RTDB/Ethernet/ESP32/Basic/Basic.ino @@ -28,6 +28,7 @@ // Provide the RTDB payload printing info and other helper functions. #include +//https://github.com/arduino-libraries/Ethernet #include // Include built-in SSL Client which supports other network interfaces @@ -165,7 +166,7 @@ void setup() Serial_Printf("Firebase Client v%s\n\n", FIREBASE_CLIENT_VERSION); - /* Assign the basic Client (Ethernet) pointer to the SSL Client */ + /* Assign the basic Client (Ethernet) pointer to the basic Client */ ssl_client.setClient(&basic_client); /* Similar to WiFiClientSecure */ diff --git a/examples/ExternalClient/RTDB/Ethernet/ESP32/StreamCallback/StreamCallback.ino b/examples/ExternalClient/RTDB/Ethernet/ESP32/StreamCallback/StreamCallback.ino index 3c1bcf58f..3bb74c16d 100644 --- a/examples/ExternalClient/RTDB/Ethernet/ESP32/StreamCallback/StreamCallback.ino +++ b/examples/ExternalClient/RTDB/Ethernet/ESP32/StreamCallback/StreamCallback.ino @@ -27,6 +27,7 @@ // Provide the RTDB payload printing info and other helper functions. #include +//https://github.com/arduino-libraries/Ethernet #include // Include built-in SSL Client which supports other network interfaces @@ -225,13 +226,13 @@ void setup() Serial_Printf("Firebase Client v%s\n\n", FIREBASE_CLIENT_VERSION); - /* Assign the basic Client (Ethernet) pointer to the SSL Client */ + /* Assign the basic Client (Ethernet) pointer to the basic Client */ ssl_client1.setClient(&basic_client1); /* Similar to WiFiClientSecure */ ssl_client1.setInsecure(); - /* Assign the basic Client (Ethernet) pointer to the SSL Client */ + /* Assign the basic Client (Ethernet) pointer to the basic Client */ ssl_client2.setClient(&basic_client2); /* Similar to WiFiClientSecure */ diff --git a/examples/ExternalClient/RTDB/Ethernet/ESP8266/Basic/Basic.ino b/examples/ExternalClient/RTDB/Ethernet/ESP8266/Basic/Basic.ino index fa77ca1ac..513f2c7aa 100644 --- a/examples/ExternalClient/RTDB/Ethernet/ESP8266/Basic/Basic.ino +++ b/examples/ExternalClient/RTDB/Ethernet/ESP8266/Basic/Basic.ino @@ -170,7 +170,7 @@ void setup() Serial_Printf("Firebase Client v%s\n\n", FIREBASE_CLIENT_VERSION); - /* Assign the basic Client (Ethernet) pointer to the SSL Client */ + /* Assign the basic Client (Ethernet) pointer to the basic Client */ ssl_client.setClient(&basic_client); /* Similar to WiFiClientSecure */ diff --git a/examples/ExternalClient/RTDB/Ethernet/ESP8266/StreamCallback/StreamCallback.ino b/examples/ExternalClient/RTDB/Ethernet/ESP8266/StreamCallback/StreamCallback.ino index f3165f80f..15472e36c 100644 --- a/examples/ExternalClient/RTDB/Ethernet/ESP8266/StreamCallback/StreamCallback.ino +++ b/examples/ExternalClient/RTDB/Ethernet/ESP8266/StreamCallback/StreamCallback.ino @@ -232,7 +232,7 @@ void setup() Serial_Printf("Firebase Client v%s\n\n", FIREBASE_CLIENT_VERSION); - /* Assign the basic Client (Ethernet) pointer to the SSL Client */ + /* Assign the basic Client (Ethernet) pointer to the basic Client */ ssl_client1.setClient(&basic_client1); /* Similar to WiFiClientSecure */ diff --git a/library.json b/library.json index c6bd96a14..e18ce4ca9 100644 --- a/library.json +++ b/library.json @@ -1,6 +1,6 @@ { "name": "Firebase Arduino Client Library for ESP8266 and ESP32", - "version": "4.2.6", + "version": "4.2.7", "keywords": "communication, REST, esp32, esp8266, arduino", "description": "The library supports Firebase products e.g. Realtime database, Cloud Firestore database, Firebase Storage and Google Cloud Storage, Cloud Functions for Firebase and Cloud Messaging. The library also supported other Arduino devices using Clients interfaces e.g. WiFiClient, EthernetClient, and GSMClient.", "repository": { diff --git a/library.properties b/library.properties index 95b8d32e6..ad54fdedd 100644 --- a/library.properties +++ b/library.properties @@ -1,6 +1,6 @@ name=Firebase Arduino Client Library for ESP8266 and ESP32 -version=4.2.6 +version=4.2.7 author=Mobizt diff --git a/src/FB_Const.h b/src/FB_Const.h index 13132ee03..1b6ef5c5f 100644 --- a/src/FB_Const.h +++ b/src/FB_Const.h @@ -1,6 +1,6 @@ /** - * Created November 9, 2022 + * Created November 15, 2022 * * This work is a part of Firebase ESP Client library * Copyright (c) 2022 K. Suwatchai (Mobizt) @@ -58,6 +58,15 @@ #define OTA_UPDATE_ENABLED #endif +#if defined(ESP32) +#if defined(ESP_ARDUINO_VERSION) +#if ESP_ARDUINO_VERSION > ESP_ARDUINO_VERSION_VAL(2, 0, 1) +#define ESP32_GT_2_0_1_FS_MEMORY_FIX +#endif +#endif +#endif + + #if defined(FIREBASE_ESP_CLIENT) #define FIREBASE_STREAM_CLASS FirebaseStream #define FIREBASE_MP_STREAM_CLASS MultiPathStream diff --git a/src/Firebase_ESP_Client.h b/src/Firebase_ESP_Client.h index 629708975..c8d07314f 100644 --- a/src/Firebase_ESP_Client.h +++ b/src/Firebase_ESP_Client.h @@ -1,16 +1,16 @@ #ifndef FIREBASE_CLIENT_VERSION -#define FIREBASE_CLIENT_VERSION "4.2.6" +#define FIREBASE_CLIENT_VERSION "4.2.7" #endif /** - * Google's Firebase ESP Client Main class, Firebase_ESP_Client.h v4.2.6 + * Google's Firebase ESP Client Main class, Firebase_ESP_Client.h v4.2.7 * * This library supports Espressif ESP8266 and ESP32 MCUs * * Created November 11, 2022 * * Updates: - * - Remove unused file 'MB_File.h'. + * - Fix compilation error. * * * This work is a part of Firebase ESP Client library diff --git a/src/gcs/GCS.cpp b/src/gcs/GCS.cpp index 919b77b80..e0d61b53f 100644 --- a/src/gcs/GCS.cpp +++ b/src/gcs/GCS.cpp @@ -1,9 +1,9 @@ /** - * Google's Cloud Storage class, GCS.cpp version 1.2.1 + * Google's Cloud Storage class, GCS.cpp version 1.2.2 * * This library supports Espressif ESP8266 and ESP32 * - * Created November 10, 2022 + * Created November 15, 2022 * * This work is a part of Firebase ESP Client library * Copyright (c) 2022 K. Suwatchai (Mobizt) @@ -1671,20 +1671,11 @@ bool GG_CloudStorage::handleResponse(FirebaseData *fbdo, struct fb_esp_gcs_req_t if (req->requestType == fb_esp_gcs_request_type_download && strlen(ut->mbfs->name(mbfs_type req->storageType)) == 0) { -#if defined(ESP32) -#if defined(ESP_ARDUINO_VERSION) && ESP_ARDUINO_VERSION > ESP_ARDUINO_VERSION_VAL(2, 0, 1) +#if defined(ESP32_GT_2_0_1_FS_MEMORY_FIX) // Fix issue in ESP32 core v2.0.x filesystems // We can't open file (flash or sd) to write here because of truncated result, only append is success. // We have to remove existing file ut->mbfs->remove(req->localFileName, mbfs_type req->storageType); -#else - int ret = ut->mbfs->open(req->localFileName, mbfs_type req->storageType, mb_fs_open_mode_write); - if (ret < 0) - { - fbdo->session.response.code = ret; - return false; - } -#endif #else int ret = ut->mbfs->open(req->localFileName, mbfs_type req->storageType, mb_fs_open_mode_write); if (ret < 0) @@ -1941,8 +1932,8 @@ bool GG_CloudStorage::handleResponse(FirebaseData *fbdo, struct fb_esp_gcs_req_t { if (error.code == 0) { -#if defined(ESP32) -#if defined(ESP_ARDUINO_VERSION) && ESP_ARDUINO_VERSION > ESP_ARDUINO_VERSION_VAL(2, 0, 1) + +#if defined(ESP32_GT_2_0_1_FS_MEMORY_FIX) // We open file to append here int ret = ut->mbfs->open(req->localFileName, mbfs_type req->storageType, mb_fs_open_mode_append); @@ -1952,16 +1943,14 @@ bool GG_CloudStorage::handleResponse(FirebaseData *fbdo, struct fb_esp_gcs_req_t fbdo->session.response.code = ret; return false; } -#endif #endif if (ut->mbfs->write(mbfs_type req->storageType, buf, read) != (int)read) error.code = MB_FS_ERROR_FILE_IO_ERROR; -#if defined(ESP32) -#if defined(ESP_ARDUINO_VERSION) && ESP_ARDUINO_VERSION > ESP_ARDUINO_VERSION_VAL(2, 0, 1) + +#if defined(ESP32_GT_2_0_1_FS_MEMORY_FIX) // We close file here after append ut->mbfs->close(mbfs_type req->storageType); -#endif #endif } } diff --git a/src/gcs/GCS.h b/src/gcs/GCS.h index d8856f42a..3c884c8ff 100644 --- a/src/gcs/GCS.h +++ b/src/gcs/GCS.h @@ -1,9 +1,9 @@ /** - * Google's Cloud Storage class, GCS.h version 1.2.1 + * Google's Cloud Storage class, GCS.h version 1.2.2 * * This library supports Espressif ESP8266 and ESP32 * - * Created November 10, 2022 + * Created November 15, 2022 * * This work is a part of Firebase ESP Client library * Copyright (c) 2022 K. Suwatchai (Mobizt) diff --git a/src/sslclient/esp32/MB_ESP32_SSLClient.cpp b/src/sslclient/esp32/MB_ESP32_SSLClient.cpp index 15482f6c0..5a6da069c 100644 --- a/src/sslclient/esp32/MB_ESP32_SSLClient.cpp +++ b/src/sslclient/esp32/MB_ESP32_SSLClient.cpp @@ -1,7 +1,7 @@ /* - * The Mobizt ESP32 SSL Client Class, MB_ESP32_SSLClient.cpp v1.0.1 + * The Mobizt ESP32 SSL Client Class, MB_ESP32_SSLClient.cpp v1.0.2 * - * Created November 8, 2022 + * Created November 15, 2022 * * The MIT License (MIT) * Copyright (c) 2022 K. Suwatchai (Mobizt) @@ -103,8 +103,6 @@ void MB_ESP32_SSLClient::stop() if (!_ssl->basic_client) return; - _host.clear(); - stop_tcp_connection(_ssl, _CA_cert, _cert, _private_key); if (_ssl->basic_client) diff --git a/src/sslclient/esp32/MB_ESP32_SSLClient.h b/src/sslclient/esp32/MB_ESP32_SSLClient.h index 7f1773e8a..720e70ec8 100644 --- a/src/sslclient/esp32/MB_ESP32_SSLClient.h +++ b/src/sslclient/esp32/MB_ESP32_SSLClient.h @@ -1,7 +1,7 @@ /* - * The Mobizt ESP32 SSL Client Class, MB_ESP32_SSLClient.h v1.0.1 + * The Mobizt ESP32 SSL Client Class, MB_ESP32_SSLClient.h v1.0.2 * - * Created November 8, 2022 + * Created November 15, 2022 * * The MIT License (MIT) * Copyright (c) 2022 K. Suwatchai (Mobizt) diff --git a/src/sslclient/esp8266/MB_ESP8266_SSLClient.cpp b/src/sslclient/esp8266/MB_ESP8266_SSLClient.cpp index 514603a3c..22c17b795 100644 --- a/src/sslclient/esp8266/MB_ESP8266_SSLClient.cpp +++ b/src/sslclient/esp8266/MB_ESP8266_SSLClient.cpp @@ -1,8 +1,8 @@ /** * - * The Mobizt ESP8266 SSL Client Class, MB_ESP8266_SSLClient.cpp v1.0.0 + * The Mobizt ESP8266 SSL Client Class, MB_ESP8266_SSLClient.cpp v1.0.1 * - * Created November 2, 2022 + * Created November 15, 2022 * * The MIT License (MIT) * Copyright (c) 2022 K. Suwatchai (Mobizt) @@ -120,7 +120,6 @@ void MB_ESP8266_SSLClient::setTimeout(unsigned long timeout) void MB_ESP8266_SSLClient::stop() { - _host.clear(); WCS_CLASS::stop(); } diff --git a/src/sslclient/esp8266/MB_ESP8266_SSLClient.h b/src/sslclient/esp8266/MB_ESP8266_SSLClient.h index af1adc9b4..d04f3c55e 100644 --- a/src/sslclient/esp8266/MB_ESP8266_SSLClient.h +++ b/src/sslclient/esp8266/MB_ESP8266_SSLClient.h @@ -1,8 +1,8 @@ /** * - * The Mobizt ESP8266 SSL Client Class, MB_ESP8266_SSLClient.h v1.0.0 + * The Mobizt ESP8266 SSL Client Class, MB_ESP8266_SSLClient.h v1.0.1 * - * Created November 2, 2022 + * Created November 15, 2022 * * The MIT License (MIT) * Copyright (c) 2022 K. Suwatchai (Mobizt) @@ -33,12 +33,9 @@ #include #include - #include "MB_BearSSL.h" - -#if defined(ESP8266) #include -#endif + #include "ESP8266_SSL_Client.h" diff --git a/src/storage/FCS.cpp b/src/storage/FCS.cpp index 383253952..7445b5971 100644 --- a/src/storage/FCS.cpp +++ b/src/storage/FCS.cpp @@ -1,9 +1,9 @@ /** - * Google's Firebase Storage class, FCS.cpp version 1.2.1 + * Google's Firebase Storage class, FCS.cpp version 1.2.2 * * This library supports Espressif ESP8266 and ESP32 * - * Created November 10, 2022 + * Created November 15, 2022 * * This work is a part of Firebase ESP Client library * Copyright (c) 2021 K. Suwatchai (Mobizt) @@ -694,8 +694,7 @@ bool FB_Storage::handleResponse(FirebaseData *fbdo, struct fb_esp_fcs_req_t *req if (req->requestType == fb_esp_fcs_request_type_download) { -#if defined(ESP32) -#if defined(ESP_ARDUINO_VERSION) && ESP_ARDUINO_VERSION > ESP_ARDUINO_VERSION_VAL(2, 0, 1) +#if defined(ESP32_GT_2_0_1_FS_MEMORY_FIX) // Fix issue in ESP32 core v2.0.x filesystems // We can't open file (flash or sd) to write here because of truncated result, only append is success. // We have to remove existing file @@ -710,16 +709,6 @@ bool FB_Storage::handleResponse(FirebaseData *fbdo, struct fb_esp_fcs_req_t *req return false; } #endif -#else - int ret = ut->mbfs->open(req->localFileName, mbfs_type req->storageType, mb_fs_open_mode_write); - - if (ret < 0) - { - fbdo->tcpClient.flush(); - fbdo->session.response.code = ret; - return false; - } -#endif } if (chunkBufSize > 1) @@ -889,8 +878,7 @@ bool FB_Storage::handleResponse(FirebaseData *fbdo, struct fb_esp_fcs_req_t *req if (error.code == 0) { -#if defined(ESP32) -#if defined(ESP_ARDUINO_VERSION) && ESP_ARDUINO_VERSION > ESP_ARDUINO_VERSION_VAL(2, 0, 1) +#if defined(ESP32_GT_2_0_1_FS_MEMORY_FIX) // We open file to append here int ret = ut->mbfs->open(req->localFileName, mbfs_type req->storageType, mb_fs_open_mode_append); @@ -900,17 +888,14 @@ bool FB_Storage::handleResponse(FirebaseData *fbdo, struct fb_esp_fcs_req_t *req fbdo->session.response.code = ret; return false; } -#endif #endif if (ut->mbfs->write(mbfs_type req->storageType, buf, read) != (int)read) error.code = MB_FS_ERROR_FILE_IO_ERROR; -#if defined(ESP32) -#if defined(ESP_ARDUINO_VERSION) && ESP_ARDUINO_VERSION > ESP_ARDUINO_VERSION_VAL(2, 0, 1) +#if defined(ESP32_GT_2_0_1_FS_MEMORY_FIX) // We close file here after append ut->mbfs->close(mbfs_type req->storageType); -#endif #endif } } diff --git a/src/storage/FCS.h b/src/storage/FCS.h index e2568771a..bdc948a3a 100644 --- a/src/storage/FCS.h +++ b/src/storage/FCS.h @@ -1,9 +1,9 @@ /** - * Google's Firebase Storage class, FCS.h version 1.2.1 + * Google's Firebase Storage class, FCS.h version 1.2.2 * * This library supports Espressif ESP8266 and ESP32 * - * Created November 10, 2022 + * Created November 15, 2022 * * This work is a part of Firebase ESP Client library * Copyright (c) 2022 K. Suwatchai (Mobizt)