Skip to content

Upgrade to ArduinoJson V6 #35

@juppwerner

Description

@juppwerner

Hello,

I tested the example spiffs_rest_api_nonblocking.

In order to make this work with the current ArduinoJson V6.16.1, I replaced in functiom "server.on("/api", {}" around line 82:

//build json object of program data
const int capacity = JSON_OBJECT_SIZE(3);
StaticJsonDocument<capacity> doc;
// JsonObject json = jsonDoc.as<JsonObject>();
doc["x"] = x;
doc["y"] = y;

char jsonchar[200];
serializeJson(doc, jsonchar); //print to char array, takes more memory but sends in one piece
DEBUG_PRINT(jsonchar);

Regards

Joachim Werner

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions