
在全球智能手机市场里,谷歌开发的安卓(Android)移动操作系统市场占有率已经高达90%。随着物联网智能硬件升级,安卓(Android)也逐渐成为智能摄像头,智能对讲门禁,人脸识别闸机,智能电视,智能广告屏等带屏 IoT 物联网设备的首选操作系统。
今天为大家详细讲解安卓 (Android) 终端通过 MQTT 协议接入阿里云 IoT 物联网平台的完整过程。
01
阿里云开发
1.开通阿里云 IoT物联网平台云服务:
https://www.aliyun.com/product/iot/iot_instc_public_cn

2.创建产品,选择自定义品类,直连设备:

3.在产品详情添加功能定义(物模型),我们以采集Android设备的硬件厂商、型号、Android版本、SDK版本信息为例:

物模型属性通信的Topic和Payload如下:
go
// 属性上报 Topic:
/sys/{productKey}/{deviceName}/thing/event/property/post
// 属性 Payload:
{
"id":123452452,
"version":"1.0",
"params":{
"brand":"HUAWEI",
"model":"ELE-AL00",
"android":"10",
"sdk":29
},
"method":"thing.event.property.post"
}
参考文档:
https://help.aliyun.com/zh/iot/user-guide/device-properties-events-and-services
4.注册设备,此时设备为未激活状态。
