I'm trying to diagnose why my MQTT client is disconnecting from the Google Cloud Platform IoT Core. The device happily PINGREQing every 15 minutes as expected but occasionally the following error is thrown and the device disconnects for an amount of time. The time it's offline isn't always the same and neither is the duration.
{
"insertId": "r79rpxfdzvpw2",
"jsonPayload": {
"resourceName": "projects/<PROJECT-ID>/locations/asia-east1/registries/<REGISTRY>/devices/3172119418069326",
"eventType": "DISCONNECT",
"status": {
"code": 14,
"description": "UNAVAILABLE",
"message": "SERVER: The connection is closed because the server is shutting down."
},
"disconnectType": "SERVER",
"protocol": "MQTT",
"serviceName": "cloudiot.googleapis.com"
},
"resource": {
"type": "cloudiot_device",
"labels": {
"project_id": "<PROJECT-ID>",
"device_num_id": "3172119418069326",
"device_registry_id": "w<REGISTRY>",
"location": "asia-east1"
}
},
"timestamp": "2021-04-19T00:31:59.101631259Z",
"severity": "ERROR",
"labels": {
"device_id": "<DEVICE-ID>"
},
"logName": "projects/<PROJECT-ID>/logs/cloudiot.googleapis.com%2Fdevice_activity",
"receiveTimestamp": "2021-04-19T00:32:00.113014773Z"
}
Is there any documentation about this error and why it occurs? Is the device able to be notified of this event and reconnect immediately?
I haven't been able to find any information regarding this error.
Additional Info: The MQTT client is a ESP32, connecting to IoT Core with the Google Arduino JWT library (https://github.com/GoogleCloudPlatform/google-cloud-iot-arduino)