The purpose of this project is reading power consumption from refrigerators. This project uses an IoT Edge package to stream data from power sensors into an IoT Edge pipeline, process it and forward it to IoT Hub
Followed this Tutorial to create a Node.js BLE module to generate fridge readings from the UMass Trace Repository and to stream them to the IoT Edge.
The data used in the csv files follows the following format:
Timestamp | Refrigerator Power Usage (kW) |
---|---|
1/1/2016 0:00 | 0.132692222 |
- Deploy ARM Template
- Once deployed, open the newly created IoT Hub, go to Device Explorer, click Add and enter a deviceId (the name of each device in Gateway Config).
- Repeat for all devices.
- After all are created, go to each one and copy the primary key into the Gateway Config, replacing all the values resembling
<<DeviceKey1>>
. - Replace the value for
IoTHubName
with the name you chose for your IoT Hub.
- Open your new function app.
- Create a new function for
EventHubTrigger - Javascript
called IoTHubHandler - Click new next to Event Hub connection
- Click IoT hub, select your IoT hub name and the events endpoint and click select.
- Enter your IoT hub name in the Event Hub name field and click create.
- Open your new function app.
- Create a new function called IoTEdge
- Upload the folders:
data
,devices
and files:function.json
,gw.config.json
,index.js
andpackage.json
. - Navigate to the project Kudu console
- Run:
cd site\wwwroot\IoTEdge npm install
- Using the function url, start the function.
npm install
npm start