หน้านี้ยังไม่พร้อมใช้งานในภาษาท้องถิ่นของคุณ เรากำลังพยายามอย่างหนักเพื่อเพิ่มเวอร์ชันภาษาอื่น ๆ เพิ่มเติม ขอบคุณสำหรับการสนับสนุนเสมอมา

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
Help Center/ IoT Device Access/ FAQs/ IoT Device SDKs

IoT Device SDKs

Updated on 2024-10-31 GMT+08:00

Why Did the IoT Device SDK for C Fail to Be Started?

It is possible that the OpenSSL or Paho library files failed to be compiled or the export LD_LIBRARY_PATH=./lib/ command was not used to load the library files. For details, see "Preparations" in IoT Device SDK (C) Development Guide.

Why Did the IoT Device SDK for Java Fail to Be Started?

It is because the JDK (1.8 or later) or Maven has not been installed.

Which Java SDK Demo Should I Refer to?

device_demo is recommended if you connect devices directly to the IoT platform and want to integrate the bootstrap (device provisioning) function, whereas gateway_demo is a better choice if you connect devices to the platform through common gateways or gateways that support generic protocols.

Which C SDK Demo Should I Refer to?

device demo is recommended if you connect devices directly to the IoT platform, whereas bootstrap_demo is recommended if you want to integrate the bootstrap function. gateway demo will be a better choice if you connect devices to the platform through common gateways or gateways that support generic protocols.

Why Was the Error Code 4 Returned When I Used the IoT Device SDK for C for Device Connection?

It is because the entered account name or password was incorrect. For details about the error codes returned upon connection failures, see the error code description in the MQTTAsyn.h file.

What Are the Differences Between the IoT Device SDK and IoT Device SDK Tiny?

IoT Device SDK Tiny is more lightweight than IoT Device SDK and suitable for devices with smaller memory and disk space and few child devices mounted. The dynamic link library is not used during compilation. The code provides the OS abstraction layer to adapt to different OSs, such as FreeRTOS, Linux, Nova OS, μC/OS-II, and OpenHarmony LiteOS-M. IoT Device SDK Tiny supports MQTT(S), LwM2M, and CoAP. It uses Mbed TLS for encryption, while IoT Device SDK C uses OpenSSL. For details, see Introduction to IoT Device SDKs.

Issues Related to IoT Device SDK C Tiny

  1. What Do I Do If "mqtt_imp_init: ###please implement mqtt by yourself####" Is Displayed in Logs?

    Check whether the compilation architecture supports the __attribute__ ((weak)) function. If not, comment out all these functions. If link_tcpip_imp_init:###please implement this function by yourself#### is displayed, check whether the network layer adaptation is implemented.

  2. What Do I Do If the Task Execution Sequence Is Inconsistent with the Task Priority When Using the SDK?

    By default, task priorities in the SDK range from 0 to 31 in descending order. You can adjust task priorities based on the OS.

  3. What Steps Are Included in the SDK Porting Process?

    The porting process includes registering an OS with the OS abstraction layer (OSAL) and registering TCP/IP with the service abstraction layer (SAL). In addition, you can perform modular tailoring as required. For details, see Developer Guide.

  4. What Do I Do If Error Code 2 Is Returned When MQTT Is Used to Connect to Huawei Cloud?

    The following figure shows the logs.

    Figure 1 MQTT connection error

    This is caused by a network error. Check whether your development board is connected to the network. If connected, check whether the IP address, domain name, and port number of the platform to be connected are correct. In the Linux environment, ping the platform address to check whether the address can be pinged.

  5. What Do I Do If a Device Does not Automatically Reconnect to Huawei Cloud After the Disconnected Network is Restored?
    Figure 2 No reconnection

    The log shows that Paho has exited and the device has been disconnected from the platform and goes offline. Change the sleep time in the __loop_entry() function in the network\mqtt\paho_mqtt\port\paho_mqtt_port.c file in the SDK directory from 1 ms to 100 ms (osal_task_sleep(100)). Then, check whether automatic reconnection is successful.

  6. What Do I Do If I Am Stuck in the Topic Subscription Process When MQTTS Is Used to Connect to Huawei Cloud?
    Figure 3 Suspended topic subscription process

    Change the value of CONFIG_PAHO_LOOPTIMEOUT in the iot_config.h file to 1000.

  7. What Do I Do If a Developer Board Successfully Connects to Huawei Cloud Using MQTT But Connection Fails When MQTTS Is Used?

    The cause may be that the development board memory is insufficient. Check the remaining memory, which should be greater than 60 KB. For OpenHarmony L0 devices, call LOS_MemPoolSizeGet(m_aucSysMem0) to obtain the total memory and LOS_MemTotalUsedGet(m_aucSysMem0) to obtain the used memory. Then, you can get the remaining memory. If Shell is ported, you can run the free command to obtain the memory details.

  8. How Do I Interpret the Following Log Content Generated When MQTT Is Used to Connect to Huawei Cloud?
    Figure 4 Normal MQTT connection setup

    Lines 3 and 4 indicate that MQTT is used for connection. If MQTTS is used, line 2 will be displayed. If TCP/IP that adapts to SAL is used, line 1 will be displayed. If the corresponding log content is not displayed, find the macro of the initialization function of the corresponding function based on the link_main.c file, and then check whether the macro is enabled in iotlink_config.h.

  9. Why a Device Is Powered Off But Displayed as Online on IoTDA?

    If a device does not proactively disconnect from IoTDA, the device disconnection time is related to the MQTT lifetime in the code, which is 1.5 times the heartbeat time. When establishing an MQTT connection, set the lifetime parameter.

  10. List of Devices with IoT Device SDK Tiny (Code Attached) Ported

    See Porting Device List.

What Do I Do If the Error Message "Too many publishes in progress" Is Displayed When the IoT Device SDK (Java) Is used to Report Data?

There are too many concurrent messages. To solve this problem, increase the value of MAX_FLIGHT_COUNT in MqttConnection.java.

เราใช้คุกกี้เพื่อปรับปรุงไซต์และประสบการณ์การใช้ของคุณ การเรียกดูเว็บไซต์ของเราต่อแสดงว่าคุณยอมรับนโยบายคุกกี้ของเรา เรียนรู้เพิ่มเติม

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback