Last Updated on : 2023-06-13 02:44:06Copy for LLMView as MarkdownDownload PDF
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.
Feature description
Activate a device without internet: This is mostly used for IP cameras (IPC).
The user scans the QR code on the device using the mobile app.
The mobile app gets the device information and acts as a proxy to activate the device in the cloud.
The mobile app connects to the AP from the target device to create a LAN.
The mobile app sends the data point (DP) description received from the cloud to the target device for activation.
Then, the mobile app can control and communicate with the device over the LAN.
Perform OTA updates without internet:
The mobile app downloads the update and then connects to the AP of the device.
The mobile app sends updates to the activated device via a proxy, allowing it to install updates without internet access.
Process
Activate devices in AP without internet
Perform OTA updates without internet
Development guide
Reference the header
tuya_iot_wifi_api.h
How to
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.
API description
Set the AP name
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);
Example
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");
}
}
FAQs
Which TuyaOS release supports activation in AP mode without internet?
This feature is available on TuyaOS v3.6.0 and later.
What is required to use activation in AP mode without internet?
Set the AP name in the required format. For more information, see How to.
Check if the mobile app and panel support the use of this feature for your product.