Build Your Own IoT Platform by Anand Tamboli

Build Your Own IoT Platform by Anand Tamboli

Author:Anand Tamboli
Language: eng
Format: epub
ISBN: 9781484244982
Publisher: Apress


By default, Mosquitto listens on a standard MQTT port 1883, and we can see in the output that the program is running and listening on that port. At this stage, we can run a quick check to see if everything is working as expected. To do that, we open another terminal window and log in for a second time. Let’s keep two windows open side by side to see what is going on.

On one terminal, we subscribe to testTopic with the following command:# mosquitto_sub -h localhost -t testTopic

Here, -h specifies the hostname and -t specifies the subscription topic. After sending the command, we do not see anything output because the client that we just created is listening for new messages and nothing has been sent yet.

On the other terminal, we publish a test message on testTopic as follows:# mosquitto_pub -h localhost -t testTopic -m "Hello world !"



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.