Google Cloud IOT- Device Configuration via Firebase/cloud functions?

Internet of Things IoT Frameworks 2 years ago

0 1 0 0 0 tuteeHUB earn credit +10 pts

5 Star Rating 1 Rating
_x000D_ _x000D_ I have been able to successfully receive state and telemetry from my iot device using mqtt->pubsub->firebase functions->FCM to an android app. My iot device is also registered to receive the config callback, and it successfully receives the current config mqtt message when the device connects. Now, I would like to be able to use my android app to initiate a config message to send a run/stop command. I had thought I could accomplish this via an android api call or from within a cloud function. There don't seem to be any examples on the web for this. This example appears to be intended to run on a 3rd party node.js server rather than from inside a cloud function or an android app: https://github.com/GoogleCloudPlatform/nodejs-docs-samples/blob/master/iot/manager/manager.js#L865 From within the cloud function it was very easy to use admin.firestore() and admin.messaging() to call functions and accomplish what I needed. However the IOT API's don't appear to work the same way. I'm clearly missing something. So in short- How can I initiate an IOT config message from android or a cloud function? It would be great if I could access the other registry management functions as well. Thanks in advance for any help.

Posted on 16 Aug 2022, this text provides information on IoT Frameworks related to Internet of Things. Please note that while accuracy is prioritized, the data presented might not be entirely correct or up-to-date. This information is offered for general knowledge and informational purposes only, and should not be considered as a substitute for professional advice.

Take Quiz To Earn Credits!

Turn Your Knowledge into Earnings.

tuteehub_quiz

Answers (1)

Post Answer
profilepic.png
manpreet Tuteehub forum best answer Best Answer 2 years ago
_x000D_ You should be able to call a cloud function from the android app and then have that integrate with the IOT api's - you could also have the android client call the rest api's https://cloud.google.com/iot/docs/reference/rest/ DeviceManager also has a JAVA interface: https://cloud.google.com/iot/docs/samples/device-manager-samples

No matter what stage you're at in your education or career, TuteeHub will help you reach the next level that you're aiming for. Simply,Choose a subject/topic and get started in self-paced practice sessions to improve your knowledge and scores.

Important Internet of Things Links