add publish_test.sh tools in mqttd
New file |
| | |
| | | #!/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 |