In the following exercises, the “MQTT Dash” app will be used as an extension to the already implemented publisher and subscriber functionality to emphasize the procedure and functioning of Internet of Things.

About the MQTT Dash App

The MQTT Dash smartphone application is a simple way of working with IoT devices if the user knows how to work with MQTT. It is an ad-free application without any in-app-purchases.

The app is only available for Android devices and can be used for smartphones as well as for tablets. It contains a dashboard where multiple brokers can be registered, for example for different rooms. Using icons, text, pictures and similar, different topics can be observed or published to. It supports Raspberry Pis among others and can work 24/7.

Installing and Configuring the MQTT Dash App

The “MQTT Dash App” is only available for Android. There are similar apps for other platforms which will not be described further in this section.

The smartphone should be connected with the Google Play Store. There, search for “MQTT Dash”. The software by “Routix software” can be easily installed and immediately used.

It makes sense to do some preconfiguring which is needed for all further exercises of this section. To do this, follow these steps:

  • Open the “MQTT Dash App” after it is installed.
  • Tap on the “plus” symbol in the top right corner.

To configure the broker, do the following:

  • Enter a name. This is optional and can be chosen freely.
  • The “Address” is the ip address of the broker, for these examples: 192.168.10.3
  • The port can retain the default value.
  • If no SSL or similar settings are needed, the configuration can be saved by tapping the “save” icon in the top right corner.

You can continue then by following this steps:

  • Choose the broker with the given name in the list.
  • By tapping on the “plus” symbol in the top right corner, a topic can be added, which will be done in the next exercises.

Exercises

Exercise 1: Configuring and Using the MQTT Dash App (Reading Sensor Data)

First of all, it will be started by only observing a topic and displaying the data. To do this, you can follow these steps and explanations:

  • Start the temperature publisher that you programmed in Excercise 4: of the JupyterHub section.
  • Choose the correct broker you configured before.
  • Add a new topic by tapping the “plus” symbol in the top right corner.
  • Choose “Range/progress” as type.
  • Enter an appropriate name, like “Temperature”.
  • As topic, type the one you have chosen in the exercise mentioned above (in the example, it was “temperature”).
  • Disable publishing by tapping on the button “Enable publishing”.
  • Enter a Min and Max value, for example “Min = -30” and “Max = 40”.
  • If you like to, you can choose a different color for the progress bar.
  • If you save the subscriber by tapping the “save” icon in the top right corner, the current temperature published by the pi should soon be visible. If it does not, tap on the temperature range icon. If that still does not help, check the configurations of the broker and the topic.

Exercise 2: Switching Light On and Off

Now, the subscriber for switching the light on and off will be used. To do this, you can follow these steps and explanations:

  • Start the light-switch-subscriber that you programmed in Excercise 6 of the JupyterHub section.
  • Choose the correct broker you configured before.
  • Add a new topic by tapping the “plus” symbol in the top right corner.
  • Choose “Switch/button” as type.
  • Enter an appropriate name, like “Light”.
  • As topic, type “item/switch”.
  • Make sure the on value is set to one and the off value is set to zero.
  • Save the subscriber by tapping the “save” icon in the top right corner.
  • Now, try switching on and off the light by tapping on the button. You should see the display of the Sense HAT going on and off. If that does not work, check the code you programmed before. If that still does not help, check the configurations of the broker and the topic.

Exercise 3: Displaying Text

At last, the app will be used to display custom text on the Sense HAT display. To do this, you can follow these steps and explanations:

  • Start the display subscriber that you programmed in Exercise 7 of the JupyterHub section.
  • Choose the correct broker you configured before.
  • Add a new topic by tapping the “plus” symbol in the top right corner.
  • Choose “Text” as type.
  • Enter an appropriate name, like “Display”.
  • As topic, type “item/display”.
  • Save the subscriber by tapping the “save” icon in the top right corner.
  • Now, enter a text using the app and publish it to the broker. The Sense HAT should display this message then. If that does not work, check the code you programmed before. If that still does not help, check the configurations of the broker and the topic.