Firebase stops working

When I run my program, the data is transmitted twice then the program shows me "setting / number failed:". On the other hand, I manage to obtain all my desired data, they are just not transmitted to Firebase.
I updated my fingerprint, and I was already able to transmit data continuously on firebase with a program other than this one.
What can I do ?

this is my code :

#include <SoftwareSerial.h>
#include <TinyGPS.h>
#include <Firebase.h>
#include <FirebaseArduino.h>
#include <FirebaseCloudMessaging.h>
#include <FirebaseError.h>
#include <FirebaseHttpClient.h>
#include <FirebaseObject.h>

#include <ESP8266HTTPClient.h>

#include <ESP8266WiFi.h>
#include <SoftwareSerial.h>
#include <ArduinoJson.h>

TinyGPS gps;
SoftwareSerial serialgps(2,3); //Port Rx et Tx gps

#define FIREBASE_HOST "####"
#define FIREBASE_AUTH "###"
const char* WIFI_SSID = "###";
const char* WIFI_PASSWORD = "####";
int Trigpin = 14; //On nomme entrée et sortie//
int Echopin=12;
long temps;
float distance,remplissage=0,pourcmax=0,maxi=0,tauxremp=0;
int year;
byte month, day, hour, minute, second, hundredths;
unsigned long chars;
unsigned short sentences, failed_checksum;

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

// Lancement gps
Serial.begin(9800);
serialgps.begin(9600);
Serial.println("");
Serial.println("GPS Shield QuickStart Example Sketch v12");
Serial.println(" ...waiting for lock... ");
Serial.println("");

pinMode(Trigpin,OUTPUT); // Trigger en sortie
pinMode(Echopin, INPUT); // Echo en entrée
digitalWrite(Trigpin, LOW);

}

void loop()
{

while(serialgps.available())
{
int c = serialgps.read();
if(gps.encode(c))
{
float latitude, longitude;
gps.f_get_position(&latitude, &longitude); //obtention des positions
Serial.print("Lat/Long: ");
Serial.print(latitude,6);
Serial.print(", ");
Serial.println(longitude,6);

gps.crack_datetime(&year,&month,&day,&hour,&minute,&second,&hundredths);
Serial.print("Date: "); Serial.print(month, DEC); Serial.print("/");
Serial.print(day, DEC); Serial.print("/"); Serial.print(year);
Serial.print(" Time: "); Serial.print(hour, DEC); Serial.print(":");
Serial.print(minute, DEC); Serial.print(":"); Serial.print(second, DEC);
Serial.print("."); Serial.println(hundredths, DEC);
Serial.print("Altitude (meters): "); Serial.println(gps.f_altitude());
Serial.print("Course (degrees): "); Serial.println(gps.f_course());
Serial.print("Speed(kmph): "); Serial.println(gps.f_speed_kmph());
Serial.print("Satellites: "); Serial.println(gps.satellites());
Serial.println();
gps.stats(&chars, &sentences, &failed_checksum);
delay(900);
Firebase.setFloat("Find_my_trash/Poubelle 1/Longitude",longitude);
Firebase.setFloat("Find_my_trash/Poubelle 1/Latitude",latitude);

digitalWrite(Trigpin,HIGH); // On envoie une impulsion de 10 microseconde ( permet de declencher une mesur
delayMicroseconds(10);
digitalWrite(Trigpin,LOW);

temps = pulseIn(Echopin, HIGH);
if(temps > 25000) {
Serial.println("Erreur");

}

else {

temps = temps/2;
distance = ( temps340)/10000.0;
remplissage = distance;
maxi = max(maxi, remplissage);
pourcmax = remplissage
100/maxi;
tauxremp = 100 - pourcmax;
tauxremp= constrain(tauxremp,0,100);
Serial.print("Distance de vide :");
Serial.print(distance);
Serial.print("cm");
Serial.print(" Le taux de remplissage est de : \t");
Serial.print(tauxremp);
Serial.print("%");

delay(9000);
Firebase.setFloat("Find_my_trash/Poubelle 1/Taux de remplissage",tauxremp);

// handle error
if (Firebase.failed()) {
Serial.print("setting /number failed:");
Serial.println(Firebase.error());
return;
}
}
}
}
}

@baguette_francaise Why do users choose to ignore the advice on posting code ?

The easier you make it to read and copy your code the more likely it is that you will get help

Please follow the advice given in the link below when posting code , use code tags and post the code here

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