This project implemented on the NodeMCU V2.0 (also known as V1.0) on the ESP8266, ESP-12E chip using the Arduino Firmware
Streams data in the following JSON formats
-
Maker Den. (MQTT Namespace gb/device/type)
{"Dev":"DeviceId","Geo":"2011","Type":"temp","Unit":"c","Val":[27.30,25848],"Utc":"2015-12-06T23:06:08","Id":84} {"Dev":"DeviceId","Geo":"2011","Type":"kPa","Unit":"kPa","Val":[101.00,25824],"Utc":"2015-12-06T23:06:19","Id":85} {"Dev":"DeviceId","Geo":"2011","Type":"light","Unit":"l","Val":[99.00,25840],"Utc":"2015-12-06T23:06:19","Id":86}
-
Azure IoT Hub Field Gateway. (MQTT Namespace iothub/#)
{"Dev":"DeviceId","Geo":"2011","Celsius":27,"hPa":1016,"Light":99,"Utc":"2015-12-06T23:07:04","Id":103}
##Physical Board
- NodeMCU v2 - Lua based ESP8266 development kit
- BMP180 Barometric Pressure Sensor
- Adafruit Mini 8x8 LED Matrix w/I2C Backpack
- 1 x Light Dependent Resistor
- 1 x 10k resistor
- On Windows, Mac and Linux you will need to install the latest CP210x USB to UART Bridge VCP Drivers.
- Arduino IDE 1.6.5 As at Dec, 2015, Arduino 1.6.6 has several issues, so to stick with 1.6.5
- As at Dec 2015, ESP8266 Board Manager 2.0.0 or better required.
##Arduino on ESP8266 Arduino on ESP8266 Project
Add NodeMCU to Arduino IDE
- Add Additional Board Manager URLs: File -> Preferences. Add http://arduino.esp8266.com/stable/package_esp8266com_index.json
- Restart Arduino IDE
- Add ESP8266 Board: Tools -> Board -> Board Manager -> Search ESP8266 -> Install
- Select NodeMUC Board: Tools -> Board -> NodeMCU 1.0 (ESP-12E module)
- Set Port and Upload Speed: Tools. Note, you may need to try different port speeds to sucessfully flash the device. Faster is better as each time you upload the code to the NodeMCU you are uploading the complete ROM not just your code.
##Project Files
- SetEEPROMConfiguration.ino - Set your Wi-Fi SSID and password (up to two can be specified - ground pin 7 to select the second Wi-Fi), plus the device id, MQTT server name, and geo location. Deploy this app to the NodeMCU to write configuration settings to EPROM
- MakerDenNodeMCU.ino - This is the main application, it will read configuration setting from the EPROM, manages sensor readings and publishing to MQTT
##Subscripting to MQTT Data
Install Mosquiotto client tools from the download page. Install Open SSL and PThread libraries as per set up instructions.
-
To subscribe to Maker Den data
mosquitto_sub.exe -h YourMqttServer -t gb/#
-
To subscribe to IoT Hub data
mosquitto_sub.exe -h YourMqttServer -t iothub/#
The IoT Dashboard allows you to visualise the data streamed to a MQTT service running in an Azure Virtual Machine.
You can install the IoT Dashboard from here. Note, you will need to allow to run from unknown publisher.