MQTT Project: send temperature value over MQTT protocol

Introduction

I wrote this page for test the MQTT protocol between mbed <->broker <-> android


Required Components


How works

The goal of this project is send the temperature value read from a LM75 sensor over MQTT protocol to Android Phone.


I divided the project into the following steps:

  • First step is create a Broker account, in this test I used CloudMQTT.
  • Second step is download the mbed code.
  • Third step is open my Android App MQTT Terminal and setup the new Broker.


First Step: Create a Broker

Press the "Control Panel" button and in the new page the button "Create":

/media/uploads/edodm85/cattura0mod0.png

Create a new MQTTCloud Instance:

/media/uploads/edodm85/cattura2mod2.png

Open the Details of new instance and Create a New User:

/media/uploads/edodm85/cattura3mod.png

Now you have to create a new Rule (use the user create above and insert a new TOPIC).

/media/uploads/edodm85/cattura6mod.png

OK the Broker is created.


Second Step

Download the mbed test code:

Import programMQTT_and_Temperature_Sensore_LM75

Test MQTT Protocol with a Temperature Sensore

You have to change the MQTT data in main.h:

/media/uploads/edodm85/cattura9.png


Third Step

Setup the Broker information in the Android App MQTT Terminal:

/media/uploads/edodm85/screenshot_3.png

Then is necessary add a new Topic:

/media/uploads/edodm85/screenshot_4.png


Conclusion

Now is possible receive data from mbed:

/media/uploads/edodm85/screenshot_5.png


Please log in to post comments.