Last Updated on : 2025-08-06 03:08:27download
This topic describes how to develop Bluetooth door locks based on the TuyaOS Bluetooth Device Development Kit. By following this guide, you can quickly get started and complete door lock product development.
.\hardware\
.\software\TuyaOS\apps\tuyaos_ble_lock_xxxxxx_demo\README.md
.\software\TuyaOS\apps\tuyaos_ble_lock_xxxxxx_demo\doc\index.html
Use case: You are integrating with Tuya’s framework for the first time or are familiar with Tuya’s legacy lock SDK. You have no need to care about Bluetooth API calls—only adapt peripheral driver integration and customize application logic such as audio/visual feedback.
Recommendation: Read the kit’s built-in documentation in either README.md or index.html format.
Use case: Develop Tuya Bluetooth lock accessories, such as Bluetooth keys and keypads.
Recommendation: Read the kit’s built-in documentation in either README.md or index.html format.
Use case: You already have a mature and stable proprietary lock framework and chip platform, and want to integrate with Tuya via the Bluetooth module’s UART commands.
Recommendation: Refer to Bluetooth Serial Communication Protocol.
Open Visual Studio Code, navigate to the Resource Center of the Tuya Wind IDE plugin, filter the latest Bluetooth Device Development Kit for the desired platform, and click Create to download it to your local device.
After the Bluetooth Device Development Kit is created, you can download it from the Product Dev Kit tab of the Dev Framework page.
Select the desired development kit in the apps
directory, right-click it, and then select Build Project. After the first compilation, the firmware and Keil5 project files are generated in the .log
folder. You can then choose Visual Studio Code or Keil5 for development based on your personal preference.
app_config.h
file will be automatically synchronized.apps/tuyaos_demo_xxxx/doc
folder.Bluetooth development framework: By default, the system does not automatically enter sleep mode. After tal_cpu_allow_sleep()
is invoked, the Bluetooth MCU enters sleep mode and can be woken up by any external interrupt, software timer interrupt, or Bluetooth event. If tal_cpu_force_wakeup()
is invoked after waking up, the chip will no longer automatically enter sleep mode. To ensure proper sleep or wakeup behavior, peripherals such as UART and I2C must be disabled or enabled accordingly to avoid malfunctions.
For testing, refer to the Bluetooth Basics Demo and use the Logic host software to send sleep testing commands. Compare and verify sleep mode power consumption against the corresponding chip datasheet for accuracy.
Lock development kit: After you enable low power management (configSUPPORT_SLEEP_MODE
), the lock development kit automatically handles sleep mode entry and exit. Enable relevant logs during the debugging phase for sleep mode monitoring.
Is this page helpful?
YesFeedbackIs this page helpful?
YesFeedback