Loading...

You have no items in your shopping cart.

 
 
 
×

Registration

Profile Informations

Login Datas

or login

First name is required!
Last name is required!
First name is not valid!
Last name is not valid!
This is not an email address!
Email address is required!
This email is already registered!
Password is required!
Enter a valid password!
Please enter 6 or more characters!
Please enter 16 or less characters!
Passwords are not same!
Terms and Conditions are required!
Email or Password is wrong!
Captcha is required!
Captcha is wrong!

IoTgo Arudino Library Preview

ITEADLIB_Arduino_IoTgo is an Arduino library specially written for IoTgo platform. It supports ESP8266, W5100/W5500, and SIM900/908 modules accessing and communicating to IoTgo platform through WIFI, GPRS, or Ethernet.

In previous two blogs, we've demonstrated how to remote monitor temperature and humidity and how to remote control a switch. In the part of codes using, we use the demos directly provided by IoTgo library, and the rest we need to do is to modify the API Key and Device ID. In this blog, we will take a further step to learn how to use this Arduino library.

Besides, this library supports three network connection modes including Ethernet, GPRS and WIFI(esp8266). Users can modify the connection mode by defining different macros in the configuration file IoTgo_config.h

#define NET_USE_ESP8266
//#define NET_USE_W5X00 
//#define NET_USE_GSM

When you use a different network connection mode in your Arduino library, you should note that the default configuration of hardware connections as below:

  • Use Serial as debugging port
  • ESP8266 communicates to MCU via Serial1
  • GSM module communicates to MCU via Serial1
  • Ethernet module communicates to MCU via SPI

In ITEADLIB_Arduino_IoTgo examples, there are some other hardwares such as button module or temperature and humidity sensor required, you can connect them to the mainboards according to the comments in each example.

So far, IoTgo only support three simple product classes: light, switch, temperature and humidity sensor, therefore the library only supports these three classes debugging. About these classes and supporting methods, click here.

Define an Object of Class Light

They are very easy to use. First, you need to define a device class, for example a light:

Light bedroom_LED (&eth, LIGHT_PIN);

Initialize the Connection between Device and IoTgo Platform

By running the above codes, you have defined a bedroom’s light, and its control pin is LIGHT_PIN. In this code, eth is related to your choice of network access. Meanwhile, before the device connects to the platform, you must initialize and configure the eth

The next step is to initialize the connection between your device and IoTgo platform.

bedroom_LED.init(api key, Device ID);

Control the Light

By using the existing several methods provided by Light class, we can control the physical light and make the data sync to IoTgo.

For example, turn on bedroom’s light

    bedroom_LED.on();

Similarly, turn off bedroom’s light

    bedroom_LED.off();

If you want to sync the light to the status of device in IoTgo (we assume that the status of device in IoTgo always keep the latest):

    bedroom_LED.sync(); //you will get the latest device status from IoTgo platform and the status will sync to the device.

Using the class definitions and methods provided by ITEADLIB_Arduino_IoTgo library, you can realize various control in a fast and convenient way. Although we only offer limited devices and the operations of them are simple, we will update the library and IoTgo constantly and add more devices in the future. We plan on adding many more features, such as light brightness and RGB color adjusting, mapping and location awareness for your devices, triggers based on custom parameters.

For more details, you can check its online documents here: http://docs.iteadstudio.com/IoTgo