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

Firebase-arduino not work in PlatformIO #255

@xang555

Description

@xang555

when i use firebase-arduino in platformIO IDE . it can not work with firebase but when i use the same code in arduino IDE. it is work

here my code :

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

// Set these to run example.
#define FIREBASE_HOST "XXXXXX-281c0.firebaseio.com"
#define FIREBASE_AUTH "8miUWHWVrb5gTBxsraRs7Q60slKqrJRaXXXXX"

char* WIFI_SSID = "XXX";
char* WIFI_PASSWORD = "XXXXXX";

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

}

void loop() {
  // set value
uint8_t val =  Firebase.getInt("switchLigth/l002/state");
  // handle error
  if (Firebase.failed()) {
      Serial.print("setting /number failed:");
      Serial.println(Firebase.error());
      return;
  }

  Serial.println(val);

  delay(1000);
}

here result from PlatformIO

�connecting......
connected: 192.168.43.138
setting /number failed:
setting /number failed:
setting /number failed:
setting /number failed:

here result from Arduino IDE which it is work

connected: 192.168.43.138
1
1
1
1
1
1
1

what happen about this problem ?.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions