Last Updated on : 2024-06-25 03:45:15download
Activate and bind a device by scanning its QR code using the mobile app.
QR code
A QR code is a kind of two-dimensional barcode that holds encoded data in a graphical black-and-white pattern.
Short URL
Convert a long URL into a shorter one using a program. Short URLs hide the real address and are easier to read, share, and remember.
The process of activation and binding with QR code.
Source of the QR code:
Activation and binding with QR code applies to the following devices:
All of these devices can connect to the internet and MQTT without depending on the mobile app.
Open tuya_iot_config.h
and check if the following macro is defined.
#define ENABLE_QRCODE_ACTIVE 1
Create a product on the Tuya Developer Platform and then enter the product development process. Click on the Function Definition tab, scroll down to Advanced Functions, and enable LinkSDK. Purchase licenses for device authorization using the PID of this product.
You might not find LinkSDK in Advanced Functions. This is because the product solution does not have this function bound. To request binding it with your product, contact your account manager or submit a service ticket.
You can use the purchased license to implement the function of activation and binding with QR code only after enabling LinkSDK.
After the call of device initialization, set the network information (for Wi-Fi devices, set the Wi-Fi’s SSID and password with an API request). After the device is connected to the internet, it will initiate an MQTT connection and proceed with activation.
If you need the short URL to generate a QR code for display, register the callback active_shorturl
provided in smart device functionality callbacks during device initialization. This callback returns the short URL after the device is connected to the internet.
Frequently requesting short URLs from the cloud might trigger the cloud’s protection mechanism, causing functional exceptions.
We recommend saving the short URL after obtaining it. You can use the saved short URL directly after the next power-on to avoid frequent access.
Is this page helpful?
YesFeedbackIs this page helpful?
YesFeedback