From 1d2b49e4c8d6a3c93973772e661900dfff8c6102 Mon Sep 17 00:00:00 2001
From: guowenxue <guowenxue@gmail.com>
Date: Wed, 26 Jun 2019 13:50:17 +0800
Subject: [PATCH] add publish_test.sh tools in mqttd

---
 mqttd/tools/publish_test.sh |   36 ++++++++++++++++++++++++++++++++++++
 1 files changed, 36 insertions(+), 0 deletions(-)

diff --git a/mqttd/tools/publish_test.sh b/mqttd/tools/publish_test.sh
new file mode 100755
index 0000000..4276594
--- /dev/null
+++ b/mqttd/tools/publish_test.sh
@@ -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

--
Gitblit v1.9.1