My apologies for not supplying the sketch code. Here is the Firebase rtdb sketch I am using to upload data:
#include <Arduino.h>
#include <WiFi.h>
#include <FirebaseESP32.h>
#include <addons/TokenHelper.h>
#include <addons/RTDBHelper.h>
#define WIFI_SSID "______"
#define WIFI_PASSWORD "______"
#define API_KEY "______"
#define USER_EMAIL "______@gmail.com"
#define USER_PASSWORD "______"
#define DATABASE_URL "https://coilwinder-rtdb-default-______"
FirebaseData fbdo;
FirebaseAuth auth;
FirebaseConfig config;
unsigned long sendDataPrevMillis = 0;
bool signupOK = false;
unsigned long count = 0;
void setup()
{
Serial.begin(115200);
WiFi.begin(WIFI_SSID, WIFI_PASSWORD);
Serial.print("Connecting to Wi-Fi");
unsigned long ms = millis();
while (WiFi.status() != WL_CONNECTED)
{
Serial.print(".");
delay(300);
}
Serial.println();
Serial.print("Connected with IP: ");
Serial.println(WiFi.localIP());
Serial.println();
Serial.printf("Firebase Client v%s\n\n", FIREBASE_CLIENT_VERSION);
config.api_key = API_KEY;
auth.user.email = USER_EMAIL;
auth.user.password = USER_PASSWORD;
config.database_url = DATABASE_URL;
if (Firebase.signUp(&config, &auth, "", ""))
{
Serial.print("Sign Up OK");
signupOK = true;
}
else
{
Serial.printf("%s\n", config.signer.signupError.message.c_str());
}
config.token_status_callback = tokenStatusCallback;
fbdo.setResponseSize(2048);
Firebase.begin(&config, &auth);
Firebase.reconnectWiFi(true);
config.timeout.serverResponse = 10 * 1000;
}
void GENERIC_data()
{
if (Firebase.ready() && (millis() - sendDataPrevMillis > 60000 || sendDataPrevMillis == 0))
{
sendDataPrevMillis = millis();
// BOOLEAN DATA
// GENERIC -- Set/Get boolean data: GENERIC -> direction of rotation (forward/reverse)
Serial.printf("Set bool... %s\n", Firebase.RTDB.setBool(&fbdo, F("/GENERIC/spinDirection/is_fwd/bool"), 1) ? "ok" : fbdo.errorReason().c_str());
Serial.printf("Get bool... %s\n", Firebase.RTDB.getBool(&fbdo, FPSTR("/GENERIC/spinDirection/is_fwd/bool")) ? fbdo.to<bool>() ? "true" : "false" : fbdo.errorReason().c_str());
Serial.printf("Set bool... %s\n", Firebase.RTDB.setBool(&fbdo, F("/GENERIC/spinDirection/is_rev/bool"), 1) ? "ok" : fbdo.errorReason().c_str());
Serial.printf("Get bool... %s\n", Firebase.RTDB.getBool(&fbdo, FPSTR("/GENERIC/spinDirection/is_rev/bool")) ? fbdo.to<bool>() ? "true" : "false" : fbdo.errorReason().c_str());
// GENERIC -- Set/Get boolean data: GENERIC -> magnet align (north/south top)
Serial.printf("Set bool... %s\n", Firebase.RTDB.setBool(&fbdo, F("/GENERIC/magnetAlign/north_top/bool"), 1) ? "ok" : fbdo.errorReason().c_str());
Serial.printf("Get bool... %s\n", Firebase.RTDB.getBool(&fbdo, FPSTR("/GENERIC/magnetAlign/north_top/bool")) ? fbdo.to<bool>() ? "true" : "false" : fbdo.errorReason().c_str());
Serial.printf("Set bool... %s\n", Firebase.RTDB.setBool(&fbdo, F("/GENERIC/magnetAlign/south_top/bool"), 1) ? "ok" : fbdo.errorReason().c_str());
Serial.printf("Get bool... %s\n", Firebase.RTDB.getBool(&fbdo, FPSTR("/GENERIC/magnetAlign/south_top/bool")) ? fbdo.to<bool>() ? "true" : "false" : fbdo.errorReason().c_str());
bool bVal; // BOOLEAN REF.
// GENERIC -- Get boolean ref: GENERIC -> direction of rotation (forward/reverse)
Serial.printf("Get bool ref... %s\n", Firebase.RTDB.getBool(&fbdo, F("/GENERIC/spinDirection/is_fwd/bool"), &bVal) ? bVal ? "true" : "false" : fbdo.errorReason().c_str());
Serial.printf("Get bool ref... %s\n", Firebase.RTDB.getBool(&fbdo, F("/GENERIC/spinDirection/is_rev/bool"), &bVal) ? bVal ? "true" : "false" : fbdo.errorReason().c_str());
// GENERIC -- Get boolean ref: GENERIC -> magnet align (north/south top)
Serial.printf("Get bool ref... %s\n", Firebase.RTDB.getBool(&fbdo, F("/GENERIC/magnetAlign/north_top/bool"), &bVal) ? bVal ? "true" : "false" : fbdo.errorReason().c_str());
Serial.printf("Get bool ref... %s\n", Firebase.RTDB.getBool(&fbdo, F("/GENERIC/magnetAlign/south_top/bool"), &bVal) ? bVal ? "true" : "false" : fbdo.errorReason().c_str());
// INTEGER DATA
// GENERIC -- Set/Get int data: GENERIC -> wire gauge
Serial.printf("Set int... %s\n", Firebase.RTDB.setInt(&fbdo, F("/GENERIC/wireGauge/awg42/int"), 42) ? "ok" : fbdo.errorReason().c_str());
Serial.printf("Get int... %s\n", Firebase.RTDB.getInt(&fbdo, F("/GENERIC/wireGauge/awg42/int")) ? String(fbdo.to<int>()).c_str() : fbdo.errorReason().c_str());
Serial.printf("Set int... %s\n", Firebase.RTDB.setInt(&fbdo, F("/GENERIC/wireGauge/awg43/int"), 43) ? "ok" : fbdo.errorReason().c_str());
Serial.printf("Get int... %s\n", Firebase.RTDB.getInt(&fbdo, F("/GENERIC/wireGauge/awg43/int")) ? String(fbdo.to<int>()).c_str() : fbdo.errorReason().c_str());
// GENERIC -- Set/Get int data: Generic -> unit number
Serial.printf("Set int... %s\n", Firebase.RTDB.setInt(&fbdo, F("/GENERIC/unitNumber/unit1/int"), 1) ? "ok" : fbdo.errorReason().c_str());
Serial.printf("Get int... %s\n", Firebase.RTDB.getInt(&fbdo, F("/GENERIC/unitNumber/unit1/int")) ? String(fbdo.to<int>()).c_str() : fbdo.errorReason().c_str());
Serial.printf("Set int... %s\n", Firebase.RTDB.setInt(&fbdo, F("/GENERIC/unitNumber/unit2/int"), 2) ? "ok" : fbdo.errorReason().c_str());
Serial.printf("Get int... %s\n", Firebase.RTDB.getInt(&fbdo, F("/GENERIC/unitNumber/unit2/int")) ? String(fbdo.to<int>()).c_str() : fbdo.errorReason().c_str());
Serial.printf("Set int... %s\n", Firebase.RTDB.setInt(&fbdo, F("/GENERIC/unitNumber/unit3/int"), 3) ? "ok" : fbdo.errorReason().c_str());
Serial.printf("Get int... %s\n", Firebase.RTDB.getInt(&fbdo, F("/GENERIC/unitNumber/unit3/int")) ? String(fbdo.to<int>()).c_str() : fbdo.errorReason().c_str());
int iVal = 0; // INTEGER REF.
// GENERIC -- Get int ref: GENERIC -> wire gauge
Serial.printf("Get int ref... %s\n", Firebase.RTDB.getInt(&fbdo, F("/GENERIC/wireGauge/awg42/int"), &iVal) ? String(iVal).c_str() : fbdo.errorReason().c_str());
Serial.printf("Get int ref... %s\n", Firebase.RTDB.getInt(&fbdo, F("/GENERIC/wireGauge/awg43/int"), &iVal) ? String(iVal).c_str() : fbdo.errorReason().c_str());
// FLOAT DATA
// GENERIC -- Set/Get float data: GENERIC -> wire diameter
Serial.printf("Set float... %s\n", Firebase.RTDB.setFloat(&fbdo, F("/GENERIC/wireDiameter/awg42/float"), 0.0633) ? "ok" : fbdo.errorReason().c_str());
Serial.printf("Get float... %s\n", Firebase.RTDB.getFloat(&fbdo, F("/GENERIC/wireDiameter/awg42/float")) ? String(fbdo.to<float>()).c_str() : fbdo.errorReason().c_str());
Serial.printf("Set float... %s\n", Firebase.RTDB.setFloat(&fbdo, F("/GENERIC/wireDiameter/awg43/float"), 0.0559) ? "ok" : fbdo.errorReason().c_str());
Serial.printf("Get float... %s\n", Firebase.RTDB.getFloat(&fbdo, F("/GENERIC/wireDiameter/awg43/float")) ? String(fbdo.to<float>()).c_str() : fbdo.errorReason().c_str());
// GENERIC -- Set/Get int data: Generic -> unit number
Serial.printf("Get int ref... %s\n", Firebase.RTDB.getInt(&fbdo, F("/GENERIC/unitNumber/unit1/int"), &iVal) ? String(iVal).c_str() : fbdo.errorReason().c_str());
Serial.printf("Get int ref... %s\n", Firebase.RTDB.getInt(&fbdo, F("/GENERIC/unitNumber/unit2/int"), &iVal) ? String(iVal).c_str() : fbdo.errorReason().c_str());
Serial.printf("Get int ref... %s\n", Firebase.RTDB.getInt(&fbdo, F("/GENERIC/unitNumber/unit3/int"), &iVal) ? String(iVal).c_str() : fbdo.errorReason().c_str());
FirebaseJson json;
// GENERIC
if (count == 0)
{
json.set("value/round/" + String(count), F("generic data"));
json.set(F("value/ts/.sv"), F("timestamp"));
Serial.printf("Set json... %s\n", Firebase.RTDB.set(&fbdo, F("/GENERIC/json"), &json) ? "ok" : fbdo.errorReason().c_str());
}
else
{
json.add(String(count), F("updated"));
Serial.printf("Update node... %s\n", Firebase.RTDB.updateNode(&fbdo, F("/GENERIC/json/value/round"), &json) ? "ok" : fbdo.errorReason().c_str());
}
Serial.println();
count++;
}
}
void loop()
{
GENERIC_data();
}
Here is the output from the PlatformIO terminal upon building:
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain+, Compatibility ~ soft
Found 34 compatible libraries
Scanning dependencies...
Dependency Graph
|-- Firebase ESP32 Client @ 4.3.11
|-- WiFi @ 2.0.0
|-- SPIFFS @ 2.0.0
|-- FS @ 2.0.0
|-- SD_MMC @ 2.0.0
|-- SD @ 2.0.0
|-- SPI @ 2.0.0
|-- LittleFS @ 2.0.0
|-- Ethernet @ 2.0.0
|-- WiFiClientSecure @ 2.0.0
|-- Update @ 2.0.0
Building in release mode
Compiling .pio\build\esp32doit-devkit-v1\liba11\SD_MMC\SD_MMC.cpp.o
In file included from C:/.platformio/packages/framework-arduinoespressif32/libraries/SD_MMC/src/SD_MMC.cpp:16:
C:/.platformio/packages/framework-arduinoespressif32/libraries/SD_MMC/src/SD_MMC.h:21:10: fatal error: FS.h: No such file or directory
************************************************************
* Looking for FS.h dependency? Check our library registry!
*
* CLI > platformio lib search "header:FS.h"
* Web > https://registry.platformio.org/search?q=header:FS.h
*
************************************************************
#include "FS.h"
^~~~~~
compilation terminated.
Archiving .pio\build\esp32doit-devkit-v1\lib326\libWiFi.a
Archiving .pio\build\esp32doit-devkit-v1\lib108\libEthernet.a
Compiling .pio\build\esp32doit-devkit-v1\lib0f3\WiFiClientSecure\ssl_client.cpp.o
Compiling .pio\build\esp32doit-devkit-v1\lib356\Update\HttpsOTAUpdate.cpp.o
Compiling .pio\build\esp32doit-devkit-v1\lib356\Update\Updater.cpp.o
Compiling .pio\build\esp32doit-devkit-v1\lib413\Firebase ESP32 Client\Firebase.cpp.o
*** [.pio\build\esp32doit-devkit-v1\liba11\SD_MMC\SD_MMC.cpp.o] Error 1
Compiling .pio\build\esp32doit-devkit-v1\lib413\Firebase ESP32 Client\json\FirebaseJson.cpp.o
Incidentally, since adding ‘lib_ldf_mode = chain+’ to the Platformio.ini file, I’m now receiving the above library dependency error (not the same error reported by the OP).