FirebaseExtended / firebase-arduino

Arduino samples for Firebase.
Apache License 2.0
943 stars 494 forks source link

Esp is not connecting to the firebase. This is my project code i am not able to receive the data in the firebase database. what my be the error. #486

Closed ghost closed 4 years ago

ghost commented 4 years ago

include

include

define FIREBASE_HOST "arduinotest-f6d5e.firebaseio.com"

define FIREBASE_AUTH "u65MmIKJqyvHoUmG6hMMK0KoCuMYl7ZRF06Y4JFG"

define WIFI_SSID "kick"

define WIFI_PASSWORD "12345678"

float fire; void setup() { Serial.begin(9600); pinMode(D5, OUTPUT); pinMode(D6, OUTPUT); pinMode(A0, INPUT); // connect to wifi. WiFi.begin(WIFI_SSID, WIFI_PASSWORD); Serial.print("connecting"); while (WiFi.status() != WL_CONNECTED) { Serial.print("."); delay(500); } Serial.println(); Serial.print("connected: "); Serial.println(WiFi.localIP()); Firebase.begin(FIREBASE_HOST, FIREBASE_AUTH); Firebase.set("LED_STATUS", 0); } int n = 0; void loop() { int analogValue = analogRead(A0); float millivolts = (analogValue/1024.0) * 3300; //3300 is the voltage provided by NodeMCU float celsius = millivolts/10;

Serial.print("in DegreeC= "); Serial.println(celsius); delay(1); if(celsius>35){ digitalWrite(D6,HIGH); Firebase.setInt("fire_sensor_status",1); } n = Firebase.getInt("LED_STATUS"); // handle error if (n==1) { Serial.println("LED ON"); digitalWrite(D5,HIGH);
return; delay(10); } else { Serial.println("LED OFF"); digitalWrite(D5,LOW);
digitalWrite(D6,LOW);
Firebase.setInt("fire_sensor_status",0); return; } }

Arafa-microsys commented 4 years ago

Your problem in Fingerprint, the fingerprint of firebase is changing every short period, So the library doesn't work and you need to change fingerprint with a new one. I advise you to use the best version of this Library and the new one not based on Fingerprint so if changed any time you will not worry about that. https://github.com/mobizt/Firebase-ESP8266 but if you want to use this old library you can follow the instructions here to change fingerprint to a new one #439.