I have developed a device that is able to connect to Google IoT Core through the MQTT protocol, I can publish MQTT messages on telemetry topics (/devices/DEVICE_ID/events
).
But I can't figure out how to subscribe my device to a generic topic and send messages from cloud to device via this topic.
Through the console I created the topic MyTestTopic
and a subscription MyTestTopic-sub
, I guess that somehow I have to subscribe my device to the subscription MyTestTopic-sub
, but I don't know to which topic I have to subscribe my device.
I tried to subscribe my device to the following topics:
projects/PROJECT_ID/topics/MyTestTopic
projects/PROJECT_ID/topics/MyTestTopic-sub
/devices/DEVICE_ID/events/MyTestTopic
/devices/DEVICE_ID/events/MyTestTopic-sub
the subscription to these topics seems to be successful, but the device does not receive the messages I send from the console.
Any suggestions please?
I found this thread (Google Cloud IoT - Invalid MQTT publish topic) from 4 years ago, from which I understand that it is possible to subscribe only to some predefined topics, also from the various documents I have read I understand that Google IoT Core allows devices to subscribe to only two topics: /devices/{device-id}/config
and /devices/{device-id}/commands/#
Has anything changed since then?