Configuration

Last Updated on : 2026-04-07 06:32:59Copy for LLMView as MarkdownDownload PDF

This topic walks you through how to configure the tuyaos_demo_wukong_ai project, covering board type selection, feature switches, AI mode, UI, and audio.

Configuration entry and process

Open the configuration interface

make app_menuconfig APP_NAME=tuyaos_demo_wukong_ai

In the Tuya Wind IDE, you can access this by navigating through the menu or by right-clicking the project and selecting Configuration.

Activation workflow

┌─────────────────┐     ┌──────────────────────┐     ┌─────────────────┐
│ 1. Enter menuconfig │ ──► │ 2. Select/modify config   │ ──► │ 3. Save and exit      │
└─────────────────┘     └──────────────────────┘     └─────────────────┘
                                                              │
                                                              ▼
┌─────────────────┐     ┌──────────────────────┐     ┌─────────────────┐
│ 6. Build firmware      │ ◄── │ 5. Build project          │ ◄── │ 4. Generate config file  │
└─────────────────┘     └──────────────────────┘     └─────────────────┘

After modifying the configuration, you must run the following command to generate tuya_app_config.h. Otherwise, the configuration changes will not take effect.

make app_config APP_NAME=tuyaos_demo_wukong_ai

Type selection guide

Select according to functional requirements

Requirement Item Description
No screen, voice-only
Select the board type, and then turn off ENABLE_TUYA_UI No LVGL, no display, saves resources
Camera required Select T5AI_BOARD/EYES/ROBOT/DESKTOP, and then turn on ENABLE_TUYA_CAMERA Supports P2P video, multimodal AI
P2P video call required Turn on ENABLE_TUYA_CAMERA, and then turn on ENABLE_AI_MODE_P2P Point-to-point audio/video communication
Cellular network (4G, etc.) required Turn on ENABLE_CELLULAR_DONGLE USB cellular module
File system (resource storage) required Turn on ENABLE_TUYA_UI, and then turn on TUYA_FILE_SYSTEM LittleFS supports SD card or SPI flash

Select according to AI conversation mode

After a board type is selected, certain AI modes are automatically enabled (determined by the board’s select statements). The table below shows the default enabled modes for each board type:

Board type HOLD ONESHOT WAKEUP FREE TRANSLATE P2P
T5AI_BOARD / EVB / EYES / ROBOT / DESKTOP - Requires camera
WUKONG_BOARD_UBUNTU - - - - -

TUYA_AI_CHAT_DEFAULT_MODE

The conversation mode entered by default upon power-on (values 0 to 5 correspond to hold, oneshot, wakeup, free, translate, and p2p, respectively).

How to modify the conversation modes supported by a board type?

In build/APPconfig, under the config block for the corresponding board type, add or remove select ENABLE_AI_MODE_xxx.

For example, to add the wakeup mode for a board type, add select ENABLE_AI_MODE_WAKEUP. To remove a mode, delete the specified select line. For P2P mode, you must first turn on ENABLE_TUYA_CAMERA, and then turn on ENABLE_AI_MODE_P2P in its sub-options. After modifications, run make app_config to generate the configuration.

How to modify the default conversation mode?

Find TUYA_AI_CHAT_DEFAULT_MODE in menuconfig, change its value to the desired mode (05), save, and then run make app_config to generate the configuration.

The selected mode must be one that has already been selected for the current board type. Otherwise, the system will fall back to another enabled mode. Users can also switch between modes via the UI at runtime, and the switched mode will be saved and used preferentially on the next power-on. For more information, see Default conversation mode.

Detailed configuration items

Camera (ENABLE_TUYA_CAMERA)

  • Visible conditions: T5AI_BOARD, T5AI_BOARD_EYES, T5AI_BOARD_ROBOT, and T5AI_BOARD_DESKTOP.
  • Sub-item: ENABLE_AI_MODE_P2P is used to enable P2P video call mode.

UI (ENABLE_TUYA_UI)

Sub-configuration Description
TUYA_CPU_ARCH_SMP CPU multi-core architecture. Enables multi-type LCD, touch, and LVGL ARM2D acceleration.
TUYA_LVGL_VERSION LVGL version, 8 or 9.
TUYA_LINGDONG_GUI Lingdong GUI components.
TUYA_IMG_DIRECT_FLUSH Direct image flush to screen (depends on TUYA_CPU_ARCH_SMP).
TUYA_FILE_SYSTEM File system. Supports SD card or SPI flash.
FILE_SYSTEM_LFS_SD LittleFS uses SD card.
FILE_SYSTEM_LFS_SPI_FLASH LittleFS uses SPI flash.

Default conversation mode (TUYA_AI_CHAT_DEFAULT_MODE)

Value Mode Description
0 hold Press and hold to trigger
1 oneshot Press the specified button once
2 wakeup Keyword wake-up
3 free Free conversation
4 translate Translation mode
5 p2p P2P mode (requires camera to be enabled)

How to modify the default mode?

If the current default mode does not meet your requirements, you can modify it in the following ways:

  • Use menuconfig (Recommended):

    • Run make app_menuconfig APP_NAME=tuyaos_demo_wukong_ai.
    • Locate TUYA_AI_CHAT_DEFAULT_MODE and change its value to the desired mode (05).
    • After saving and exiting, run make app_config APP_NAME=tuyaos_demo_wukong_ai to generate the configuration.
  • Switch during runtime:

    • Users can switch between the conversation mode via the UI settings. The switched mode will be saved to KV storage.
    • On the next power-on, the mode saved in KV storage will be used preferentially. If that mode is not enabled, TUYA_AI_CHAT_DEFAULT_MODE will be used instead.
  • Constraints:

    • The selected default mode must be an enabled mode for the current board type. For more information, see Board types and modes.
    • If the mode is not enabled for the board type, the system will fall back to the next enabled mode.
    • For example, WUKONG_BOARD_UBUNTU only has the HOLD mode enabled. Even if the default mode is set to 3 (free conversation), the system will actually use the HOLD mode.

AI player decoder options

Item Description Default
AI_PLAYER_DECODER_OPUS_ENABLE Enable raw OPUS decoding y
AI_PLAYER_DECODER_OPUS_FRAME_SIZE OPUS frame length (ms), ranging from 10 to 60 40
AI_PLAYER_DECODER_OPUS_KBPS OPUS bitrate (kbps), ranging from 16 to 128 16
AI_PLAYER_DECODER_OGGOPUS_ENABLE Enable OGG-OPUS container decoding y

Common configuration examples

Minimal configuration (voice-only, no screen)

BOARD_TYPE        = T5AI_BOARD (or EVB)
ENABLE_TUYA_UI    = n
ENABLE_TUYA_CAMERA = n

Standard development board (voice + screen + camera)

BOARD_TYPE         = T5AI_BOARD
ENABLE_TUYA_UI     = y
ENABLE_TUYA_CAMERA = y
ENABLE_AI_MODE_P2P = n (Enable if needed)

Ubuntu simulation

BOARD_TYPE = WUKONG_BOARD_UBUNTU

Portable evaluation board (small screen + battery)

BOARD_TYPE = T5AI_BOARD_EVB
ENABLE_TUYA_UI = y

Post-configuration checks

  1. Verify configuration generation. Check if the corresponding macro definitions exist in include/tuya_app_config.h or build/tuya_app.config.
  2. Verify board-level files. local.mk selects board-level implementations under src/boards/xxx/ based on configuration options like CONFIG_T5AI_BOARD.
  3. Rebuild. After configuration changes, ensure you run make app_config before rebuilding.

Add BOARD_TYPE

Add config in choice

Add a new config within the choice block in build/APPconfig, and establish a select dependency.

config MY_CUSTOM_BOARD
   bool "MY_CUSTOM_BOARD"
   select TUYA_MODULE_T5
   select USING_BOARD_AUDIO_INPUT
   select USING_BOARD_AUDIO_OUTPUT
   select ENABLE_AI_MODE_HOLD
   select ENABLE_AI_MODE_ONESHOT
   select ENABLE_AI_MODE_WAKEUP
   select ENABLE_AI_MODE_FREE
  • Audio: Use USING_BOARD_AUDIO_INPUT/OUTPUT for onboard microphone/speaker, and USING_UART_AUDIO_INPUT/OUTPUT for UART external connection.
  • Display: Add select LCD_SPI_DISPLAY for SPI screens, and add select SPI0_REMAP_PIN if pin remapping is required.
  • AI mode: Add select ENABLE_AI_MODE_xxx as needed.

Camera visibility condition (optional)

If a new board type supports the camera, add the new board type to the if condition for ENABLE_TUYA_CAMERA:

if (T5AI_BOARD || T5AI_BOARD_EYES || ... || MY_CUSTOM_BOARD)