Mejoras generales

This commit is contained in:
2025-04-24 01:18:40 +02:00
parent adb0be24a6
commit aa66d49d4f
8 changed files with 300 additions and 37 deletions

View File

@@ -15,7 +15,7 @@ async function subirDato(datos) {
}
const datosParaEnviar = {
created_at: datos.datetime,
delta_t: 1,
//delta_t: 1, // Activar si da problemas con el tiempo
field1: datos.paquetes,
field2: datos.temperatura,
field3: datos.presion,
@@ -27,11 +27,6 @@ async function subirDato(datos) {
longitude: datos.longitud
};
//console.log(datos);
//console.log(datosParaEnviar);
// Guardar datos en archivo: https://nodejs.org/en/learn/manipulating-files/writing-files-with-nodejs
peticionesRetrasadas.push(datosParaEnviar);
saveDataInFile(datos);
}
@@ -69,7 +64,7 @@ async function subirDatosDeGolpe(datosParaSubir) {
})
.then(response => response.json())
.then(data => {
//console.log(data);
console.log(data);
resultado = true; // Si todo sale bien, devolvemos true
})
.catch(error => {
@@ -100,7 +95,8 @@ async function bucleSubidaDatos() {
}
export {
subirDato
subirDato,
subirDatosDeGolpe
}
bucleSubidaDatos();