Google iot core connection status

0 votes
I am using Google IOT core with mongoose os. I wanted to update device connection status to firestore. But i am unable to find event which reports mqtt connection status to pub/sub like when device disconnects or reconnect i.e if device is offline or not.

I am stuck on this problem for days.Any help will be appreciated
Jul 20, 2018 in IoT (Internet of Things) by Matt
• 2,270 points
1,547 views

1 answer to this question.

0 votes

There are a few values you can look at that are tracked in device configuration metadata that you could use to know when a device last was online:

  1. Last Configuration Send time - sent anytime your device connects / configuration is posted
  2. Last Event Time - Last time an event was sent from the device
  3. Last State Time - Last time state was sent from the device
  4. Last Heartbeat time - Last time MQTT heartbeat was sent

To get you started, here is an example using API explorer that you can fill-in with your project ID, region, registry, and device to query for a specific device's metadata.

For 1...3 you have control over these through device manager and by publishing data. MQTT heartbeat is updated if your device sends an MQTT_PINGREQ message during the "ping period" without other messages getting sent.

At any rate, you could use any of these update time values to see the last time a device was online / functioning. You could query the states of your devices after listing the devices in a registry and could update a Firebase RTDB periodically if that's how you want to report (e.g. using AppEngine TaskQueue). Note that you also just can get these "last connected" values from the Google Cloud Console.

It was said before but we don't have an event for disconnect, just configuration ack, which generally is the connection event. If you want to share state between a device and the device manager, use state messages.

answered Jul 20, 2018 by anonymous2
• 4,240 points

Related Questions In IoT (Internet of Things)

0 votes
1 answer

Iot core v1beta1 discovery api : Unable to access Google

You can try using version v1 since ...READ MORE

answered Feb 8, 2019 in IoT (Internet of Things) by Upasana
• 8,620 points
769 views
0 votes
1 answer

Display time in a Windows Core IoT app with a clock!

It is possible, but you should understand ...READ MORE

answered Jul 10, 2018 in IoT (Internet of Things) by nirvana
• 3,130 points
1,565 views
0 votes
1 answer

Deploy my Windows 10 IOT core application locally!

Of course, you, can! That is, in ...READ MORE

answered Jul 17, 2018 in IoT (Internet of Things) by nirvana
• 3,130 points
1,130 views
0 votes
0 answers

MQTT-Google Cloud pub/sub connection status!

Please help! So, I have a couple of ...READ MORE

Jul 20, 2018 in IoT (Internet of Things) by Bharani
• 4,660 points
846 views
0 votes
1 answer

MQTT broker for Google App Engine

You had a hard time finding anything ...READ MORE

answered Aug 1, 2018 in IoT (Internet of Things) by nirvana
• 3,130 points
1,553 views
0 votes
1 answer
+3 votes
2 answers
0 votes
1 answer

Server connection to iot device

It depends on the kind of socket, ...READ MORE

answered Oct 3, 2018 in IoT (Internet of Things) by anonymous2
• 4,240 points
1,586 views
0 votes
1 answer

Backing Up WIndows IoT Core

I think the tool you need here ...READ MORE

answered Oct 17, 2018 in IoT (Internet of Things) by anonymous2
• 4,240 points
737 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP