services | platforms | author |
---|---|---|
iot-hub |
Nodejs |
Juan Amezquita |
This repo contains the source code to help you get familiar with Azure IoT using the Microsoft IoT Pack for Raspberry Pi 3 Starter Kit. You will find the lesson-based tutorials on Azure.com.
Follow this page to enable SSH on your Pi.
Check your nodejs version on your Pi:
node -v
If your nodejs' version is below v4.x, please follow the instruction to install a new version of nodejs
curl -sL http://deb.nodesource.com/setup_4.x | sudo -E bash
sudo apt-get -y install nodejs
En el archivo config.json puede decidir si quiere datos simulados o va a utilziar un sensor
- Open the
config.json
file. - Change the
simulatedData
value fromfalse
totrue
.
Install all packages by the following command:
npm install
Run the client application with root priviledge, and you also need provide your Azure IoT hub device connection string, note your connection should be quoted in the command.
sudo node index.js