How to Set Up a Free MQTT Broker with EMQX Cloud Print

  • 1

This guide will walk you through the process of creating a free Serverless MQTT deployment on EMQX Cloud. This service will act as the central communication hub for your application. We will cover creating the deployment, setting up the necessary user for your app to connect, creating API keys for your panel, and finding the server address.


Step 1: Create Your Free Serverless Deployment

First, we need to create the actual MQTT broker.

  1. Navigate to EMQX Cloud's website and sign up for a new account.
  2. Once you are logged into the EMQX Cloud Console, click the + New Deployment button.
  3. Select the Serverless plan. This plan includes a generous free tier that is perfect for getting started.
  4. Follow the on-screen instructions to create the deployment. You may need to choose a cloud provider and region. This process usually takes a few minutes.
  5. Once the deployment is created and has a "Running" status, click on its name to open the deployment's dashboard.

Step 2: Add App Authentication Credentials

Next, we need to create the specific user account that your Android application will use to connect to the broker. It's critical that the username and password match exactly what the app is programmed to use.

  1. From your deployment's dashboard, navigate to the Access Control section in the left-hand menu and select Authentication.
  2. Click the + Add Authentication button.
  3. A form will appear. Fill it in with the following exact details:
    • Username: androidapp
    • Password: androidapp
  4. Click the Confirm button to save the new user. You have now created the credentials that your mobile app will use to log in.

Step 3: Create API Keys for Your Panel (AppID & AppSecret)

Now we need to create a separate set of credentials (an AppID and AppSecret) that your control panel will use to send commands via the REST API.

  1. From your deployment's dashboard, navigate to the Overview section in the left-hand menu.
  2. Click the + New Application button in bottom right-hand corner.
  3. A dialog box will appear. Give your application a descriptive name, like "XCIPTV Pane", and click Confirm.
  4. You will now be shown an App ID and an App Secret.
  5. Important: Copy the App ID and App Secret to a safe place. You will need these for your panel's configuration. The App Secret will not be shown again.

Step 4: Find Your MQTT Connection Address

Finally, you need the server address that your app will connect to. This information is available on the main overview page of your deployment.

  1. Navigate back to the Overview page for your deployment.
  2. Look for the card titled MQTT Connection Information.
  3. You will find the connection details here. The main piece of information you need is the Address. It will look something like this:
    pdf1d09e.ala.eu-central-1.emqxsl.com

Summary

After following these steps, you will have all the necessary information to configure your system:

  • The MQTT Connection Address and Port (e.g., `pdf1d09e.ala.eu-central-1.emqxsl.com`).
  • The Authentication User/Password you created (`androidapp`/`androidapp`).
  • The AppID and AppSecret.

Was this answer helpful?

« Back