هذه الصفحة غير متوفرة حاليًا بلغتك المحلية. نحن نعمل جاهدين على إضافة المزيد من اللغات. شاكرين تفهمك ودعمك المستمر لنا.

Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive

MQTT Client Access

Updated on 2024-11-06 GMT+08:00

After configuring and activating rules by calling the platform APIs Creating a Rule Triggering Condition, Creating a Rule Action, and Modifying a Rule Triggering Condition, connect the MQTT client to IoTDA. Then run the MQTT client on your server to receive subscribed-to messages.

Connection Configuration Parameters

The table below describes the connection address and connection authentication parameters for the MQTT client to connect to the platform.

  • MQTT access domain name

    It is automatically generated for each account. Log in to the IoTDA console to obtain it on the Access Details page.

    Figure 1 Access information - MQTT access address on the application side
  • Port: 8883
  • Client identity authentication parameters

    clientId: The value must be globally unique. You are advised to use username.

    username ="accessKey=${accessKey}|timestamp=${timestamp}|instanceId=${instanceId}"

    password ="${accessCode}"

    Parameter

    Mandatory

    Description

    ${accessKey}

    Yes

    An accessKey can be used to establish a maximum of 10 concurrent connections. When establishing a connection for the first time, preset the parameter by following the instructions provided in Obtaining the AMQP Access Credential.

    ${timestamp}

    Yes

    Current time. The value is a 13-digit timestamp, accurate to milliseconds. The server verifies the client timestamp. There is a 5-minute difference between the client timestamp and server timestamp.

    instanceId

    Optional

    Instance ID. This parameter is mandatory when multiple instances of the standard edition are purchased in the same region. For details, see Viewing Instance Details.

    ${accessCode}

    Yes

    The value can contain a maximum of 256 characters.

Obtaining the MQTT Access Credential

An access credential is required for an application that uses MQTT to connect to the platform for data forwarding. If you use an access credential for the first time or forget it, preset an access credential. You can call the API for generating an access credential or use the console to preset an access credential. The procedure for using the console to generate an access credential is as follows:

  1. Access the IoTDA service page and click Access Console. Click the target instance card.
  2. Choose Rules > Data Forwarding. The Rule List page is displayed.

    Figure 2 Rule details - Viewing rule details

  3. Click View. (If no rule exists, create one.) On the rule details page that is displayed, click the Set Forwarding Target tab.

    Figure 3 Forwarding target - Setting a target

  4. Click Add. On the Add Forwarding Target page that is displayed, select MQTT message queue for Forwarding Target, and click Preset Access Credential to preset the access code and access key.

    Figure 4 Creating a forwarding target - to an MQTT push message queue with preset credentials
    NOTE:

    If you already have an access credential, the accessKey cannot be used after you preset the access credential again.

Receiving Push Messages

After a connection is established between the client and the platform, subscribe to the MQTT topic in the data forwarding rule. When a device reports data and the rule is triggered, the platform pushes the data to the MQTT client.

We use cookies to improve our site and your experience. By continuing to browse our site you accept our cookie policy. Find out more

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback