The mobile app connects to the router and generates a QR code. The device scans the QR code, extracts information from it, and then connects to the router to complete cloud activation.
Process
Development guide
Prerequisites
Install a Tuya-enabled mobile app that can generate a QR code.
The device can read QR codes, such as with a ZBar integration.
The development framework provides a set of APIs for Linux. You need to adapt the implementation to your specific hardware.
Pass the QR code reading to the SDK.
OPERATE_RET tuya_ipc_direct_connect(IN CONST CHAR_T *p_str, IN CONST TUYA_IPC_DIRECT_CONNECT_TYPE_E source);
FAQs
Why can’t the device read the QR code generated on the mobile app?
Screenshot the QR code and try reading it using another mobile app to verify if the device has a problem with reading the QR code.
Check if the device has integrated with a QR code reading algorithm, such as the ZBar library.
Check if the YUV or JPEG image the device obtains and passes to the QR code reading algorithm is clear.
Why can’t the device be activated despite successfully scanning the QR code?
Check the SSID and password of the router input on the mobile app.
Check if the pairing mode and connection mode are set correctly. The recommended pairing mode and connection mode are PARING_MODE_WIFI_AP and TUYA_IPC_LINK_WIFI respectively.
Check if all the required tkl_wifi.c APIs are adapted.
Verify if tkl_wifi_init(WIFI_EVENT_CB cb) proactively notifies the SDK of the current network status when the network changes.