FirebaseExtended / firebase-arduino

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

streaming error firebase #441

Open nheoo opened 5 years ago

nheoo commented 5 years ago

Two days I did everything to connect to the firebase but I couldn't connect. below is my code. Looking for help plz:

include

include

define LedPin 16

define FIREBASE_HOST "nodemculed-32c6b.firebaseio.com"

define FIREBASE_AUTH "E7R2aboxbpvddXEDY9MBPLxyU2b4ZfNWtOpqXoLs"

define WIFI_SSID "conmabachbach"

define WIFI_PASSWORD "dung3gdi"

void setup() { pinMode(LedPin, OUTPUT); Serial.begin(115200); // 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.stream("/Myhome"); } void loop() { if (Firebase.failed()) { Serial.println("streaming error"); Serial.println(Firebase.error()); }

if (Firebase.available()) { FirebaseObject event = Firebase.readEvent(); String eventType = event.getString("type"); Serial.print("event: "); Serial.println(eventType); if (eventType == "put") { String path = event.getString("path"); String data = event.getString("data"); Serial.println(String("data: ") + data); if (path.equals("/light/value")) { if (data.equals("off")) { digitalWrite(LedPin, HIGH); } else { digitalWrite(LedPin, LOW); } } } } }

xritzx commented 4 years ago

Try connecting without the Auth Token. Make sure you are using DB secret key and not the API key

willyamcts commented 4 years ago

Which is error? @nheoo

kimpoy010 commented 3 years ago

also getting same "streaming error"

Serial.println(Firebase.error()) returns blank message