Skip to content
This repository was archived by the owner on Mar 17, 2025. It is now read-only.

Undefined Error #303

Closed
rohitmsaxena opened this issue Dec 22, 2017 · 5 comments
Closed

Undefined Error #303

rohitmsaxena opened this issue Dec 22, 2017 · 5 comments
Labels

Comments

@rohitmsaxena
Copy link

rohitmsaxena commented Dec 22, 2017

When I run my code on my esp8266 it connects to the wifi and then attempts to connect to firebase once, fails, and then gives no error. It literally just says "failed at..." and then nothing so there is no error.

Can someone explain to me what I am doing wrong??

This is my code:

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

#define WIFI_SSID "Gumby"
#define WIFI_PASSWORD <something>
#define FIREBASE_DB_URL "http://<something>.firebaseio.com"
#define FIREBASE_DB_SECRET_KEY <secret>

void setup() {
  Serial.begin(115200);
  Serial.println("code running");
  pinMode(D1, OUTPUT);
  pinMode(D2, OUTPUT);
  WiFi.begin(WIFI_SSID, WIFI_PASSWORD);
  while (WiFi.status() != WL_CONNECTED) {
    Serial.println("attemping to connect to wifi...");
    delay(500);
  }
  
  Firebase.begin(FIREBASE_DB_URL, FIREBASE_DB_SECRET_KEY);
  Firebase.stream("/automation");
  Serial.println("done with setup");
}


void loop() {
  //Serial.println("looping...");
  if (Firebase.failed()) {
    Serial.println("streaming error");
    Serial.println(Firebase.error());
  }
  
  if(Firebase.available()){
    String output = Firebase.getString("value");
    Serial.print("output: ");
    Serial.println(output);
    if(Firebase.failed()) {
      Serial.print("failed at...");
      Serial.println(Firebase.error());
    }
  } else {
    Serial.println("error firebase not available");
  }
}
@srph
Copy link

srph commented Dec 23, 2017

Same, Firebase.error() is blank.

@JuanPTM
Copy link

JuanPTM commented Jan 2, 2018

It may be because you have your host defined as:

#define FIREBASE_DB_URL "http://<something>.firebaseio.com"

Try without the "http://", as:

#define FIREBASE_DB_URL "<something>.firebaseio.com"

I hope this helps you

@proppy
Copy link
Contributor

proppy commented Jan 31, 2018

@JuanPTM Thanks for answering this question!

@Mastermind42 @srph do you still have issues with the libraries?

@srph
Copy link

srph commented Jan 31, 2018

IIRC @JuanPTM's suggestion fixed it for me.

@proppy
Copy link
Contributor

proppy commented Jun 15, 2018

filed #349 to improve error message.

@proppy proppy closed this as completed Jun 15, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants