---
title: Connect IoT devices over MQTT and read your IDRs
url: https://help.telecomsxchange.com/buyers/iot-mqtt/
audience: For Buyers
summary: "Create an account with Protocol Type IoT (MQTT), then connect your devices\
  \ to the broker with the generated MQTT Login and MQTT Password, using the host\
  \ and port shown in the mosquitto_pub sample on the account's page. Every message\
  \ published or delivered is charged a flat per-message fee to the account's balance.\
  \ Logs \u2192 IDR (MQTT) lists each message with its topic, direction, status and\
  \ cost."
updated: '2026-10-21'
verified_commit: 83b4ebc96d0081a25213776d5a8871bd04941125
---

# Connect IoT devices over MQTT and read your IDRs

> Create an account with Protocol Type IoT (MQTT), then connect your devices to the broker with the generated MQTT Login and MQTT Password, using the host and port shown in the mosquitto_pub sample on the account's page. Every message published or delivered is charged a flat per-message fee to the account's balance. Logs → IDR (MQTT) lists each message with its topic, direction, status and cost.

## How a device message is billed

1. **Your device**: Logs in with the account's MQTT credentials
2. **MQTT broker** (via port `1888`): Checks balance, charges the per-message fee
3. **Your subscribers** (via same topic): Same account only; each delivery charged again
4. **IDR (MQTT)** (via every message): Topic, direction, status and amount per message

An **IoT (MQTT)** account gives your devices and applications an MQTT broker to talk through, with every message recorded and billed per message, next to your voice and SMS traffic.

## Before you start

[Add funds](https://help.telecomsxchange.com/buyers/add-funds/) to the account you'll use, or let it use another account's balance. Messages are refused when the balance plus credit limit can't cover the per-message fee.

## How do I create an IoT account?

1. Go to **Accounts** and click **Add Account**.
2. Choose **Protocol Type** **IoT (MQTT)**.
3. Enter a **Name**. The **MQTT Login** is generated for you: it starts with your 10-digit customer number, which can't be changed. Click **Generate IoT Credentials** for a fresh **MQTT Password**.
4. Set **Use Balance** if the account should spend another account's balance, and click **Add Account**.

See [Create your first account](https://help.telecomsxchange.com/buyers/create-your-first-account/) for the other fields. The account's edit page shows the credentials as **Username** and **Password** and a **mosquitto_pub Usage Sample** with the broker host and port, for example:

```
mosquitto_pub -u <login> -P <password> -h <host> -p 1888 -t 'SomeTopic' -m "YourTestMessage"
```

![The edit page of an IoT (MQTT) account with its Username and Password and the mosquitto_pub Usage Sample](https://help.telecomsxchange.com/assets/screenshots/buyer-iot-account.jpg)

## How do I connect and send messages?

Connect each device or application to the broker with the account's **Username** and **Password**. Anonymous connections are refused.

Use plain topic names such as `sensors/temperature`. Topics are private to your account: the broker keeps each account's topics apart, so your subscribers only receive what your own clients publish, and you can't see other accounts' traffic.

Every message is checked against the account's balance before it is accepted:

- **publishing** a message is charged the per-message fee;
- **delivering** it to each subscriber is charged the fee again.

A message the balance can't cover is refused and recorded as **Unauthorized**.

## How do I read the IoT Detail Records?

1. Go to **Logs → IDR (MQTT)**, the **IoT Management** page.
2. Filter by **Topic**, **Message Type** (**Authorized Only**, the default, **All Messages** or **Unauthorized Only**) and **From Date** and **To Date**. The page opens on the last 24 hours.
3. Click **Search Messages**.

![The IoT Management page with message filters and the IoT Detail Records, each with its topic, direction, status, amount and payload](https://help.telecomsxchange.com/assets/screenshots/buyer-idr.jpg)

Each row shows the **Account**, **Topic**, **Direction** (**Outbound** for a message your client published, **Inbound** for a copy delivered to one of your subscribers), **Date/Time**, **Status** (**Authorized** or **Unauthorized**), **Amount** and the **Payload**; hover over a long payload to read it in full. **Download &lt;n&gt; Records** saves them as `mqtt_messages.csv`.

The same records are available from the API as `/buyers/iothistory`; see [Use the API](https://help.telecomsxchange.com/buyers/api/).

## What if something goes wrong?

| You see | What to do |
|---|---|
| Wrong Prefix for login | The MQTT Login must start with your 10-digit customer number. Use the generated login. |
| This Login is not unique | Another account already uses that login. Generate new credentials. |
| The broker refuses the connection | Check the **Username** and **Password** on the account's page and that the account isn't blocked. |
| Messages are recorded as Unauthorized | The account's balance plus credit limit can't cover the fee. [Add funds](https://help.telecomsxchange.com/buyers/add-funds/). |
| A subscriber receives nothing | Both clients must log in with the same account's credentials; topics don't cross between accounts. |

## Frequently asked questions

**Q: What is the IoT (MQTT) account for?**

A: A hosted MQTT broker for your own devices and applications. Clients that log in with the account's credentials publish and subscribe to topics that only your account sees.

**Q: What does a message cost?**

A: A flat per-message fee set by TelecomsXchange, charged to the account's balance when a message is published and again for each subscriber it is delivered to. The amount shows on every record in the IDR.

**Q: Why does the IDR show Unauthorized messages?**

A: The account's balance plus credit limit didn't cover the fee at that moment, so the message was refused. Top up the account.

**Q: Can an IoT account send SMS or calls?**

A: No. IoT accounts can't purchase routes. Use an SMPP account for SMS and a SIP account for voice.
