guowenxue
2019-06-26 1d2b49e4c8d6a3c93973772e661900dfff8c6102
add publish_test.sh tools in mqttd
1 files added
36 ■■■■■ changed files
mqttd/tools/publish_test.sh 36 ●●●●● patch | view | raw | blame | history
mqttd/tools/publish_test.sh
New file
@@ -0,0 +1,36 @@
#!/bin/bash
progname=mosquitto_pub
hostname="master.iot-yun.com"
port=10883
uid="lingyun"
pwd="lingyun-emb"
dltopic="\$Sys/Studio/Downlink"
uptopic="\$Sys/Studio/Uplink"
pub_downlink_cmd="$progname -h $hostname -p $port -u $uid -P $pwd -t "$dltopic" -m "
pub_uplink_cmd="$progname -h $hostname -p $port -u $uid -P $pwd -t "$uptopic" -m "
set -x
$pub_uplink_cmd '{"id":"rpi3b001", "temp":"25.6" }'
sleep 1
$pub_downlink_cmd '{"id":"rpi3b001", "light":"on" }'
sleep 1
$pub_downlink_cmd '{"id":"rpi3b001", "led":[ {"red":"on", "green": "off", "blue":"off"} ] }'
sleep 1
$pub_downlink_cmd '{"id":"rpi3b001", "buzzer" : "on" }'
sleep 1
#$pub_downlink_cmd '{"id":"rpi3b001", "buzzer" : "music" }'
#sleep 1
$pub_downlink_cmd '{"id":"x86host02","camera" :  "on" }'
sleep 1
$pub_downlink_cmd '{"id":"rpi3b001", "light":"on", "buzzer":"on", "led":[ {"red":"on", "green":"off", "blue":"off"} ] }'
sleep 1