You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
in my fonction of updating the RTBD alwys only the first RTDB instruction work and then for the set it alwyas take sometimes and r=then say time out this my code
void updateFirebase(uint16_t fingerID) {
Serial.println("Updating Firebase...");
String path = "/smartOffice/workers/worker" + String(fingerID);
String time = printLocalTime();
Firebase.RTDB.getString(&fbdo, path + "/timeIn");
String timeIn = fbdo.to();
if (timeIn == "none") {
Serial.println("Worker has just arrived");
delay(2000);
if (Firebase.RTDB.pushString(&fbdo, path + "/timeIn", time)) {
Serial.println("Firebase timeIn updated successfully");
} else {
Serial.println(fbdo.errorReason());
Serial.println("Error updating Firebase timeIn");
}
} else {
Serial.println("Worker has just left");
delay(1000);
if (Firebase.RTDB.pushString(&fbdo, path + "/timeOut", time)) {
Serial.println("Firebase timeOut updated successfully");
} else {
Serial.println(fbdo.errorReason());
Serial.println("Error updating Firebase timeOut");
}
}
}
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
in my fonction of updating the RTBD alwys only the first RTDB instruction work and then for the set it alwyas take sometimes and r=then say time out this my code
void updateFirebase(uint16_t fingerID) {
Serial.println("Updating Firebase...");
String path = "/smartOffice/workers/worker" + String(fingerID);
String time = printLocalTime();
Firebase.RTDB.getString(&fbdo, path + "/timeIn");
String timeIn = fbdo.to();
if (timeIn == "none") {
Serial.println("Worker has just arrived");
delay(2000);
if (Firebase.RTDB.pushString(&fbdo, path + "/timeIn", time)) {
Serial.println("Firebase timeIn updated successfully");
} else {
Serial.println(fbdo.errorReason());
Serial.println("Error updating Firebase timeIn");
}
} else {
Serial.println("Worker has just left");
delay(1000);
if (Firebase.RTDB.pushString(&fbdo, path + "/timeOut", time)) {
Serial.println("Firebase timeOut updated successfully");
} else {
Serial.println(fbdo.errorReason());
Serial.println("Error updating Firebase timeOut");
}
}
}
Beta Was this translation helpful? Give feedback.
All reactions