Copyright ©

Mongoose OS Forum

ATTENTION! This forum has moved to:

Do not post any new messages.

Google IoT MQTT topics

edited September 2017 in Mongoose OS

I'm little confused about MQTT topics in Google IoT.
When im creating topic in console its look like 'my-project/us-central1/my-registry/my-es256-device'. Then when my device is subscribing i see:
mgos_mqtt_ev Subscribing to 'my-es256-device/rpc'
mgos_mqtt_ev Subscribing to 'my-es256-device/rpc/#'

And when I push button it sends message to
Published: yes topic: /devices/my-es256-device/events message: {"free_ram":30080,"total_ram":51912}

So when i want to subscribe for this topic should it be
or 'my-project/us-central1/my-registry/my-es256-device/events' ? or other?
and what for is 'my-es256-device/rpc' ? And how to subscribe to it? 'my-project/us-central1/my-registry/my-es256-device/rpc' ?


  • edited September 2017

    Ok its all here and here

    "A device can publish a telemetry event by issuing a PUBLISH message through the MQTT connection. Messages must be published to an MQTT topic in the following format:

    You can also publish to a subfolder, for example, /devices/{device-id}/events/alerts. The{device-id} is case sensitive and must match the string ID of the device specified in the MQTT client ID.

    The messages published to this MQTT topic are forwarded to the Cloud Pub/Sub topic specified in the event_notification_config.pubsub_topic_name field in the device registry resource. The forwarded message data field contains a copy of the message published by the device, and the following message attributes are added to each message in the Cloud Pub/Sub topic:"

    Thanks anyway! :)

  • SergeySergey Dublin, Ireland

    Yes, correct.

    Also, you cannot subscribe to arbitrary MQTT topics with Google IoT (with one exception of a special config topic).
    I think this severe limitation will soon be removed by the Google team.

  • Also, it seems we cannot trigger an rpc call to the device but can only subscribe to /devices/{device-id}/config topic only. Is that true?

  • Hi there,

    I have the same issue. I already read the Google IoT documentation and have searched a lot on the internet but I couldn't find a proper answer.

    My question is: Is it possible to subscribe to any other topic other than /devices/{device-id}/config? and if not, how can I read data from the default telemetry topic using Mongoose OS?

    Any pointers would be very appreciated. Thanks in advance.

Sign In or Register to comment.