Search code examples
google-cloud-firestoregoogle-cloud-datastoreparticle-photon

Sending data from database to IoT device at certain intervals


What is the best (and simplest) way to regularly send data from a database to an IoT device at a certain interval?

In this case I have the data in Google Cloud Datastore, and want to send it to Particle Photons (possibly via Particle Cloud, but not necessarily). But I might also be using other IoT devices and/or other database alternative like Cloud Firestore for instance, in future, so it's great if the solution is easily adoptable to this situation.


Solution

  • Seems like you want some kind of a cron job that takes data from datastore (or any database for that matter) and sends it to your IoT device. Assuming your IoT can be reached via a REST end point, you can use Cloud Scheduler (https://cloud.google.com/scheduler/) and do the logic. The target to the cloud scheduler can be an app engine instance or a cloud function.