Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to ArduinoJson V6 #35

Open
juppwerner opened this issue Sep 28, 2020 · 1 comment
Open

Upgrade to ArduinoJson V6 #35

juppwerner opened this issue Sep 28, 2020 · 1 comment

Comments

@juppwerner
Copy link

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

@HA4ever37
Copy link

This version works with ArduinoJson v6
https://github.com/HA4ever37/SPIFFSReadServer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants