FirebaseExtended / firebase-arduino

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

ESP8266 not connecting to firebase! #455

Open joydhon opened 4 years ago

joydhon commented 4 years ago

My all code is correct no error. I also add all libraries but it didn't connect with firebase. I actually don't know what problem happening. please help me out. please

include

include "DHT.h"

include

define FIREBASE_HOST "testing-54634.firebaseio.com" // database URL

define FIREBASE_AUTH "99VSiqQi6RrOJOYWbi2fJuzOYszyRnsJKzzFULSQ" // secret key

define WIFI_SSID "combined-TP-Link-Pahely" // Change the name of your WIFI

define WIFI_PASSWORD "mogodaradha" // Change the password of your WIFI

define DHTPIN 14 // Data Pin of DHT 11 , for NodeMCU D5 GPIO no. is 14

define DHTTYPE DHT11

DHT dht(DHTPIN, DHTTYPE);

void setup() {

Serial.begin(115200); WiFi.begin (WIFI_SSID, WIFI_PASSWORD); while (WiFi.status() != WL_CONNECTED) { delay(500); Serial.print("."); } dht.begin(); Serial.println (""); Serial.println ("WiFi Connected!"); Firebase.begin(FIREBASE_HOST, FIREBASE_AUTH);

}

void loop() { if (Firebase.failed()) { delay(300); Firebase.begin(FIREBASE_HOST, FIREBASE_AUTH); Serial.println(Firebase.error()); Serial.println("Connection to fiebase failed. Reconnecting..."); delay(300); }

else { Serial.println("Everything is ready!"); delay(300); Serial.println("Everything is ready!"); delay(300); Serial.println("Everything is ready! \n \n \n"); delay(300);

float h = dht.readHumidity(); float t = dht.readTemperature(); // Reading temperature as Celsius (the default) Firebase.setFloat ("Temp",t); Serial.println(t); delay(200); Serial.println("uploaded temp to firebase \n \n \n");

Firebase.setFloat ("Humidity",h); Serial.println(h); delay(200); Serial.println("uploaded humidity to firebase \n \n \n"); }}

rayavarapuvikram1 commented 4 years ago

Did you check the connection of NodeMCU in list of connected devices of your modem?

Arafa-microsys commented 4 years ago

try this https://github.com/FirebaseExtended/firebase-arduino/issues/486#issuecomment-611798193