Trouble with Arduino and Firebase

Submitted by samuel_l_j on Fri, 06/05/2020 - 03:19

Good Evening. I have some troubles with my ESP8266 and Firebase. I have to read temperature values from a Firebase Databse. Then I have to read some temperature values with my DHT11 sensor and then i have to send all values in a new Firebase RealTime Database. When i verify my code i have this error.

Arduino:1.8.12 (Windows 10), Scheda:"Generic ESP8266 Module, 80 MHz, Flash, Legacy (new can return nullptr), All SSL ciphers (most compatible), 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/john/appdata/local/arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/2.5.0-4-b40a506/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld.exe: sketch\sketch_jun04c.ino.cpp.o:C:\Users\alix1\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.1\cores\esp8266/WString.h:324: undefined reference to `bool FirebaseJson::set<float>(String const&, float)'

c:/users/john/appdata/local/arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/2.5.0-4-b40a506/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld.exe: sketch\sketch_jun04c.ino.cpp.o: in function `loop':

C:\Users\john\Documents\Arduino\sketch_jun04c/sketch_jun04c.ino:38: undefined reference to `bool FirebaseJson::set<float>(String const&, float)'

collect2.exe: error: ld returned 1 exit status

exit status 1

The sketch is:

#define WIFI_SSID "XXXXXXXX"
#define WIFI_PASSWORD "XXXXXXXX"
#define DHTPIN 2
#define DHTTYPE DHT11
#define FIREBASE_HOST1 "XXXX"
#define FIREBASE_AUTH1 "XXXX"
#include "FirebaseESP8266.h"
#include <ESP8266WiFi.h>
#include <DHT.h>
FirebaseData firebaseData;
DHT dht(DHTPIN,DHTTYPE);
#define FIREBASE_HOST2 "XXXXX"
#define FIREBASE_AUTH2 "XXXXX"

 

void setup() {
 Serial.begin(9600);
dht.begin();

 WiFi.mode(WIFI_STA);
  WiFi.begin(WIFI_SSID, WIFI_PASSWORD);
  delay(2000);
  Serial.print("I am connetting...);
  while (WiFi.status() != WL_CONNECTED) {
    Serial.print(".");
    delay(500);
  }
  Serial.println();
}

void loop() {
float int_temp=dht.readTemperature();

Firebase.begin(FIREBASE_HOST1, FIREBASE_AUTH1);
float ext_temp=Firebase.getFloat(firebaseData,"/temp");
Serial.println("Ext Temp is: \n");
Serial.print (ext_temp);Serial.print ("°C");

Firebase.begin(FIREBASE_HOST2, FIREBASE_AUTH2);
FirebaseJson updateData;

updateData.set("internal temperature: ", int_temp);
updateData.set("ext temperature: ", ext_temp);

 

Thanks to all!

 

Pls follow the this tutorial in the given link for simillar type of project.

https://circuitdigest.com/microcontroller-projects/sending-temperature-…

  Joined August 22, 2019      125
Thursday at 12:29 PM