El contenido no se encuentra disponible en el idioma seleccionado. Estamos trabajando continuamente para agregar más idiomas. Gracias por su apoyo.
- What's New
- Product Bulletin
- Service Overview
- Billing
-
Getting Started
-
Quick Device Access - Property Reporting and Command Receiving
- Subscribing to IoTDA
- Connecting a Smart Smoke Detector to the Platform (Quick Usage)
- Registering a Simulated Smart Street Light Device
- Using MQTT.fx to Simulate Communication Between the Smart Street Light and the Platform
- Using a Virtual Smart Street Light to Communicate with the Platform (Java SDK)
- Using a Virtual Smart Street Light to Communicate with the Platform (C SDK)
- Quick Device Access - Message Sending and Receiving
- Quick Application Access
-
Quick Device Access - Property Reporting and Command Receiving
-
User Guide
- Overview
- IoTDA Instances
- Resource Spaces
- Device Access
- Message Communications
- Device Management
-
Rules
- Overview
- Data Forwarding Process
- SQL Statements
- Connectivity Tests
- Data Forwarding to Huawei Cloud Services
- Data Forwarding to Third-Party Applications
- Data Forwarding Channel Details
- Data Forwarding Stack Policies
- Data Forwarding Flow Control Policies
- Abnormal Data Target
- Device Linkage
- Monitoring and O&M
- Granting Permissions Using IAM
-
Best Practices
- Introduction
-
Device Access
- Developing an MQTT-based Simulated Smart Street Light Online
- Developing a Smart Street Light Using NB-IoT BearPi
- Developing a Smart Smoke Detector Using NB-IoT BearPi
- Connecting and Debugging an NB-IoT Smart Street Light Using a Simulator
- Developing a Protocol Conversion Gateway for Access of Generic-Protocol Devices
- Connecting a Device That Uses the X.509 Certificate Based on MQTT.fx
- Connecting to IoTDA Based on the BearPi-HM_Nano Development Board and OpenHarmony 3.0
- Testing MQTT Performance Using JMeter
- Device Management
- Data Forwarding
- Device Linkage
-
Developer Guide
- Before You Start
- Obtaining Resources
- Product Development
- Development on the Device Side
- Development on the Application Side
-
API Reference
-
API Reference on the Application Side
- Before You Start
- Calling APIs
- API Overview
-
API
- Product Management
- Device Management
- Device Message
- Device Command APIs
- Device Property
- AMQP Queue Management
- Access Credential Management
- Data Forwarding Rule Management
-
Transition Data
- Push a Device Status Change Notification
- Push a Device Property Reporting Notification
- Push a Device Message Status Change Notification
- Push a Batch Task Status Change Notification
- Push a Device Message Reporting Notification
- Push a Device Addition Notification
- Push a Device Update Notification
- Push a Device Deletion Notification
- Push a Product Addition Notification
- Push a Product Update Notification
- Push a Product Deletion Notification
- Push an Asynchronous Device Command Status Change Notification
- Rule Management
- Device Shadow
- Group Management
- Tag Management
- Instance Management
- Resource Space Management
- Batch Task
- Device CA Certificate Management
- OTA Upgrade Package Management
- Message Broadcasting
- Device Tunnel Management
- Stack policy management
- Flow control policy management
- Device Proxy
- Device Policy Management
- Bridge Management
- Pre-provisioning Template Management
- Custom Authentication
- Codec Function Management
- Permissions and Supported Actions
- Examples
- Appendix
-
MQTT or MQTTS API Reference on the Device Side
- Before You Start
- Communication Modes
- Topics
- Device Connection Authentication
- Device Commands
- Device Messages
- Device Properties
-
Gateway and Child Device Management
- Platform Notifying a Gateway of New Child Device Connection
- Platform Notifying a Gateway of Child Device Deletion
- Gateway Synchronizing Child Device Information
- Gateway Updating Child Device Status
- Responding to a Request for Updating Child Device Statuses
- Gateway Requesting for Adding Child Devices
- Platform Responding to a Request for Adding Child Devices
- Gateway Requesting for Deleting Child Devices
- Platform Responding to a Request for Deleting Child Devices
- Software and Firmware Upgrade
- File Upload and Download
- Device Time Synchronization
- Device Reporting Information
- Device Log Collection
- Remote Configuration
- Device Tunnel Management
- HTTPS API Reference on the Device Side
- LwM2M API Reference on the Device Side
- Security Tunnel WebSocket API Reference
- Module AT Command Reference
- Change History
-
API Reference on the Application Side
- SDK Reference
-
FAQs
- Top FAQs
-
Solution Consulting
- In What Scenarios Can the IoT Platform Be Applied?
- What Are the Changes Brought by the Integration of IoT Device Management and IoTDA?
- Can I Enable IoTDA for IAM Users or Sub-Projects?
- Which Regions of Huawei Cloud Are Supported by the IoT Platform?
- Does Huawei Provide Modules, Hardware Devices, and Application Software?
- What Should I Do If I Want to Call an API But Have No Permissions to Do So as an IAM User? (Is It Edition-specific?)
- Why Was I Prompted to Grant Security Administrator Permissions When I Create a Rule or Set Resource File Storage?
- Which Resource Space Will Be Set As Default on the IoT Platform?
- How Does IoTDA Obtain Device Data?
- Is There Any Limitation on the Number of Resource Spaces and Devices I Can Add on the IoT Platform?
- Does the IoTDA Support Device Registration in Batches?
- Are There Any Limitations on the Use of the IoT Platform?
- What DTLS Encryption Algorithms Are Supported by the IoT Platform?
- Does the IoT Platform Support Conversion Between Big-Endian and Little-Endian for Binary Data?
- What Is NB-IoT?
- What Are the Components of the IoT Platform and What Hardware Architectures Does It Support?
- How Do I Obtain the Platform Access Address?
- Device Integration
- IoT Device SDKs
- LwM2M/CoAP Device Access
- MQTT-based Device Access
- Products Models
- Message Communications
- Subscription and Push
- Codecs
- OTA Upgrades
- Application Integration
- General Reference
- Why Did the IoT Device SDK for C Fail to Be Started?
- Why Did the IoT Device SDK for Java Fail to Be Started?
- Which Java SDK Demo Should I Refer to?
- Which C SDK Demo Should I Refer to?
- Why Was the Error Code 4 Returned When I Used the IoT Device SDK for C for Device Connection?
- What Are the Differences Between the IoT Device SDK and IoT Device SDK Tiny?
- Issues Related to IoT Device SDK C Tiny
- 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?
Show all
Copied.
IoT Device SDKs
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
- 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.
- 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.
- 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.
- 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 errorThis 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot