Please help me on this esp8266 project i't doesn't work and i'm tired

Hey does anyone can help me this my project is a code for motor servo that for esp8266 and connect to firebase realtimedatabse` and i having diffculty how get them working please help because when i try to fix it show error please help even though i try fix it

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

#define FIREBASE_HOST ""
#define FIREBASE_AUTH ""


const char *ssid1 = "";
const char *password1 = "";

const char *ssid2 = "";
const char *password2 = "";

#define servoPin D1
Servo servo;
int angle = 0;



void setup() {
  Serial.begin(9600);
  while (WiFi.status() != WL_CONNECTED) {
    mynetwork();
  }

  Firebase.begin(FIREBASE_HOST, FIREBASE_AUTH);
  Serial.println("Successfully Connected ");
 Firebase.setInt("angle",0);
 
   servo.attach(servoPin);
  servo.write(angle);
}
void mynetwork() {
  Serial.println("Searching WiFi.....");
  int networks = WiFi.scanNetworks();
  for (int i = 0; i < networks; ++i) {
    if (WiFi.SSID(i) == ssid1 ) {
      WiFi.begin(ssid1, password1);
      Serial.println("\nWiFi Found");
      delay(2000);
      Serial.println("Connecting Please Wait");
      break;
    }
    else if (WiFi.SSID(i) == ssid2) {
      WiFi.begin(ssid2, password2);
      Serial.println("\nWiFi Found");
      delay(2000);
      Serial.println("Connecting Please Wait");
      break;
    } else {
      Serial.println("Unable to Find Authenticated WiFi ");
    }
  }
  delay(8000);
}

int servoAngle;

void loop() {
  if (WiFi.status() == WL_DISCONNECTED) {
    Serial.println("WiFi Disconnected");
    setup();
  } else {
    Serial.println("Connected");
    servoAngle = Firebase.getInt("angle");
     servo.write(servoAngle);
  }
}

Please take the time to read How to get the best out of this forum.

Please remove the firebase and wireless password data from the code

1 Like

Please use code tags. Tell us what it does and what you wsnt it to ro ...

thank you and sorry i'm still new and just create this account

thank you for reply but i can't i need it because i need to them to put in realtimedatabase in firebase if i go delete it it's just become servo that rotating it'll self

sorry i'm new in this kind post and is error when compile it and i'dont know how to fix it again i even try it different version of ArduinoJson and the Firebase libray none of them is working

Ok, so it is a compiler error. What does the compiler say (copy paste compiler message).
You have published your secret firebase credentials on a public forum...

i fix it maybe you can view

i edit the code so you can try and see

What is myNetwork supposed to do? It is never called...

hai thank you for reply and sorry about the secret creditial newbie mistake and here the first error when i compiler and thisArduinoJson on the latest version (C:\Users\hp\Documents\Arduino\libraries\VEGA_FirebaseArduino-1.0.1\src/FirebaseObject.h:109:11: error: StaticJsonBuffer is a class from ArduinoJson 5. Please see Redirecting… to learn how to upgrade your program to ArduinoJson version 6)

Seems you have an older version of the arduinojson library than required for the firebase.
Upgrade your library as recommended...

but the problem is that i use the latest version of the arduino json version 6.21.3

oh my mistake and thank you for say it and sorry for newbie mistake

Have you tried to downgrade to version 5?

yes i already have downgrade to version 5 but still error message

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.