-
Please help I'm trying to push data of three sensors to my real-time database using esp8266 and figure out the error's CODE: #include <Arduino.h> #include <Firebase_ESP_Client.h> /* 1. Define the WiFi credentials */ /* 2. If working with RTDB, define the RTDB URL and database secret */ /* Define the Firebase Data object */ #define DHTPIN 2 // Digital pin connected to DHT11 int Gas_analog = A0; void setup() WiFi.begin(WIFI_SSID, WIFI_PASSWORD); Serial.printf("Firebase Client v%s\n\n", FIREBASE_CLIENT_VERSION); /* Initialize Firebase */ /* Enable auto reconnect */ void sendDataToFirebase(float temperature, int gasSensorAnalog, float humidity) FirebaseJson json; // Set temperature, gas, and humidity values in Firebase JSON object // Convert JSON object to string // Set the JSON string to Firebase void readFileFromFirebase()
} void loop() float humidity = dht.readHumidity(); if (gasSensorAnalog > 300) Serial.print("Humidity: "); sendDataToFirebase(temperature, gasSensorAnalog, humidity); delay(1000); |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Error codes are: Arduino: 1.8.19 (Windows 10), Board: "Generic ESP8266 Module, 80 MHz, Flash, Disabled (new aborts on oom), Disabled, All SSL ciphers (most compatible), 32KB cache + 32KB IRAM (balanced), Use pgm_read macros for IRAM/PROGMEM, dtr (aka nodemcu), 26 MHz, 40MHz, DOUT (compatible), 1MB (FS:64KB OTA:~470KB), 2, nonos-sdk 2.2.1+100 (190703), v2 Lower Memory, Disabled, None, Only Sketch, 115200" C:\Users\aadit\OneDrive\Desktop\code\code.ino: In function 'void setup()': code:16:23: error: cannot convert 'const char [19]' to 'FirebaseConfig*' {aka 'fb_esp_cfg_t*'} 16 | #define FIREBASE_HOST "YOUR_FIREBASE_HOST" // e.g., yourproject.firebaseio.com
C:\Users\aadit\OneDrive\Desktop\code\code.ino:16:23: note: in definition of macro 'FIREBASE_HOST' 16 | #define FIREBASE_HOST "YOUR_FIREBASE_HOST" // e.g., yourproject.firebaseio.com
In file included from C:\Users\aadit\OneDrive\Documents\Arduino\libraries\Firebase-ESP-Client-main\src/Firebase_ESP_Client.h:34,
C:\Users\aadit\OneDrive\Documents\Arduino\libraries\Firebase-ESP-Client-main\src/Firebase.h:139:30: note: initializing argument 1 of 'void Firebase_ESP_Client::begin(FirebaseConfig*, FirebaseAuth*)' 139 | void begin(FirebaseConfig *config, FirebaseAuth *auth);
C:\Users\aadit\OneDrive\Desktop\code\code.ino: In function 'void sendDataToFirebase(float, int, float)': code:63:8: error: 'class FirebaseJson' has no member named 'setFloat' 63 | json.setFloat("number", temperature);
code:64:8: error: 'class FirebaseJson' has no member named 'setInt' 64 | json.setInt("Gas", gasSensorAnalog);
code:65:8: error: 'class FirebaseJson' has no member named 'setFloat' 65 | json.setFloat("age", humidity);
code:72:16: error: 'class Firebase_ESP_Client' has no member named 'setString' 72 | if (Firebase.setString(fbdo, "/players/John", jsonString))
Multiple libraries were found for "SD.h" Used: C:\Users\aadit\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.1.2\libraries\SD Not used: C:\Program Files (x86)\Arduino\libraries\SD exit status 1 cannot convert 'const char [19]' to 'FirebaseConfig*' {aka 'fb_esp_cfg_t*'} This report would have more information with |
Beta Was this translation helpful? Give feedback.
-
Database secret is deprecated. Please follow these examples for how to authenticate and access the Firebase service as a user (client). If you prefer to use database secret (legacy and insecure), please follow this example. |
Beta Was this translation helpful? Give feedback.
Database secret is deprecated. Please follow these examples for how to authenticate and access the Firebase service as a user (client).
If you prefer to use database secret (legacy and insecure), please follow this example.