Go Down

Topic: Firebase-arduino esp 8266 database connectivity error (Read 337 times) previous topic - next topic

varun_pandey

Jul 13, 2017, 01:08 pm Last Edit: Jul 13, 2017, 01:33 pm by varun_pandey
I am getting run time error on serial port .i am able connect to my wifi router but  unabale to connect my firebase database  and the data is also not getting store in database



Mycode is FirebaseDemo_ESP8266

Code: [Select]


#include <ESP8266WiFi.h>
#include <FirebaseArduino.h>

// Set these to run example.
#define FIREBASE_HOST "https://xxxxxxxx.firebaseio.com/"

#define FIREBASE_AUTH "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"

#define WIFI_SSID "xxxxxxxxx"

#define WIFI_PASSWORD "xxxxxxxxxx"

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

  // 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);
}

int n = 0;

void loop() {
  // set value
  Firebase.setFloat("number", 42.0);
  // handle error
  if (Firebase.failed()) {
      Serial.print("setting /number failed:");
      Serial.println(Firebase.error()); 
      return;
  }
  delay(1000);
 
  // update value
  Firebase.setFloat("number", 43.0);
  // handle error
  if (Firebase.failed()) {
      Serial.print("setting /number failed:");
      Serial.println(Firebase.error()); 
      return;
  }
  delay(1000);

  // get value
  Serial.print("number: ");
  Serial.println(Firebase.getFloat("number"));
  delay(1000);

  // remove value
  Firebase.remove("number");
  delay(1000);

  // set string value
  Firebase.setString("message", "hello world");
  // handle error
  if (Firebase.failed()) {
      Serial.print("setting /message failed:");
      Serial.println(Firebase.error()); 
      return;
  }
  delay(1000);
 
  // set bool value
  Firebase.setBool("truth", false);
  // handle error
  if (Firebase.failed()) {
      Serial.print("setting /truth failed:");
      Serial.println(Firebase.error()); 
      return;
  }
  delay(1000);

  // append a new value to /logs
  String name = Firebase.pushInt("logs", n++);
  // handle error
  if (Firebase.failed()) {
      Serial.print("pushing /logs failed:");
      Serial.println(Firebase.error()); 
      return;
  }
  Serial.print("pushed: /logs/");
  Serial.println(name);
  delay(1000);
}



 My Firebase database rules are:

Code: [Select]

{
  "rules": {
    ".read": "auth != null",
    ".write": "auth != null"
  }
}

 Please help me as soon as possible.


AWOL

"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.
I speak for myself, not Arduino.

atiyka

Also posted at:
https://stackoverflow.com/q/45095295
The question is removed, and I have the same problem. Until now it worked very well and couple of days ago it just stopped working.
Has anybody ideas why?

rafaelxkr

#4
Sep 02, 2017, 10:45 pm Last Edit: Sep 02, 2017, 10:51 pm by rafaelxkr
resolved!!!!!!
https://pt.stackoverflow.com/questions/233332/esp8266-parou-de-comunicar-com-firebase#comment478896_233332

library update
https://github.com/RaemondBW/firebase-arduino/tree/master/src



fix problem
https://github.com/firebase/firebase-arduino/pull/277/commits/a23fb4e0a15e554e401150e25fc742f6a302b4c7


more information
https://github.com/firebase/firebase-arduino/pull/277

Sojue

remove the "https: //" from the FIREBASE_HOST, it has to be this way "//xxxxxxxx.firebaseio.com"

mine works perfectly

Go Up