switch_demo
switch_demo
is a Tuya IoT application and a minimal functionality application demo provided by the Tuya AI+IoT platform. It is a simple, cross-platform, cross-system switch example that supports multiple connections. Through the Tuya APP and Tuya Cloud services, you can perform remote control (when away), LAN control (same local network), and Bluetooth control (when no network is available) on this switch.
The current switch_demo
demonstrates the following functions:
- Supports Bluetooth network configuration
- Supports WiFi AP mode network configuration
- Receives MQTT control data from the cloud and automatically responds
- Receives LAN TCP control data from the APP and automatically responds
- OTA functionality
Currently, switch_demo
does not control real hardware, so it can run on all currently supported platforms.
Before using switch_demo
, you need to understand the following terms:
Default APP Control Panelâ
Directory Structureâ
+- switch_demo
+- src
-- cli_cmd.c
-- tuya_main.c
-- tuya_config.h
-- CMakeLists.txt
-- README_CN.md
-- README.md
- cli_cmd.c: Some command line operations for switch_demo, used to view and operate switch_demo information and status
- tuya_main.c: Main functionality of switch_demo
- tuya_config.h: Tuya PID and authorization information, created and obtained on the Tuya IoT platform. You can refer to the documentation TuyaOS quickstart
Supported Hardwareâ
The current project can run on all currently supported chips and development boards
Compilationâ
- Run the
tos config_choice
command to select the current development board or platform. - If you need to modify the configuration, first run the
tos menuconfig
command to modify the configuration. - Run the
tos build
command to compile the project.