Skip to content

sendTelemetryJson require a trick to work correctly #256

@HernanBadillaV

Description

@HernanBadillaV

Hello.

I have the next code working fine

void sendAllTelemetry() {
// Calcular el tamaño del JSON
size_t json_size = measureJson(submonitorTelemetry);

tb.sendTelemetryData("flush", 1);   // <-----
bool success = tb.sendTelemetryJson(submonitorTelemetry, json_size);
Serial.println(success ? "Envío exitoso" : "Error en el envío");
tb.sendTelemetryData("flush", 2);   // <-----

// Limpiar el documento JSON para la siguiente ronda
submonitorTelemetry.clear();
tb.loop();

}

However if I remove the lines
tb.sendTelemetryData("flush", 1); // <-----
tb.sendTelemetryData("flush", 2); // <-----

This instruction does not work correctly.
bool success = tb.sendTelemetryJson(submonitorTelemetry, json_size);
"success" result on true but the info does not reach the TB server.

I am development on windows 10 VSC 1.97.2 with platformio core (6.1.17) Home (3.4.4)

The code is running on esp32 wrover.

Best regards.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions