Gateway couldn't subscribe more than 4 topics

67 Views Asked by At

I'm currently developing a gateway which connects with Google Cloud IoT core via MQTT bridge. I've selected association only when i created the gateway, as other non-gateway devices are Bluetooth devices, the gateway will bind and attach the devices to the IoT core.

I'm trying to attach 4 devices to the IoT core, the IoT core returns success (0) to the attach control messages. After that, i send a subscribe message with 10 topics to the IoT Core:

/devices/{gateway}/config

/devices/{gateway}/commands/#

/devices/{device-1}/config

/devices/{device-1}/commands/#

/devices/{device-2}/config

/devices/{device-2}/commands/#

/devices/{device-3}/config

/devices/{device-3}/commands/#

/devices/{device-4}/config

/devices/{device-4}/commands/#

the problem is only the first 4 topics could be subscribed, the broker always return 128 for the last 6 topics. I've tried to swap the order of the device topics (e.g. swap device-4 with device-1), and the result is the same, the broker only return Success(0) to the first 4 topics. is there any limitations on the topics could be subscribed with a single MQTT client? Cheers

1

There are 1 best solutions below

0
jonathan.lee On

Problem solved. Cloud IoT Core is not accepting more than 4 topics in one subscribe request message, I separated the topics into several subscribe request and it works now.