1

I'm sending IoT data from an OPC UA server to a pub/sub topic. Each single message to the topic includes 15 minutes of minute-by-minute data for about ~100 sensors. Dataflow reads from this pub/sub topic and performs a few joins and writes the output to another pub/sub topic. This data is then written to Timescale DB by a cloud function for display in a visualization application.

Lets say we're getting sensor data for Ambient_Temperature and we know that its value is in Fahrenheit. I'd like to execute some user defined javascript code that would, for example, perform a celsius conversion on the Ambient_Temperature sensor value, and write a "new" sensor called Ambient_Temperature_Celsius into Timescale.

I can certainly write a microservice on my own that the cloud function mentioned above could call that will safely execute the user defined javascript code and produce an output - but being rather unfamiliar with IoT stuff in Google Cloud land, I want to ask if there is a better way to accomplish this?

It seems that it would be pretty common IoT software vendors to allow users to run some math on their IoT data to create entirely new timeseries data.

1
  • I think you have the right idea here. Writing this logic as a Cloud Function would be the way to if you did not want to include such logic in your Dataflow pipeline.
    – Gari Singh
    Commented May 20, 2023 at 9:48

1 Answer 1

-2
You can use Google Cloud IoT Core to securely connect and manage IoT devices. Then, use the Node.js client library to interact with the Cloud IoT Core API and execute user-defined code on your IoT data. You can then write a microservice that the cloud function mentioned above could call that will safely execute the user defined javascript code and produce an output. Write the output to Timescale DB for display in a visualization application. Then deploy your Node.js service to Cloud Run which is a fully managed serverless platform that automatically scales your stateless containers.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.