What you’ll need
- An ngrok account.
- The ngrok agent installed.
- MQTT Explorer installed.
- The Mosquitto binary installed.
1. Start an MQTT server
This guide uses Eclipse Mosquitto as the MQTT server. Follow the Mosquitto download and install instructions for your operating system, then start the server:1883 by default and starts in local-only mode, so connections are only possible from the same machine until you expose it.
For listener and authentication options, see the Mosquitto documentation.
2. Launch ngrok
With your MQTT server running onlocalhost, put it online with an ngrok TCP endpoint.
If you haven’t already, add your authtoken from the ngrok dashboard:
tcp:// forwarding address where your server is exposed to the internet.
Copy this address for use with MQTT Explorer.
3. Connect with MQTT Explorer
Open MQTT Explorer and click the plus sign to create a new MQTT connection. Enter the TCP address from the last step and click Connect. You’ll see a few new lines in your MQTT server logs:example/topic.
You’ll see the message in the terminal tab where you subscribed to the topic: