Last Updated on : 2023-01-29 09:27:15download
This topic will walk you through how to develop with MCU interfacing solution to enable your products to connect to the cloud. The step-by-step guide focuses on the operation performed on the Tuya IoT Platform. For more information about the implementation process, see the documentation as per your connectivity solution.
The MCU interfacing solution enables products with built-in microcontrollers to connect to the cloud and become connected. Tuya provides one-stop IoT development services including the three essentials for typical IoT products, namely network modules, mobile apps, and cloud services. With Tuya’s MCU SDK, all-in-one mobile apps, and control panels, you can focus on application development simply, connect your product to the Tuya IoT Platform easily, and benefit from the cloud services quickly.
The following block diagram shows how the MCU communicates with Tuya’s network modules.
Hardware solution: including the selection of the communication protocol and network module.
Mobile app solution: all-in-one apps or OEM apps.
Cloud services: safe and reliable cloud services that can serve users around the world. Have your product integrated with Tuya’s network modules to connect to the cloud. Tuya also provides a host of OpenAPIs to help you quickly implement native applications. For more information, see Cloud Development Platform.
Log in to the Tuya IoT Platform, create a product, and download the MCU SDK.
Tuya IoT Platform provides one-stop services to help you in the development process from prototype to mass production. You can make your product IoT-enabled with the Tuya IoT Platform in four steps.
For more information about the detailed processes of product creation, see Create Products. The Tuya IoT Platform provides two development methods, namely the no-code development and custom solution. You need to choose Custom Solution to interface an MCU with Tuya’s network modules. The protocol determines your options for network modules.
For more information about how to define functions, see Product Functions.
A data point (DP) is an abstract representation of a product function. Tuya provides all products with standard DPs. You can select the ready-made standard DPs or create custom DPs to customize the required functions.
The interface on the mobile app used for users to interact with a smart device is called a panel. Tuya provides up to 100 free all-in-one panels that also support personalized editing. For more information, see Design App UI.
The Tuya IoT Platform recommends modules to you based on your product and protocol. You can place an order for the modules online. You can also change the selected modules online as needed. For more information, see the Module Datasheet.
You can download all the development documents with one click. They include:
MCU SDK: an SDK in C automatically generated based on your defined functions. The SDK has implemented the communication architecture and protocol parsing, allowing you to directly import it to your project to proceed with application development.
General serial protocol: a protocol automatically generated based on your defined functions.
Module debugging assistant: an integral debugger used to verify the serial communication between the MCU, module, and the cloud.
Function debugging file: used for the debugging assistant to test the product ID (PID) and DPs.
After a product is created, you can purchase a sample module, download the SDK, and start embedded programming and debugging. A range of documentation will help you get started quickly.
Zigbee: Zigbee Common Solution
Bluetooth LE: Bluetooth Common Solution
NB-IoT: NB-IoT Common Solution
After you get the sample module, you can build a minimum system to learn how the communication between the MCU, module, and the cloud works as well as the pairing process. For more information, see the following documentation.
If your MCU has sufficient resources, we recommend you port the MCU SDK for efficiency purposes. You only need to implement the serial communication and the required applications without taking care of the protocol infrastructure. The requirements for MCU resources vary depending on the SDKs. Take the Wi-Fi MCU SDK as an example. Its requirements for hardware resources are as follows.
If your MCU does not have sufficient resources, you can refer to the functions in the SDK for interfacing with Tuya’s protocol. For more information, see MCU SDK Porting.
If you get errors, you can view the device logs on the Tuya IoT Platform to locate problems. For more information, see Device Log Service.
If the documentation cannot resolve your questions, you can submit a ticket to request technical support. For more information, see Service and Support.
Is this page helpful?YesFeedback
Is this page helpful?YesFeedback