介绍

 

硬件

  • Arduino Uno
  • TONYLABS CC3000 Shield
Property Description
Microcontroller ATmega328
Operating Voltage 5V
Input Voltage (recommended) 7-12V
Digital I/O Pins 14 (of which 6 provide PWM output)
Analog Input Pins 6
Flash Memory 32 KB (ATmega328) of which 0.5 KB used by bootloader
EEPROM 1 KB (ATmega328)
Clock Speed 16 MHz

 注册新帐号

register_new_user

 

登录

signin_iot

 

添加新设备

http://121.40.153.169/Device/add

iot_add_new_device

添加数据通道

通道名称即为数值传输的识别标识,如将一个温度传感器设备虚拟化为物联网节点,平台只需获取“温度”这一单一数值,则添加 temperature(可自定义)作为数据通道的名称,如果将一个 GPS 虚拟化为物联网节点,则创建至少2个数据通道,如 longitude, latitude 作为2个通道各自的名称。

iot-add-channel-sample

 

调试程序

下载 IOTChannelExample 例程,编辑用户自定义参数,此例程是通过 A0 IO 读取 NTC 100K 热敏电阻,获取温度,并上传

// User parameters
#define WLAN_SSID "SSID"
#define WLAN_PASS "PASSWORD"
#define WLAN_SECURITY WLAN_SEC_WPA2
#define UUID "YOUR OWN UUID"

修改数据流

temperature = analogRead(temperature_pin);
temperature = celsius(temperature);

// JSON data
String data = "";
data = data + "\n" + "{\"version\":\"1.0.0\",\"datastreams\":[ "
 + "{\"channel\" : \"Temperature\",\"value\" : \"" + temperature + "\"},"
 + "{\"channel\" : \"Humidity\",\"value\" : \"" + 2 + "\"}]}";

 

如果一切正常,应返回

HTTP/1.1 200 OK

图表

iot-chart-sample