FAQ for gateways and sub-devices

更新时间:
复制 MD 格式

This topic describes common issues and solutions specific to gateways and sub-devices.

Gateway and sub-device network configuration and attachment

Android gateway-related issues

Other issues

Does the gateway support router hot spot network configuration (router-config)?

Yes. The process is as follows: The software development kit (SDK) scans for and connects to the 'adha' Wi-Fi network. It then reports the device that requires network configuration to the cloud. Use an app account that is attached to the router to find the device through local discovery. Click the device to begin network configuration.

Why isn't a sub-device attached to a user after it is added to a user-attached gateway?

Adding a sub-device from the app involves two steps: network configuration and attachment. When a sub-device is successfully added to a gateway, it only means that network configuration is complete. You must call the /awss/subdevice/bind API to attach the sub-device to the user.

If a topology relationship exists between the sub-device and the gateway before the gateway is attached, the sub-device is automatically attached to the user when the gateway is attached. You do not need to call the sub-device attachment API.

How to store device certificate information for dynamic registration

After successful dynamic registration, save the deviceName and device certificate information (productKey, deviceName, and deviceSecret) to a non-volatile folder. This ensures the data persists even after the application is uninstalled.

After dynamic initialization succeeds and a connection is established, do not perform dynamic initialization again. When the application restarts—including after it is uninstalled and reinstalled—it must retrieve the device certificate from persistent storage to establish the connection. This is the one-device-one-secret connection method. Dynamic registration can only be performed once.

If an app user detaches only the gateway, are the corresponding sub-devices also detached?

Yes, the relationship between the user and the sub-devices is also detached. However, the topology relationship between the gateway and the sub-devices is not affected.

Does calling the sub-device detachment API from the app also detach the topology between the sub-device and the gateway?

Calling the /awss/subdevice/unbind API detaches the current user from the specified sub-device. If the current user is the administrator of the sub-device, the network topology between the sub-device and the gateway is also automatically detached.

Does the gateway need to be online to attach or detach a sub-device from the app?

If sub-devices are involved, the requirements vary.

  • To attach a sub-device: The gateway must be online. When you use the app for network configuration, the gateway receives the LINKKIT_EVENT_SUBDEV_PERMITED event and then calls linkkit_gateway_subdev_register() to register the device.

  • To detach a sub-device: The gateway does not need to be online.

How can an Android gateway report data for multiple sub-devices?

  • All devices are dynamically registered using the following message format.

    for () {
    addSubDev
    login
    initSubDevThing
    }
  • The reported messages are in the following format.

    for() {
    post
    }

How to discover an Android gateway device with a screen using a public app?

The Android version of the Link Kit SDK does not include a network configuration feature. Android devices usually have a screen. You can use the screen to find the Service Set Identifier (SSID) and enter the password to connect to the router.

In the console, edit the product and select the option for a no-code public app. Use the public app to discover the device locally. After you attach the device, you can begin testing.

What causes gateways and sub-devices to go offline?

Possible reasons for a gateway going offline are:

  • Power failure

  • Device reset

  • Gateway heartbeat timeout

Possible reasons for a sub-device going offline are:

  • The gateway reported the sub-device as offline

  • The gateway is offline

Some standard features defined for a gateway are not found on the console page

Standard feature properties related to modules are not visible on the page.

Can a gateway actively get the property values of a sub-device from the cloud?

No, you cannot retrieve data from the cloud. The linkkit_get_value method retrieves local data. This data is a backup of data that the device previously reported.

What should I note when replacing a gateway during dynamic registration?

  • If a gateway has sub-devices, do not directly replace the gateway. First, detach all existing relationships. Then, use the new gateway to create new attachment relationships.

  • For sub-devices that use the one-device-one-secret method, you do not need to back up the device certificates. You can retrieve them from the cloud during the next registration.

  • For sub-devices that use the one-product-one-secret method, you must back up the device certificates. If the certificates are lost, you cannot retrieve them again.