Arduino mqtt code for DHT22

So I was trying to send data from my DHT 22 using MQTT broker mosquitto. After successfully compiling it, how do I confirm it is running properly?

mosquittodht22.ino (3.11 KB)

Sumit1934: After successfully compiling it, how do I confirm it is running properly?

Run it to see if it does what you want it to?

I actually want to know the correct way to run it. I am a newbie in MQTT. Can you help me?

I can suggest you read more on the subject. For example here is an IBM document that shows an example of using the test.mosquitto.org server from an Arduino. I found it with Google.

http://www.redbooks.ibm.com/redpapers/pdfs/redp4929.pdf

Read that example to see how it compares to the code you already have.

The required library (http://knolleary.net/arduino-client-for-mqtt/) includes examples. Perhaps studying those will help you understand how to use the library. Keep reading the documentation and studying the examples until you figure out how to use the library.