---
title: Send MQTT Messages from Tactigon SHAPE
description: Build a visual program that publishes an MQTT message from Tactigon SHAPE. Use MQTTX Web to subscribe to the topic and inspect the received payload.
url: "https://thetactigon.com/docs/send-mqtt-messages-shape/"
updated: "2026-11-05"
category: MQTT
---

# Send MQTT Messages from Tactigon SHAPE

Publish MQTT messages from Tactigon SHAPE and inspect them directly in your browser. In this tutorial, you will send a text message through a public MQTT broker and receive it in MQTTX Web, without connecting additional hardware.No additional hardware is required. The exercise helps you check the outgoing data from your program before connecting another application or device.

## What you will build

The message follows this path:

**Tactigon SHAPE → public EMQX broker → [MQTTX](https://mqttx.app/web-client) Web**

SHAPE acts as the **publisher**. MQTTX acts as the **subscriber**, receiving messages on the topic you select.

This reverses the direction used in [**Receive Your First MQTT Message in Tactigon SHAPE**.](https://thetactigon.com/docs/receive-mqtt-message-shape/)

## Before you begin

You need:

- Tactigon SHAPE installed and running.
- MQTTX Web connected to the public EMQX broker.
- An internet connection.

If you have not configured the connections, follow **Receive Your First MQTT Message in Tactigon SHAPE** first.

The settings used in both guides are:

| Application | Connection settings |
| --- | --- |
| SHAPE | Broker `broker.emqx.io`, port `1883` |
| MQTTX Web | Protocol `wss://`, host `broker.emqx.io`, port `8084`, path `/mqtt` |

**Use sample data only.** Messages sent through the public broker may be visible to other users.

## 1. Subscribe to the topic in MQTTX Web

Open your connected MQTTX Web session.

Select **New Subscription** and enter:

```
shape/test
```

Confirm the subscription before running your Shape. This prepares MQTTX to receive messages published on that topic.

Use the topic exactly as written, including its letter case.

## 2. Prepare your Shape

Create a new Shape or edit an existing project.

For a new project, use:

- **Name:** `MQTT publish test`
- **Description:** `Publish a sample message and receive it in MQTTX Web.`

In the MQTT configuration, confirm:

```
Broker: broker.emqx.io
Port: 1883
```

Save the configuration and open the visual editor.

## 3. Configure SHAPE to publish MQTT messages

Add the MQTT publication block inside the **Setup** block, as shown in the screenshot.

Configure its fields:

| Field | Value |
| --- | --- |
| **publish payload** | `Hello from Zion` |
| **on topic** | `shape/test` |

Connect the publication block to the executable part of your program so it runs when you start the Shape.

The payload is the message content. The topic tells the broker which subscribers should receive it.

For this first test, use plain text. A dictionary or structured JSON message introduces additional formatting steps that are not needed to verify basic publication.

![Tactigon SHAPE Setup block configured to publish MQTT messages on shape/test.](https://thetactigon.com/wp-content/uploads/2026/10/shape-mqtt-publish-setup-1.png)
Publish Hello from Zion on shape/test using the MQTT block inside Setup.

## 4. Publish MQTT messages and check the result

Save your changes, then run the Shape.

Return to MQTTX Web and inspect the messages received through the `shape/test` subscription.

The expected message content is:

```
Hello from SHAPE
```

This confirms that the message has travelled from your visual program, through the broker, to an external subscriber.

![MQTTX displaying Hello from Zion received on the shape/test topic.](https://thetactigon.com/wp-content/uploads/2026/10/mqttx-received-message.png)
MQTTX receives the message published by SHAPE.

## 5. Change the message and repeat

To check the connection again:

1. Return to the SHAPE editor.
2. Change the text to `Second message from SHAPE`.
3. Save the updated program.
4. Run it again.
5. Check the newly received message in MQTTX.

This second test helps distinguish your current publication from earlier messages on the shared topic.

## If no message appears

| Check | What to verify |
| --- | --- |
| MQTTX connection | The client is connected to `broker.emqx.io` |
| Subscription | MQTTX subscribed before the Shape published |
| Topic | Both applications use exactly `shape/test` |
| SHAPE configuration | The broker address and port are correct |
| Program execution | The publication block is connected to executable logic |
| Saved changes | The running program includes your latest message |

If the publication block is inside a repeating loop, it may send multiple messages. The number of received messages therefore depends on how the block is used in your program.

Because this is a public broker, other users may publish on the same topic. You can choose a distinctive topic name for your test, provided you use it consistently in SHAPE and MQTTX.

## Already using MQTTX Desktop?

The same exercise works with MQTTX Desktop connected to `broker.emqx.io` using `mqtt://` and port `1883`.

Subscribe to the same topic and inspect the received message. Installing the desktop application or a local broker is outside this tutorial’s scope.

## Next step

You have now explored both communication directions:

- **MQTTX → SHAPE:** receive an external message in your visual program.
- **SHAPE → MQTTX:** publish data for another client to receive.

Continue to **[MQTT blocks in Tactigon SHAPE](https://thetactigon.com/docs/mqtt-blocks-shape/)** for a reference on reception, publication and structured payloads.
