services | platforms | author |
---|---|---|
iot-hub, iot-suite |
Nodejs |
ZhijunZhao |
This sample repo accompanies Lesson 3: Send device-to-cloud messages lesson. It shows how to send messages from a Raspberry Pi 3 device to Azure IoT hub. It also demonstrates how to use an Azure function app to receive incoming IoT hub messages and persist them to Azure table storage.
See Lesson 3: Send device-to-cloud messages for more information.
app
sub-folder contains the sample Node.js application that sends device-2-cloud messages.arm-template.json
is the ARM template containing an Azure function app and a storage account.arm-template-param.json
file is the configuration file used by the ARM template.ReceiveDeviceMessages
sub-folder contains Node.js code for the Azure function.
Please follow the Lesson 3: Send device-to-cloud messages for detailed walkthrough of the steps below.
Install required npm packages on the host:
npm install
Create a JSON configuration file in the .iot-hub-getting-started
sub-folder of the current user's home directory:
gulp init
Install required tools/packages on the Raspberry Pi 3 device, deploy sample application, and run it on the device:
gulp install-tools
gulp deploy
gulp run
Run the sample application on the device and read messages persisted in the Azure storage:
gulp run --read-storage