I'm doing a small project where I'm using a Raspberry PI to monitor temperature and controlling a LED using Azure IOT Hub. The temperature is visualized through a dashboard portal, where you also can control the LED. I've read the documentation thoroughly but it I'm still unsure about a couple of things:
Remote Monitoring:
The Raspberry PI currently sends temperature to my IoT Hub (Device2Cloud), everything looks fine on that part. In order to display the values sent from the Raspberry PI I'm reading off the Event bus from my NodeJS backend, in the same manner as they do in this sample: https://github.com/Azure-Samples/web-apps-node-iot-hub-data-visualization/blob/master/IoThub/iot-hub.js
Is this correct way to read device to cloud messages?
Remote Controlling
This is the part I'm very unsure about, I would like to control the LED that's connected to the Raspberry PI through Cloud2Device communication in my dashboard page. I'm not quite sure how to implement this in my Node JS backend, and I really cant find any good examples where this has been done. Any advice would be appreciated.