OneNET平台远程温湿度监测系统实训报告
1.项目背景
在现代农业当中,为了确保能够精确准时的测量大棚产业的温度湿度,所以利用物联网技术建设远程温湿度系统,能够及时准确的观察温湿度。
2.项目目标
1.注册OneNET平台账号和完成学生认证
2.在OneNET平台上添加自己的产品与设备
3.设备在线数据上报
4.通过串口查看实时数据
5.OneNET平台查看温湿度数据
3.实验步骤
1.OneNET平台注册和认证
2.在OneNET上添加产品
3.添加设备
4.设备在线数据正常上报
5.关键代码
更改自己的IMEI、IMSI
const char endpoint_name[] = "211501083029506;1";
温度资源
temp.type = NBIOT_FLOAT;
temp.flag = NBIOT_READABLE;
ret = nbiot_resource_add(dev,
3303, /* objId */
0, /* instId */
5700, /* resId */
&temp);
if (ret)
{
nbiot_device_destroy(dev);
printf("device add resource(temp) failed, code = %d.\r\n", ret);
}
湿度资源
humi.type = NBIOT_FLOAT;
humi.flag = NBIOT_READABLE;
ret = nbiot_resource_add(dev,
3304,
0,
5700,
&humi);
if (ret)
{
nbiot_device_destroy(dev);
printf("device add resource(humi) failed, code = %d.\r\n", ret);
}
6.OneNET平台查看温湿度数据
查看温湿度数据
7.串口发送资源数据
1.[2021-03-23_14:24:42:624]H?send data:AT+MIPLNOTIFY=0,3303,0,5700,4,"22.410000",1
2.[2021-03-23_14:24:46:738]Data:AT+MIPLNOTIFY=0,3303,0,5700,4,"22.410000",1
3.[2021-03-23_14:24:46:876]send data:AT+MIPLNOTIFY=0,3304,0,5700,4,"48.168739",1
4.[2021-03-23_14:24:46:879]Data:AT+MIPLNOTIFY=0,3304,0,5700,4,"48.168739",1
5.[2021-03-23_14:25:01:791]cmd:AT+NRB
6.[2021-03-23_14:25:11:797]cmd:AT+CIMI
7.[2021-03-23_14:25:14:238]cmd:AT+CMVER
8.[2021-03-23_14:25:20:287]cmd:AT+CMEE=1
9.[2021-03-23_14:25:22:709]cmd:AT+CSCON=1
10.[2021-03-23_14:25:25:131]cmd:AT+CEREG=2
11.[2021-03-23_14:25:27:553]cmd:AT+CEDRXS=0,5
12.[2021-03-23_14:25:31:180]cmd:AT+CPSMS=0
13.[2021-03-23_14:25:34:802]cmd:AT+CEREG?
14.[2021-03-23_14:25:38:456]cmd:AT+csq[2021-03-23_14:25:40:891]cmd:AT+MIPLCONF=57,000000002C0100001900636F61703A2F2F3138332E3233302E34302E34303A3536383311003231313530313038333032393530363B31050502,1,1
15.[2021-03-23_14:25:41:422]cmd:AT+MIPLADDOBJ=0,3303,0
16.[2021-03-23_14:25:41:817]send data:AT+MIPLNOTIFY=0,3303,0,5700,4,"1234",0
17.[2021-03-23_14:25:41:822]Data:AT+MIPLNOTIFY=0,3303,0,5700,4,"1234",0
18.[2021-03-23_14:25:41:998]cmd:AT+MIPLADDOBJ=0,3304,0
19.[2021-03-23_14:25:42:392]send data:AT+MIPLNOTIFY=0,3304,0,5700,4,"1234",0
20.[2021-03-23_14:25:42:397]Data:AT+MIPLNOTIFY=0,3304,0,5700,4,"1234",0
21.[2021-03-23_14:25:42:573]cmd:AT+MIPLOPEN=0,30
4.实训总结
这次的实训很有收获,知道了平台的使用,串口的调试,知道设备采集数据使如何上传到平台,学会了简书如何编写,唯一不足就是设备有许多使用不了。