MCU Development FAQ for Gateway

Last Updated on : 2022-11-24 09:20:10download

What is the maximum number of sub-devices that can be accessed under a single gateway?

  • As a normal gateway, it supports up to 128 sub-devices. If it is a gateway with security attributes, it supports up to 64 sub-devices.
  • No more than 32 sub-devices can be added in a single batch

Does it support 433, Bluetooth, 485, and other sub-devices?

Gateway universal docking development method: Turow provides a Wi-Fi module, MCU is developed by the customer. As long as the MCU sends data according to the serial protocol, it can access the Turow platform. Therefore, Gateway Universal Docking does not care about the communication type of the sub-device.

What is the number of local linkages?

This is related to the number of conditions and actions created by the user. One condition is about 250 byte and one action is about 200 byte. If you create 1 condition + 5 actions, it is recommended that you do not create more than 10.

How to set the heartbeat interval of the slave device in MCU?

MCU sets the next heartbeat interval in the heartbeat reply frame. The default heartbeat interval is 1min, and the minimum settable heartbeat interval is 180s.

When will the module query the sub-device heartbeat?

It will query before the heartbeat cycle arrives. The sub-device heartbeat will be sent out earlier (8S+random seconds) in order to avoid the situation that multiple sub-devices send out heartbeats at the same time and the MCU is too late to process the heartbeat.

How does the module determine the online/offline status of the sub-device?

Before the heartbeat cycle arrives, the module will send heartbeat query packet to MCU in advance, and if there is no reply around 8s timeout, it will resend, and if it accumulates 3 times and still no reply, the module will notify the cloud that the sub-device is offline; then the module will stop sending heartbeat frames to this sub-device until the MCU sends the status frame of this sub-device to the Wi-Fi module, and the module will notify the cloud that the device is online and restart the device heartbeat.

When will the module refresh the heartbeat and re-timer?

The module will refresh the heartbeat and re-timer when it receives the status data from the sub-device during the heartbeat interval.

What is the maximum number of frames and frequency that the module can receive on the serial port?

It is recommended that developers should not exceed 256 bytes of data in a frame. If the amount of data that needs to synchronize the status of sub devices after networking is large, it can be sent in packets and the frame interval is recommended to be 100ms.

Is there a limit to the length of the fields “pid”, “sub_id”, “gid”?

  • The “pid” can be filled in according to the product ID created in Tuya IoT Platform.
  • The length of “sub_id” should not exceed 25byte.
  • The “gid” is determined by the module issuing, the range is 0~65535, the length will not exceed 5byte.

Are there any restrictions on the MCU or subdevice software version number field?

Yes, the firmware version number format xx.xx.xx, x takes 0~9.

Does the sub-device information still exist after the gateway is removed and re-matched?

If you just remove the gateway, the sub-device information will still be retained. If the gateway is restored to factory settings, the sub-device information will not be retained. If the domestic and international accounts are switched when the gateway is re-provisioned, the slave device information will also be cleared.

How long does the MCU consider the timeout failure if it does not reply to the ACK after the serial command is sent?

The default timeout time is 500ms, and the heartbeat detection time is 8S.

What will happen if the APP sends a control command and does not detect the slave device offline in time?

The control command will be resent. 2 times in 1s interval -> 3 times in 10s interval -> stop resenting.

How to control the Wi-Fi module hardware reset?

8-EN pin is connected to key pull low.

How to get the running log of the Wi-Fi module?

If you need to get the log of the module during the debugging process, you can use the following diagram to get the Log_Tx and GND pins, connect the USB to the serial tool, configure the serial port 38400,8,N,1, and use the PC serial assistant to capture the log and save the text and provide it to Tuya technical support engineers for analysis.

MCU Development FAQ for Gateway

More questions

If you have more questions, you can submit a ticket and a professional engineer from Tuya will be available online to answer your questions. To be able to understand your problem quickly, we suggest you describe your problem in the following format.

  • Problem Background: For example, I am an embedded software engineer, and I am interfacing with a certain solution from Tuya.
  • Problem description: Describe in as much detail as possible the conditions under which your problem occurs and the failure phenomenon is? Can it be reproduced?
  • Problem attachment: Please upload the attachment if you have a screenshot or log of the failure site.