All Products
Search
Document Center

IoT Platform:Create a gateway device (MQTT)

Last Updated:Jun 16, 2026

To create gateway devices for a product that uses one-party verification, import device verification information. IoT Platform uses this information to authenticate devices as they connect.

Prerequisites

You have added a gateway and created a gateway product that uses one-party verification. For more information, see Create a gateway product (MQTT).

Background

  • After you create a cloud gateway with Third-party Authentication, IoT Platform automatically creates a device based on the returned deviceName value when the device connects for the first time.

    You can use MQTT.fx to simulate a device connecting to IoT Platform through the cloud gateway. For more information, see Use MQTT.fx to connect a device (Alibaba Cloud FC authentication).

  • After you create a gateway that uses one-party verification, import device verification information into IoT Platform to create gateway devices.

Batch add devices

  1. Log on to the IoT Platform console.

  2. On the Instance Overview page, click the target Enterprise instance of the Exclusive Edition.

  3. In the left-side navigation pane, choose Device Management > Products. Find the gateway product that you created and click Manage Devices in the Actions column.

  4. On the Devices page, click Batch Add.

  5. In the Batch Add Devices dialog box, click Download .csv Template.

  6. In the template, fill in the SN, MQTT username, and MQTT password, and then save the file.

    Important
    • The MQTT username and MQTT password are required. The SN is optional.

    • An MQTT username must be 4 to 32 characters long and can contain letters, digits, hyphens (-), underscores (_), at signs (@), periods (.), and colons (:). Each MQTT username must be unique per product.

    • An MQTT password must be 1 to 32 characters long and can contain letters, digits, hyphens (-), underscores (_), at signs (@), periods (.), and colons (:).

    • A single file can contain a maximum of 10,000 device records. Do not import duplicate devices.

  7. Return to the Batch Add Devices dialog box, click Upload File, select the saved file, and then click OK.

    After the file is uploaded, the dialog box displays a Parsing Completed status and the Total Devices. After you confirm the information, click OK.

    If the list of devices contains invalid information, an error message appears. Click Download Invalid List, review the invalid entries, correct them, and then upload the file again.

    The error message indicates the specific invalid fields, such as an invalid SN, MQTT username, or MQTT password. Check and correct the information before you upload the file again.

API reference

API

Description

ImportDevice

Imports a single device to an MQTT gateway product.

BatchImportDevice

Imports multiple devices to an MQTT gateway product.

BatchCheckImportDevice

Verifies a batch of imported devices.

QueryImportedDeviceByApplyId

Queries a list of batch-imported devices by application ID (ApplyId).

Results

After the device verification information is imported, IoT Platform creates a device for each entry and uses the uploaded MQTT username as the device name. The new gateway devices appear on the Device Management > Devices page. In the Device List, the node type for each device is device, its status is inactive, the device is enabled, and the Last Online Time column is empty.

Next steps

After you create the gateway devices, you must update their endpoints:

  • If the devices already have a configured endpoint, create a CNAME record to map that endpoint to the gateway URL. For more information about DNS configuration, see Alibaba Cloud DNS.

  • If the devices do not have a configured endpoint, you must configure the gateway URL on the devices. For more information, see Connect a device over MQTT.

To find the gateway URL, see View the gateway URL.

For more information about how gateway devices connect to IoT Platform to communicate, see Messaging overview.

You can use MQTT.fx to simulate a gateway device and connect it to IoT Platform for communication. For more information, see Connect a device by using MQTT.fx (one-party verification).