Project Description

Overview

In this posting, we will introduce the client library of Thing + Cloud service that runs on WIZnet’s W7500x MCU. Thing + is a domestic company, DawWorks’ IoT Cloud platform service. It is based on easy and fast IoT service construction and supports various open source hardware (OSHW) such as Arduino and Beaglebone green.

SSL / TLS security support is required by default to work with the Thing + Cloud service. However, recently DaliWorks has provided a non-SSL port with Arduino thing + library for testing purposes for Arduino developers, so we have created a library that enables testing of Thing + Cloud in W7500x MCU.

The project code is based on the version 1.0.6 of Thing + Arduino library. We changed the existing library made in C ++ version to C and changed and ported various Arduino libraries to other available libraries.

For the subscription of Thing + service and registration of Gateway Device, please refer to ‘ User’s Guide of Arduino ‘ at the following link. 
Link: http://support.thingplus.net/en/open-hardware/arduino-noSSL-user-guide.html

Resources Link:
WIZnet Wiki Site: W7500x the Ethernet MCU ( W7500 / W7500P ) 
Unlike Works Website: http://www.daliworks.net
Thing, + Website: https://thingplus.net

 

Note: The code introduced in this article is written in C language based on Keil vision 5 and is designed to run on WIZnet’s W4500x based ARM Cortex-M0 based Ethernet MCU. However, because it is very simple and has little dependency on MCU if you use WIZnet’s Hardware TCP / IP core, you can easily port it.

 

Concept

  • Produced to be nearly identical to existing Arduino Thing + library
  • Portable C ++ code to C code, flexible to existing C-based development environment
  • Eclipse Paho MQTT client is used as MQTT client library, and commercial SSL / TLS security is added to create commercial IoT device that works with Thing + service

Porting

Configuring an Existing Arduino Library

thingplus_lib_stack_for_arduino

Change each part of existing Arduino library to available library and modify the behavior

  • MQTT Client:  PubSubClient library -> Eclipse Paho library
  • JSON Parser: ArduinoJSON library -> cJSON library
  • Other Ethernet and Time related libraries utilize W7500x Driver and WIZnet ioLibrary

Library configuration for W7500x and comparison with existing library

thingplus_lib_stack_for_w7500x

Source Code

debug_messages_for_trobleshooting

APIs

void thingplus_begin(uint8_t *mac, uint8_t *apikey)

void thingplus_connect(void)

void thingplus_disconnect(void)

uint8_t thingplus_loop(void)

uint8_t thingplus_gatewayStatusPublish(uint8_t on, time_t durationSec)

uint8_t thingplus_sensorStatusPublish(const uint8_t *id, uint8_t on, time_t durationSec)

uint8_t thingplus_valuePublish_str(const uint8_t *id, char *value)

uint8_t thingplus_valuePublish_int(const uint8_t *id, int value)

uint8_t thingplus_valuePublish_float(const uint8_t *id, float value)

uint8_t thingplus_actuatorCallbackSet(uint8_t* (cb)(const uint8_t id, const uint8_t* cmd, cJSON *options))

Usage Comparison

Arduino Ver. VS WIZnet W7500x Ver.

  • Both the Arduino library and the implemented W7500x library work in almost the same main routine structure
  • If SSL / TLS support library is made later, the prototype structure in Arduino can be implemented in the same

usage_comparison

Thing+ Dashboard Example

demo_dashboard_for_wiz750sr

 

Source : https://ericslabs.wordpress.com/2016/10/10/thing-cloud-service-client-library-for-w7500x-mcu/