Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Extract Telemetry Message Content and Respond With IOTCore Command to Device

a12
Bronze 1
Bronze 1

Hello,

I'm new to GCloud and am looking for a way to extract telemetry messages sent by devices to IOTCore, and in response send an IOTCore command to the device based on the message content.

I have Pub/Sub Topics set up which receive the messages. For example, I have:

{temp1: 32}

{temp2: 27}

{temp3: 25}

sent from the device to IOTCore. I want to be able to read the value of each topic and if it is above 30, send a command to the device:

{temp1: toohot}.

I've been researching for hours about cloud functions, dataflow, bigQuery, but I haven't found a clear way to do this. I don't mind which API is used, but the simpler the better.

Another feature I'll need in the near future is a line graph with each topic showing how its value has changed over time (i.e. temperature line graph showing the value over the past 7 days).

If anyone has some helpful links, sample functions or advice to help with these problems, it'd be much appreciated.

Regards,

a12

0 1 118
1 REPLY 1

For your current need I would suggest you to use Cloud Functions Pub/Sub Triggers. This allows you to trigger Cloud Function when there is a published message in Pub/Sub.

For the feature you’ll need later I would recommend you to use BigQuery, since this allows you to keep the data and export it to different services, that will allow you to do this graph.