Bu sayfa henüz yerel dilinizde mevcut değildir. Daha fazla dil seçeneği eklemek için yoğun bir şekilde çalışıyoruz. Desteğiniz için teşekkür ederiz.

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

Using MQTT.fx to Send and Receive Messages

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

Introduction

MQTT.fx is an MQTT client written in Java based on Eclipse Paho. It supports Windows, macOS, and Linux OSs. It can be used to simulate the connection of devices to Huawei Cloud IoTDA through MQTTS/MQTT, and the publishing and subscription of messages through topics. This section uses Windows as an example to describe how to use MQTT.fx to access Huawei Cloud IoTDA and send and receive messages.

Figure 1 Message exchange process between MQTT.fx and IoTDA

Using MQTT.fx to Connect to IoTDA

  1. Download MQTT.fx (64-bit OS) or MQTT.fx (32-bit OS) and install it.
  2. Open the MQTT.fx client and choose Extras > Edit Connection Profiles from the menu bar.
  3. On the Edit Connection Profiles page, set related parameters and click OK.
    Figure 2 MQTT.fx connection parameters

    Parameter

    Description

    Example Value

    Profile Name

    Name of the configuration file.

    Enter MQTT Test.

    Profile Type

    Type of the connection to be configured.

    The value is fixed at MQTT Broker, indicating that the MQTT server is connected.

    Broker Address

    Access address of the MQTT server.

    Access your instance, choose Overview, click Access Details, and obtain the MQTTS access address. For details, see MQTTS access address.

    Broker Port

    Access port of the MQTT server.

    Enter 8883.

    Client ID

    IoTDA can send and receive messages only after device access authentication is successful. For details about device authentication parameters, see

    Device Connection Authentication.

    Go to the device details page, find MQTT Connection Parameter, and click View to check the clientId, username, and password.

    User Name

    Password

    SSL/TLS

    Enable SSL/TLS

    Whether to use the SSL or TLS encryption protocol.

    Yes

    Protocol

    Protocol version.

    Select TLSv1.2.

    CA certificate file

    CA certificate file.

    Obtain the CA certificate of the corresponding region from the certificate resource page.

  4. After setting the parameters, click Connect. If the icon in the upper right corner turns green, MQTT.fx has been connected to Huawei Cloud IoTDA. If the icon in the upper right corner turns red, the connection fails. Click the Log tab to check logs, modify the configuration based on the log information, and try again.
    Figure 3 MQTT.fx connection
  1. Access the IoTDA service page and click Access Console. In the navigation pane, choose IoTDA Instances and click the target instance card. In the navigation pane, choose Devices > All Devices to check the device status. The device status is expected to be online.
    Figure 4 Device list - Device online status

Using MQTT.fx to Send Messages

  1. Click the Publish tab on the MQTT.fx client.
  2. On the displayed tab page, enter the topic name in the Topic text box on the left, for example, /test/deviceToCloud. Enter the message content in the Message text box, for example, hello. Click Publish to send the message.
    Figure 5 MQTT.fx message sending
  3. Access the IoTDA service page and click Access Console. In the navigation pane, choose IoTDA Instances and click the target instance card. In the navigation pane, choose Devices > All Devices. On the displayed page, click View. On the Message Trace tab page, check the messages sent by MQTT.fx.
    Figure 6 Message tracing - Viewing results
  1. After MQTT.fx sends messages to the platform, configure data forwarding rules to forward the messages to message middleware, storage, data analysis, or service applications.

Using MQTT.fx to Receive Messages

  1. Click the Subscribe tab on the MQTT.fx client.
  2. On the displayed tab page, enter the topic name in the Topic text box on the left and click Subscribe. /test/cloudToDevice is used as an example. After the topic is subscribed to, check the topic in the subscription list.
    Figure 7 MQTT.fx subscription topic
  3. Access the IoTDA service page and click Access Console. In the navigation pane, choose IoTDA Instances and click the target instance card. In the navigation pane, choose Devices > All Devices. On the device list, click a device to access its details page.
  4. Click the Cloud Delivery tab. On the Message Delivery tab page, click Deliver Message. In the displayed dialog box, configure the content and the parameters for the message to deliver.
    Figure 8 Delivering a message - Custom topic
  5. On the MQTT.fx client, click the Subscribe tab. The message received from the subscribed topic is displayed.
    Figure 9 Checking messages using MQTT.fx

Sitemizi ve deneyiminizi iyileştirmek için çerezleri kullanırız. Sitemizde tarama yapmaya devam ederek çerez politikamızı kabul etmiş olursunuz. Daha fazla bilgi edinin

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback