Other Issues of Gateway

How does a universal gateway interact with an MCU?

1. Start the module: When the module is powered on, it sends a product information query frame to the MCU. If the MCU does not reply with any product information, the module will not respond to other commands. If the gateway is only used to transmit transparent data, no DPs are created on the gateway, and bit2 in the product information cap field is set to 0. If the gateway provides other features, DPs are created on the gateway, and bit2 in the product information cap field is set to 1. The sub_id 0000 indicates the gateway.

2. Add a sub-device. The MCU can send a sub-device addition command only after receiving a permit network access command. After the gateway module sends a deny network access command, it does not accept new sub-device addition commands. However, it can still process sub-device addition commands received previously. For example, the gateway receives a command to add sub_1 at 7:30:30 and sends a deny network access command at 7:30:31. Then, sub_1 can be added successfully. After you add the gateway to the app and connect the gateway to the network, tap Add Sub-device on the app panel so that the gateway module will send a permit network access command. If the gateway module is working in self-processing mode, the module will send a permit network access command after it detects a button tapping operation. This command will time out in 100s. One command can create multiple sub-devices with the same PID. The value of the sub_id field is in ASCII format and you can customize the value length. However, a value with fewer than 25 bytes is recommended.

3. Heartbeat mechanism: The gateway sends a query frame to the MCU at intervals to query the heartbeat of sub-devices. The hb_time field in the heartbeat response frame determines the interval. If the gateway fails to receive a reply from a sub-device, it will retransmit the query frame three times. If the gateway still does not receive a reply, it will set that sub-device to the offline status. The gateway will no longer send heartbeat query frames to that sub-device until the gateway receives a status frame from that sub-device and sets its status to online. After a sub-device is added, the default heartbeat interval is set to 60s. After the gateway is restarted, it polls the heartbeat of all sub-devices at an interval of 60s.

How do I create a sub-device?

1. Currently, sockets are the only available sub-device type.

2. To create a sub-device, choose Electrician > Socket >Custom Socket.

3. Set the communication type to Other.

4. To create a sub-device of another type, ask your project manager to contact the product manager. Currently, you cannot create such a sub-device on the platform yourself.

How do I create a gateway?

1. On the Tuya Smart platform, click Create.

2. Choose Others > Gateway. The type of a gateway running an earlier version is Wi-Fi connector. To create a gateway running an earlier version, resend a sample.

The gateway cannot be activated, what does 'sign verified error' in log printed?

Pls check if UUID, AUTHKEY and PID are filled correctly.

Last updated