Project Description

This post shows how to use HTTPClient parse JSON data in the ARMmbed platform.

w7500

JSON is easy for machines to parse and generate which is based on a subset of the JavaScript Programming Language. Currently, many Web Services allow accessing data in JSON format. However, JSON parser is too big for the low-end device as like an ARMmbed platform which has limited-resource. This post shows how to use HTTPClient parse JSON data in the ARMmbed platform.

Preparation materials

  1. Software

* JSON Parser: MbedJSONValue libs
* Ethernet Networking: WIZnetInterface
* HTTP Server with JSON: Fraka6 Blog – No Free Lunch: The simplest python server example 
2. Hardware
* WIZwiki-W7500ECONET: WIZwiki-W7500 + ECO Shield Ethernet

IMG_20151029_164448

  • ARMmbed Board: WIZwiki-W7500ECO
    wizwiki-w7500eco_simplepinout
  • Ethernet Shield: ECO Shield Ethernet
    wizwiki-w7500eco_shield_pinout
  • Simplest python JSON server on PC

    • Reference : fraka6.blogsopot.kr: The simplest python server example
    • Modify Server IP address & port on ron_handler
    • Modify JSON form in do_GET handler
    • Excute json_server
    • Test by using curl

    Make main.cc

    1. Network Configration for WIZwiki-W7500ECO
    2. TCP connect to simple python JSON server
    3. Make Get form in HTTP format
    4. TCP Send Get form
    5. TCP Recv data in JSON format
    6. Do JSON parse
    7. Output the parsed data

    Demo. HTTPClient with JSON parser

    1. Network config.
    2. Confirm Received JSON data
    3. Print-out the passing data

code

 

Bitbucket
Source:

https://www.hackster.io/embeddist/wizwiki-w7500eco-httpclient-with-json-parser-f96641