Good day all,
I'm trying to upload the GPS neo-6m data to the firebase realtime database through the ESP8266 wifi module. but, after I uploaded the code nothing happen to the firebase and I can't find the latitude and longitude in the firebase.
can you please have a look at my code, please? I didn't receive any error messages when I uploaded the code.
#include <TinyGPS++.h>
#include <SoftwareSerial.h>
#include <ESP8266WiFi.h>
#include <FirebaseArduino.h>
#include <ArduinoJson.h>
#define FIREBASE_HOST
#define FIREBASE_AUTH
#define WIFI_SSID
#define WIFI_PASSWORD
static const int RXPin =0, TXPin =2;
static const uint32_t GPSBaud = 9600;
TinyGPSPlus gps;
// The serial connection to the GPS device
SoftwareSerial ss(RXPin, TXPin);
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);
Serial.begin(9600);
ss.begin(GPSBaud);
//Serial.println("a");
}
void loop() {
while (ss.available() > 0){
gps.encode(ss.read());
if (gps.location.isUpdated()){
Serial.print("Latitude= ");
Serial.print(gps.location.lat(), 6);
Firebase.pushString("/lat", "sd");
Serial.print(" Longitude= ");
Serial.println(gps.location.lng(), 6);
Firebase.pushString("/lng", "sd");
}
}}