0
votes

I am developing a Google IoT Gateway device which provisions itself using user entered information. I have it obtaining an OAuth token, provisioning itself as a Gateway and then provisioning new devices and binding them to the gateway. I have verified all provisioning is working as I can see the gateway and other devices it has provisioned on the Google Cloud Console under IoT Core. The children devices are also listed under bound devices on the gateway device UI. See screen shot here for verification:

enter image description here

However when the gateway attempts to publish a message to MQTT when it gets telemetry from a device I get an error on The MQTT error subscription like this:

{"error_type":"GATEWAY_DEVICE_NOT_FOUND","description":"The specified device with ID 'SN0013A200418E9E27' is not attached to the gateway.","mqtt_message_info":{"message_type":"PUBLISH","topic":"/devices/SN0013A200418E9E27/ev
ents"}}

This error seems incorrect as the device is bound to the gateway for certain.

The gateway attempted to publish this message to the topic:

/devices/SN0013A200418E9E27/events

The message being published to that topic is:

{"data":{"transmission_count":203,"battery_level":3.29406,"type":24,"node_id":0,"rssi":29,"acc_x":-46,"acc_y":0,"acc_z":93,"temp_change":0}}

The Gateway's Authorization method is Association only so as I understand it can report telemetry for children devices based solely on the authentication of the Gateway's credentials.

Another thing I should note is the gateway is an embedded device and thus is using the long-term MQTT domain mqtt.2030.ltsapis.goog I can verify that the gateway has a stabile connection to the Google IoT Core MQTT broker by monitoring it's connection on Stackdriver logs. Is it possible the long term support domain does not support Gateway devices? If so I could not find that information.

1

1 Answers

1
votes

I apologize. I do not know how I missed this documentation: https://cloud.google.com/iot/docs/how-tos/gateways/mqtt-bridge?hl=th#gateway_messages

A message must be published from the gateway to the Google IoT Core broker in order to attach a device to the gateway. After I did this everything is working perfectly.