Last Updated on : 2023-12-19 08:36:57download
Without a direct connection to the internet, a Wi-Fi device can be activated with the mobile app acting as a proxy. After the mobile app completes the activation in the cloud, it connects to the access point (AP) of the target device and activates it.
Activate a device without internet: This is mostly used for IP cameras (IPC).
Perform OTA updates without internet:
tuya_iot_wifi_api.h
Devices that can be activated without internet must have an AP name in the format of SmartLife-xxxx
. xxxx
is the last four digits of the device’s UUID. Make sure you set the AP correctly.
Activation without internet does not apply to all product categories. Check if the mobile app and panel support the use of this feature for your product.
Call this API to set the AP name of your product.
/**
* @brief tuya_iot_set_user_def_ap_if
*
* @param[in] ssid: user defined ssid of device ap
* @param[in] passwd: user defined ssid of device ap
*
* @return OPERATE_RET
*
* @note need call before tuya_iot_wf_xxx_init
*/
OPERATE_RET tuya_iot_set_user_def_ap_if(IN CONST CHAR_T *ssid, IN CONST CHAR_T *passwd);
VOID __ty_set_user_ap_if()
{
CHAR_T apSsid[WIFI_SSID_LEN + 1] = {0};
CHAR_T suffix[6] = {0};
snprintf(suffix, 4, "%s", get_gw_uuid() + strlen(get_gw_uuid())-4);
snprintf(apSsid, SIZEOF(apSsid), "SmartLife-%s", suffix);
if (OPRT_OK != tuya_iot_set_user_def_ap_if(apSsid, NULL)) {
PR_ERR("set user ap if err");
}
}
This feature is available on TuyaOS v3.6.0 and later.
Is this page helpful?
YesFeedbackIs this page helpful?
YesFeedback