The pairing and activation of the robot is the first step in Tuya’s IoT basic service. The device is connected to the router through pairing, and then accesses Tuya services to get activated. This topic summarizes the pairing modes. The following table lists the specific pairing and adaptation methods:
| Pairing method | Description |
|---|---|
| AP Pairing | A device acts as an access point (AP). After the mobile phone is connected to this AP, it sends the device the SSID and password of the router and the activation token over a TLS connection. After receiving the SSID and password, the device switches to station mode to connect to the router and then authenticates with the cloud for activation using the authorization information and token. |
| Bluetooth Pairing | A device regularly sends Bluetooth advertising packets to any listening device. After discovering a device, the mobile app pairs with it, exchanges keys, establishes a connection, and sends it the SSID and password of the router and the activation token. After receiving the SSID and password, the device switches to station mode to connect to the router and then authenticates with the cloud for activation using the authorization information and token. |
| Wired and Cellular Network Pairing | A device connects to the network through a wired Ethernet port or a cellular module (GPRS/3G/4G) to obtain an IP address. In the wired scenario, the device periodically sends UDP broadcast packets on the LAN. After receiving the broadcast, the mobile app exchanges keys with the device and sends the activation token. In the cellular scenario, the device generates a QR code containing device information, and the user scans it through the mobile app to complete activation. After obtaining the activation token, the device authenticates with the cloud for activation. |
| Enhanced QR Code Pairing | After the device is powered on, it enters AP pairing mode. A QR code (short URL) containing device information is displayed on a label or silk screen. The App scans the device QR code to obtain the short URL, requests pairing parameters such as Pin and UUID from the cloud, connects to the device AP, and establishes a TLS secure channel for local interaction. The SSID and password of the target router, as well as the activation token, are transmitted over this channel. After obtaining the SSID and password, the device switches to Station mode to connect to the router, and uses the authorization information and Token to authenticate and activate the device with the cloud. |
If you have any problems with TuyaOS development, you can post your questions in the Tuya Developer Forum.
Is this page helpful?
YesFeedbackIs this page helpful?
YesFeedback