Last active
February 10, 2018 19:41
-
-
Save YongHuax/e734377624810d4a7119d42626f39e72 to your computer and use it in GitHub Desktop.
Test for LG01-P to Mqtt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
#The following code demonstrates a basic command using mosquitto client to connect to public broker hivemq using port 1883 | |
# publish to topic yhtest with message "ok" | |
#it is possible to copy and paste the following line of code to Dragino Linux cli to run command . | |
mosquitto_pub -h broker.hivemq.com -p 1883 -t yhtest -m "ok" | |
# to check aforementioned code using mosquitto cli , copy the following line of code | |
#mosquitto_sub -h broker.hivemq.com -p 1883 -t yhtest | |
# the following code shows another example of the mosquitto_pub command | |
# publish to topic yhtest2 with message "testing " to mosquitto broker | |
#mosquitto_pub -h test.mosquitto.org -p 1883 -t yhtest2 -m "ok" | |
# to check aforementioned code using mosquitto cli , copy the following line of code | |
#mosquitto_sub -h test.mosquitto.org -p 1883 -t yhtest 2 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment