Skip to content

ESP8266 array of jsons #807

@KristianDukov

Description

@KristianDukov

Hello All,

I am having the following code where I create a JSON every couple of seconds with some measurements:

char buffer[256]; root["reps"] = n; root["power"] = powerContract; root["weight"] = weight; root["set"] = s; root["contract"] = contract; root["acc"] = "asd"; root["sensor"] = machine; root.printTo(buffer); String Json = String(buffer); webSocket.broadcastTXT(Json);

Sending via WS works fine and the message is readable.

What I am trying to do is to create a list of all measurements I guess as an array so I can upload it via API. I tried with

JsonArray& array = jsonBuffer2.createArray(); JsonObject& buffer = array.createNestedObject();
but I guess I am missing something. Can somebody help?

THank you in advance

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions