一、测试环境介绍
二、测试流程&结果
1、应用服务器运行webServer订阅
启动本地的Tomcat,加载OxygenCloud后,就会使用Id为webServer向Mosquitto订阅webServer主题。
2、命令行订阅设备SN码为10013主题
#mosquitto_sub -h 60.205.148.67-t 10013 -u admin -P password
3、设备SN码为10013发送上传数据到webServer
{"msgType":"InviteUpload","pressure":"6.3","sn":"10013","flowTotal":"1677","concentrer":"96.4","flow":"58","deviceStatus":"2"}
# mosquitto_pub -h 60.205.148.67-t webServer -u admin -P password -m"{\"msgType\":\"InviteUpload\",\"pressure\":\"5.3\",\"sn\":\"10013\",\"flowTotal\":\"1677\",\"concentrer\":\"96.4\",\"flow\":\"58\",\"deviceStatus\":\"2\"}"
4、设备SN码为10013上传开关机授权&开关机到webServer
{"msgType":"InviteOpen","sn":"10013","open":"0"}
#mosquitto_pub -h 60.205.148.67 -t webServer -u admin -P password -m"{\"msgType\":\"InviteOpen\",\"sn\":\"10013\",\"open\":\"0\"}"
{"openValid":"0","msgType":"InviteOpenValid","sn":"10013"}
#mosquitto_pub -h 60.205.148.67 -t webServer -u admin -P password -m"{\"msgType\":\"InviteOpenValid\",\"sn\":\"10013\",\"openValid\":\"0\"}
{"openValid":"1","msgType":"InviteOpenAll","sn":"10013","open":"1"}
#mosquitto_pub -h 60.205.148.67 -t webServer -u admin -P password -m"{\"msgType\":\"InviteOpenAll\",\"sn\":\"10013\",\"openValid\":\"1\",\"open\":\"1\"}"
5、设备SN码为10013上传警报消息
{"msgType":"InviteAlert","sn":"10013","alertMsg":"浓度低"}
#mosquitto_pub -h 60.205.148.67 -t webServer -u admin -P password -m"{\"msgType\":\"InviteAlert\",\"sn\":\"10013\",\"alertMsg\":\"浓度低\"}"
6、webClient下发数据上传频率到设备
{"hz":"5","msgType":"InviteHz"}
7、webClient下发警报参数到设备
{"cctUpTime":"300","msgType":"InviteAlertParam","psrDwonTime":"300","cctDownTime":"300","psrUp":"95","psrUpTime":"300","cctDown":"4.0","cctUp":"5.0","psrDwon":"87"}
8、webClient下发开关机授权&开关机到设备
{"openValid":"0","msgType":"InviteOpenValid","sn":"webServer"}