Skip to content
GitLab
    • Explore Projects Groups Snippets
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
  • #794
Something went wrong while setting issue due date.
Closed
Open
Issue created 6 years ago by Administrator@rootContributor
  • New related issue

  • Report abuse to administrator

  • New related issue

  • Report abuse to administrator

I can not get data

Closed

I can not get data

Created by: ghost

Hi, BBlanchon!

I need help. Use ESP8285.

void onEvent(AsyncWebSocket * server, AsyncWebSocketClient * client, AwsEventType type, void * arg, uint8_t * data, size_t len) {
  if (type == WS_EVT_DATA) {
    Serial.println((char*)data);        // I get a valid package (as below)
    DynamicJsonDocument doc;
    DeserializationError error = deserializeJson(doc, (char*)data);
    if (error) {
      Serial.println("Error Pack");
      return;
    }
    JsonObject root = doc.as<JsonObject>();

    if (root["setSC"]) {
      Serial.println(root["setSC"]);  // I get nothing???
    }
  }
}

This is the received package from websocket:

{"setSC":
  [
    {
      "ID":0,
      "NM":"-= 0 =-",
      "EN":false,
      "AP":"10",
      "EV":[{"da":"82894F","pr":[[0,5],[0,4]]}],
      "AC":[{"da":"82894F","pr":[[3,2],[0,2]]}]
    },
    {
      "ID":1,
      "NM":"-= 1 =-",
      "EN":true,
      "AP":"12",
      "EV":[{"da":"82894F","pr":[[1,3],[0,0]]}],
      "AC":[{"da":"82894F","pr":[[2,3],[0,4]]}]
    }
  ]
}

I need to get only an array belonging to "setSC" How do I get the whole array?

  1. Oh no!

    You are trying to upload something other than an image. Please upload a .png, .jpg, .jpeg, .gif, .bmp, .tiff or .ico.

    Incoming!

    Drop your designs to start your upload.
Tasks
0
server returned results with length 1, expected length of 9

Linked items
0

Link issues together to show that they're related. Learn more.

Activity


Please register or sign in to reply
0 Assignees
None
Assign to
Labels
0
None
0
None
    Assign labels
  • Manage project labels

Milestone
No milestone
None
Due date
None
None
None
Time tracking
No estimate or time spent
Confidentiality
Not confidential
Not confidential

You are going to turn on confidentiality. Only project members with at least the Reporter role, the author, and assignees can view or be notified about this issue.

Lock issue
Unlocked
1
1 participant
Administrator
Reference:

Menu

Explore Projects Groups Snippets