Last Updated on : 2024-06-25 03:48:49download
Without a direct connection to the internet, a Bluetooth and Wi-Fi combo device can connect to the mobile app over Bluetooth. The mobile app then acts as a proxy to activate the device in the cloud. This feature is also known as PlugPlay pairing.
To use this feature, perform the following steps.
Go to the Tuya Developer Platform.
Find the target product, and click Develop in the Operation column.
In the tab of Function Definition, scroll down to find the Advanced Functions at the bottom of the page and enable PlugPlay.
How it works:
Open tuya_iot_config.h
and check if the following macro is defined.
/* Bluetooth service enablement */
#define ENABLE_BT_SERVICE 1
/* Bluetooth pairing enablement */
#define ENABLE_BT_ACTIVE 1
The mobile app will trigger PlugPlay pairing in the following two cases.
Case 1: The following error occurs during Bluetooth pairing.
/* Error code returned when the device failed to connect to the Wi-Fi or cloud. */
typedef int AP_CFG_ERR_CODE;
#define AP_CFG_SUCC 0
#define AP_CFG_ERR_PCK 1
#define AP_CFG_AP_NOT_FOUND 2
#define AP_CFG_ERR_PASSWD 3
#define AP_CFG_CANT_CONN_AP 4
#define AP_CFG_DHCP_FAILED 5
#define AP_CFG_CONN_CLOUD_FAILED 6
#define AP_CFG_GET_URL_FAILED 7
#define AP_CFG_GW_ACTIVE_FAILED 8
#define AP_CFG_GW_ACTIVE_SUCCESS 9
Case 2: The user chooses to use PlugPlay pairing on the mobile app.
PlugPlay is triggered only when Bluetooth pairing failed.
If the device is paired over Wi-Fi, such as AP mode or Pegasus pairing, PlugPlay will not be triggered. And, the mobile app triggers PlugPlay only for devices that have this feature enabled.
Is this page helpful?
YesFeedbackIs this page helpful?
YesFeedback