by Eric Jung (中文版)

image

This project is to make a simple RESTful Web service library for IoT Devices. The library is written with C language code and on WIZwiki-W7500ECO platform board from WIZnet. With it, users can implement a RESTful Web service on IoT devices easily. Monitoring IoT devices can be done by RESTful API based on JSON, as well.

* Frozen JSON parser and generator for C/C++ included

* APIs for HTTP POST method will be added

* The post will be update continuously

I’ve also posted this at Instructables.

Step 1: Parts

image

WIZnet WIZwiki-W7500ECO Platform board

WIZwiki-W7500ECO is a compact platform board based on W7500, which is a SOC chip that integrates an ARM Cortex-M0, 128KB Flash memory and hardwired TCP/IP core.
W7500 is the best fit to IoT devices.

A computer for using KEIL uVision5 IDE

These library is developed and compiled with uVision5 IDE.

Step 2: Download, Build and RUN

Download the RESTful Web Server & I/O Control by REST API Project on GitHub repository

GitHub Repository
https://github.com/hkjung/REST-web-server-WIZwiki-…

Build and Firmware write to target board: WIZwiki-W7500ECO

Project Build

Firmware Write

  • Writing firmware into WIZwiki-W7500ECO has three ways
  • Using the CMSIS-DAP (Drag and Drop)
  • Using the CMSIS-DAP (through KEIL uVision5)
  • Using the ISP (ISP, In-System Programming)

Please refer to WIZnet wiki site; How to write the firmware into WIZwiki-W7500P

Step 3: REST API Design

REST API Document is under construction.

[:id] : pre-defined 4-IO pins, ‘a’, ‘b’, ‘c’, ‘d’.

  • ‘a’ : P30 pin (digital input / digital output / analog input)
  • ‘b’ : P29 pin (digital input / digital output / analog input)
  • ‘c’ : P28 pin (digital input / digital output / analog input)
  • ‘d’ : P27 pin (digital input / digital output / analog input)

HTTP GET method: Get the device info and IO status / value

HTTP POST method: Enable the assigned IO

HTTP PUT method* : Set the IO status (digital output only) and IO configuration

*(in development)

HTTP DELETE method: Disable the assigned IO

Step 4: Testing

Serial Debug messages

image

Connect your board to your network and REST API Testing with test tool. These library has been tested on Postman Builder. For more details about Postman, please refer to Postman Chrome webstore.

HTTP Get Method:

image
image
image
image
image
image

HTTP POST / DELETE Method:

image
image

HTTP Errors:

image
image
image