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
  • #153
Closed
Open
Issue created Nov 07, 2015 by Administrator@rootContributor

OpenWeatherMap - very complex/multilevel Json data.

Created by: ethelder

Hello,

I'm trying to work with API for weather forcasting and had problems parsing data about weather id from this api call (9 hours ahead) :

{
  "city": {
    "id": 7530858,
    "name": "Poznań",
    "coord": {
      "lon": 16.901541,
      "lat": 52.400631
    },
    "country": "PL",
    "population": 0,
    "sys": {
      "population": 0
    }
  },
  "cod": "200",
  "message": 0.0154,
  "cnt": 3,
  "list": [
    {
      "dt": 1446919200,
      "main": {
        "temp": 285.84,
        "temp_min": 285.84,
        "temp_max": 285.84,
        "pressure": 1027.1,
        "sea_level": 1036.19,
        "grnd_level": 1027.1,
        "humidity": 95,
        "temp_kf": 0
      },
      "weather": [
        {
          "id": 500,
          "main": "Rain",
          "description": "light rain",
          "icon": "10n"
        }
      ],
      "clouds": {
        "all": 92
      },
      "wind": {
        "speed": 2.86,
        "deg": 262.503
      },
      "rain": {
        "3h": 0.045
      },
      "sys": {
        "pod": "n"
      },
      "dt_txt": "2015-11-07 18:00:00"
    },
    {
      "dt": 1446930000,
      "main": {
        "temp": 285.59,
        "temp_min": 285.588,
        "temp_max": 285.59,
        "pressure": 1026.19,
        "sea_level": 1035.37,
        "grnd_level": 1026.19,
        "humidity": 95,
        "temp_kf": 0
      },
      "weather": [
        {
          "id": 500,
          "main": "Rain",
          "description": "light rain",
          "icon": "10n"
        }
      ],
      "clouds": {
        "all": 56
      },
      "wind": {
        "speed": 3.87,
        "deg": 225.5
      },
      "rain": {
        "3h": 0.0225
      },
      "sys": {
        "pod": "n"
      },
      "dt_txt": "2015-11-07 21:00:00"
    },
    {
      "dt": 1446940800,
      "main": {
        "temp": 286.55,
        "temp_min": 286.549,
        "temp_max": 286.55,
        "pressure": 1024.19,
        "sea_level": 1033.33,
        "grnd_level": 1024.19,
        "humidity": 95,
        "temp_kf": 0
      },
      "weather": [
        {
          "id": 500,
          "main": "Rain",
          "description": "light rain",
          "icon": "10n"
        }
      ],
      "clouds": {
        "all": 80
      },
      "wind": {
        "speed": 5.6,
        "deg": 223.502
      },
      "rain": {
        "3h": 0.01
      },
      "sys": {
        "pod": "n"
      },
      "dt_txt": "2015-11-08 00:00:00"
    }
  ]
}

I want to get all of the weather id's and than to find out - will it be raining:) I know you have an example of "complex" in your wiki, but using JsonArray I still had problem parsing the value. I started a thread on Arduino forum as well. https://forum.arduino.cc/index.php?topic=357973.new

BTW - your example doesn't work on Arduino Yun until you add a while(!Serial) loop in setup.

Thanks for any help in advance.

Assignee
Assign to
Time tracking