The MQTT Protocol is supported by a wide range of third-party software. In the following we want to take a look at two Android apps that will allow us to use the MQTT Endpoints we added to our Node-RED flows to control our camera from our smartphone.
IoT MQTT Panel
First, go to the Google Play Store on your Android phone to download the App IoT MQTT Panel.
We need to add the MQTT Server connection to get started. Type in the IP address of your MQTT Server - this either the local IP of your Windows machine or your Raspberry Pi (depending on where you installed it). There we also added a MQTT login that we need to use here to connect to the Server and save your settings.
Now click on the Mosquitto Connection you just added and click the orange Plus Icon to add a new panel. Choose a Button to get started:
Give your button a name, choose an MQTT Entry Point that you want to target - in the case above, we choose the Trigger Alarm Node that can be targeted with the topic ipcam/alarm/pushalarm
:
The necessary payload is injected by the dashboard button - {"pushalarm" : "triggered"}
:
Save your settings and try out your brand new button:
MQTT Dashboard
First, go to the Google Play Store on your Android phone to download the App MQTT Dashboard.
We need to add the MQTT Server connection to get started. Click in the Plus Icon and type in the IP address of your MQTT Server - this either the local IP of your Windows machine or your Raspberry Pi (depending on where you installed it). There we also added a MQTT login that we need to use here to connect to the Server and save your settings.
Now click on the Connection you just added, choose Subscribe and click the Plus Icon, in the top right, to add a new MQTT Subscription:
We want to subscribe to the Trigger Alarm MQTT Node that we already used for the IoT MQTT Panel:
Save your settings and switch to the Publish tab to add a button that can trigger the MQTT Entry Node from our Node-RED Flow:
Here we need to add both the MQTT Topic to target that Node and the MQTT Payload required to trigger its execution:
Now save your settings and try out your new button:
Switch back the Subscribe tab to check if your payload was published successfully: