- [To Support the Current Hardware] Open Arduino IDE & File Menu -> Go to Preferences Tab & update the "Additional Boards Manager URLs" to http://arduino.esp8266.com/stable/package_esp8266com_index.json.
- Install esp8266 from tools -> board manager
- Install the USB Driver for uploading file change board to node MCU 0.9 https://www.silabs.com/products/development-tools/software/usb-to-uart-bridge-vcp-drivers
- Select Tools -> Board(NodeMcu0.9) and then connect the Microcontroller and then select the Port(“COM3”)
- Test Blink code (FIles-> Example-> Basics-> Blink) and upload (upload – just to test)
Cheers! First MileStone is achieved. Your NodeMcu is working properly.
- Join MPU6050 pins with NodeMCU as following(P.S. Please verify your connecting before supplying power):
- VCC -> 3V3
- GND -> GND
- SCL -> D1
- SDA -> D2
- Clone the repository https://github.com/codeSG/BodyPostureCorrection
- Upload Module1 code and Check output at Serial Monitor.
Yippee! We are one more step ahead. Ready!!
- Install the below libraries in Arduino Under Tools -> Manage Libraries (kind of plug-ins):
- AzureIoTHub (Latest)
- AzureIoTUtility (Latest)
- AzureIoTProtocol_MQTT (Latest)
- ArduinoJson 5.0.8 [Please note the verson of Arduino JSON and downgrade if higher version is installed.]
- (N/A) Create an Iot Hub from Azure Portal
- (N/A) Create a new IoT device and Click on the created device and Notedown device primary connection string.
- Open Config.h file from Module2 code & update the below values:
- SSID Name of Wifi
- Password of Wifi
- Device ID (One uniquely chosen from shared Excel)
- Connection String (noted above from Excel for respective DeviceId)
- Download Device Explorer (FileName – “SetupDeviceExplorer.msi”) from https://aka.ms/aziotdevexp & install.
- (N/A) Open Azure Portal, go to <your_iot_hub(created)>->SharedAccessPolicy->iothubowner, and copy primary connection string(HostName=garagepos01.azure-devices.net;SharedAccessKeyName=iothubowner;SharedAccessKey=WIhMVLoMWfEfpcnaAT92PAnPbGIqRgdaRTLKeZzicLw=)
- Paste above connection string in Device Explorer and Monitor
- Make necessary changes in message.ino file from Module1.
Horrayyy!! You are ready to deploy your code.