A Step-by-Step Guide to Using HiveMQ Cloud Starter

A Step-by-Step Guide to Using HiveMQ Cloud Starter

author Shashank Sharma

Written by Shashank Sharma

Category: HiveMQ Cloud Cloud IoT HiveMQ Cloud Starter

Published: August 3, 2023


We recently released HiveMQ Cloud Starter to address the demand for the fast and cost-effective scaling of IoT projects. HiveMQ Cloud is the first MQTT platform to provide a pay-as-you-grow solution with unlimited connections.This article series will guide IoT developers through the new offering to maximize the exciting features available in HiveMQ Cloud Starter. Here’s how to get going:

1. Sign-up for HiveMQ Cloud

If you are new to HiveMQ Cloud, it is very easy and free to sign-up. If you are an existing user, you can skip to part 2. New users can sign up via the HiveMQ Cloud webpage or HiveMQ pricing page. Choose a sign in option and provide a few details about yourself and your role.

HiveMQ Pricing Page
Click on Starter Plan to sign up.
HiveMQ Cloud Starter Plan Sign-up
Sign up using your work email or a preexisting account.

2. Create your Starter cluster

If you are a new user you will be redirected to the “Create Cluster” tab. Existing users can select “create new cluster” on the cluster overview page.

HiveMQ Cloud Starter Create Cluster
The yellow box highlights where you can create a unique cluster name.
  • a. Configure your cluster: The first step is to configure your cluster. This includes naming your cluster and selecting your tier and region.

    • The name will be part of the cluster URL and can be used to give context to the cluster, like “production” or “staging”
    • Currently the plan only offers eu-central as region, but additional regions will be announced soon
  • b. Add billing details: Once you’ve configured your cluster, you will be redirected to add your billing details. HiveMQ Cloud offers every new sign-up $100 in free credits upon the creation of the first cluster on Cloud Starter. These free credits are automatically applied. Your credit card is not charged until you use the free credits.

  • c. Now HiveMQ Cloud spins up a cluster with a dedicated broker for you.

HiveMQ Cloud Starter Cluster Creation
The cluster is created and ready to be used in minutes.

3. Create your first credentials

MQTT credentials are authorization values (username and password) used to identify and authorize MQTT clients. They are sent to the MQTT broker during the connection process and are used to determine the client’s access rights. MQTT credentials are essential for securing MQTT client connections. Without them, anyone could connect to your MQTT broker and publish or subscribe to any topic they wanted. With credentials, you can control which clients can access your broker and what they can do once they are connected.

To get started you can create a credential with default roles and permissions. In this example, we created a credential “testuser” with default roles.

HiveMQ Cloud Starter Create Credentials
Create a credential “testuser” under the Access Management tab.

Now you are ready to send messages through an established MQTT connection. We offer 12 different options based on your language preferences and programming skills. You can find our guided onboarding by clicking the “getting started " tab. Here we cover two ways to easily send your first messages - via Web Client and via MQTT Command Line Interface (CLI).

4. Send a message using Web Client

To quickly get started and test out your credentials, you can connect to the web client using the credentials you just created in the previous step.

HiveMQ Cloud Starter Send Message Using Web Client
The yellow box highlights the status before clicking on the “connect client” button.
  • a. Click on “connect client” to establish a connection. The connection status is visible on the right-hand side. The client is connected once you see “web client connected” on the screen.
HiveMQ Cloud Starter Connect Client
The status turns to green once the web client connects to HiveMQ Cloud.
  • b. Subscribe to “mytopic/test” under Topic Subscriptions. We will use this test topic structure for both publishing and subscribing to messages.
HiveMQ Cloud Starter Create Cluster
An overview of subscriptions is visible below the “Topic Subscriptions” section.
  • c. Publish to “mytopic/test” under Publish Message. Add “Hello World” to the message section and click on “publish”.
HiveMQ Cloud Starter Topic Subscription

A table will appear below where you can see the corresponding message that you subscribe to along with the topic structure, timestamp, and the corresponding Quality of Service (QoS) level.

HiveMQ Cloud Starter Topic Structure and QoS setting

5. Send a message using MQTT CLI

Another way to send a message is via MQTT CLI. You can access a customized guide under the Getting Started tab.

HiveMQ Cloud Starter Send a Message using MQTT CLI
The yellow box highlights the MQTT CLI getting started guide among the others available.
  • a. Install MQTT CLI: To install MQTT CLI simply follow the steps in the guide. For this demonstration we have installed MQTT CLI on Mac. Please skip this step if MQTT CLI is already installed on your system

  • b. Subscribe to “mytopic/test”: We use the following to subscribe to “mytopic/test”

1
<mqtt sub -h stepbystep-7rdgup.a01.euc1.aws.hivemq.cloud -p 8883 -s -u testuser -pw -t 'my/test/topic'>`
HiveMQ Cloud Starter Subscribe to MyTopic

Please note that both the command above and the screenshot shows the unique credential name as well as the cluster name that we assigned earlier. Your customized onboarding guide will highlight the cluster name and the credentials that you create for yourself. Once you enter the command, you will be asked to enter the password for your credentials.

  • c. Subscribe “mytopic/test”: Now you can publish to the same topic. To create another client and send messages to your cluster, open a second terminal window (keep your original terminal window open). In this example we use the following command to send “Hello”:

<mqtt pub -h stepbystep-7rdgup.a01.euc1.aws.hivema.cloud -p 8883 -s -u testuser -pw -t 'my/test/topic' -m 'Hello’>

HiveMQ Cloud Starter Create Cluster
The two terminal windows exchange messages via HiveMQ Cloud.

The message “Hello” appears immediately in the terminal window of the second MOTT client. You can also use the Web client to subscribe and MQTT CLI to publish and vice versa.

Next Steps:

In this step-by-step guide we detailed how to create your Starter cluster, how to create credentials, and how to send your first message. HiveMQ Cloud Starter offers a lot in terms of security features, observability, data integrations, and programmatic workflows.

In the next part, we will take a simple example and explore access credentials, roles, and permissions in detail. Stay tuned.

Sign-up now with Cloud Starter and grab $100 worth of free credits upon the creation of the first Starter cluster.

author Shashank Sharma

About Shashank Sharma

Shashank Sharma is a product marketing manager at HiveMQ. He is passionate about technology and enabling developer-centric workflows. He has previous experience in application software tooling, autonomous driving, and numerical computing.

mail icon Contact Shashank
newer posts 5 Benefits of Using MQTT for IIoT in Tracking and Analyzing Unplanned Manufacturing Downtime
Introducing HiveMQ Edge older posts