Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • A ArduinoJson
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 24
    • Issues 24
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Benoît Blanchon
  • ArduinoJson
  • Issues
  • #772
Closed
Open
Issue created Jun 29, 2018 by Administrator@rootContributor

MsgPack 6.0.1-beta

Created by: trap98

Hey, i'm updating my project for use your new feature 'MsgPack', after 1 day i'm okay with the new API and i try to use this feature. I can serialize without any problem but when I try to deserialize, and serialize in json format this time, my json is empty. I think i don't understand the API or idk, someone can help me ? thanks. Esp8266 - master expressif

String CoolFileSystem::getSavedLogAsString(int num) {
  char path[32];
  String data;
  DynamicJsonDocument document;
  snprintf(path, 32, "/log/%d.json", num);
  File f = SPIFFS.open(path, "r");

  if (!f) {
    ERROR_VAR("Failed to data file:", path);
    return data;
  }
  deserializeMsgPack(document, f);
  serializeJson(document, data);
  DEBUG_VAR("Read data file:", path);
  DEBUG_VAR("Data file content:", data);
  f.close();
  yield();
  return data;
}

my file :

��state��reported��timestamp�2018-06-29T14:17:11Z�mac�2C3AE84FC076�firmwareVersion�v0.2.6-2-g0ea852c�visibleLight�infraRed�ultraViolet�Temperature�Pressure�Humidity�Vbat�soilMoisture�ActB

my serial output :

DEBUG: Data file content: {}
DEBUG: Saved JSON data to send: {}
Assignee
Assign to
Time tracking