I use Google IoT Core in my project as MQTT broker to connect IoT embedded devices based on Atmel MCU to Goole Cloud Plattform.
In the plattform log, i experience many "MQTT DISCONNECT" errors.
jsonPayload: {
disconnectType: "SERVER"
eventType: "DISCONNECT"
protocol: "MQTT"
resourceName: "projects/xxxxxxx/locations/europe-west1/registries/xxxxxxxx/devices/1234567890"
serviceName: "cloudiot.googleapis.com"
status: {
code: 6
description: "ALREADY_EXISTS"
message: "SERVER: The connection was closed because there is another active connection with the same device ID."
}
}
labels: {
device_id: "d1234567890"
}
logName: "projects/xxxxxxxxx/logs/cloudiot.googleapis.com%2Fdevice_activity"
The error is generated when the device boots-up and connect to MQTT server. Despite this error, the connection is successful, as is the subscription to topics and message publishing.
I understand that the previous connection was not closed gracefully, but it is imbossible by the nature of the embedded device, that is meant to be always connected, and eventually turned off by disconnecting power supply (so it cannot send a disconnect message to server before).
The device ID is always the same at every reconnection, but unique per-device; i use chip serial number as in some Google's examples.
My question is, if there is a solution to this error, that can be ignored in developement phase, but would be unwanted behavior in the production environment.