Dx-C511模块连接华为云OTA

1、配置APN

AT+QICSGP=1,1,”cmnbiot”,””,””

2、开启移动网络

AT+NETOPEN

3、设置客户端ID

AT+MCONFIG=”id”,”用户名”,”密码”AT+MCONFIG="667145986bc31504f06f60ee_wulianwang_0_0_20","667145986bc31504f06f60ee_wulianwang","63e106dff798f9ed7d313f33c5e1cffe4ad206abe2121b993d464a8f111a97ba"

4、连接mqtt服务器

AT+MIPSTART=”服务器IP地址”,1883,4

AT+MIPSTART="0ae1ed433d.st1.iotda-device.cn-north-4.myhuaweicloud.com",1883,4

5、连接服务器,设置心跳60秒

AT+MCONNECT=1,60

6、订阅数据

AT+MSUB="$oc/devices/667145986bc31504f06f6/sys/events/down",0

7、发布长数据

AT+MPUBEX="$oc/devices/667145986bc31504f06f/sys/events/up",0,0,149

{“services”:[{“service_id”:”$ota”,”event_type”:”version_report”,”event_time”:”20151212T121212Z”,”paras”:{“sw_version”:”v1.0”,”fw_version”: “v1.0”}}]}

8、开启HTTP模式

AT$HTTPOPEN

9、发送请求头

AT$HTTPRQH=Authorization,Bearer 627fd1b1a3f07e7e977b388c112a3af8acf60349c885e3d7c4490661e208b64a

10、发送URL

AT$HTTPPARA=https://117.78.5.125:8943/iodm/dev/v2.0/upgradefile/applications/d47eeb52098345898ba95b1be5cbd7c4/devices/667145986bc31504f06f60ee_wulianwang/packages/66e2cfd51bd30f6d19a24533,8943,1,0

11、发送get请求

AT$HTTPACTION=0