IoT & Observability
Monitoring our world with Grafana
Dan Cech
Internet of Things
"IoT involves extending Internet connectivity to any range of traditionally dumb or non-internet-enabled physical devices and everyday objects."
Connected devices make it easy to connect, monitor & control your world!
In this workshop we'll explore how we can use Grafana together with the ESP32 platform to monitor our surroundings and visualize data over time.
ESP-what?
In 2014 Espressif Systems launched the ESP8266, an all-in-one chip with a 32-bit CPU and WiFi
It became hugely popular both with hobbyists and device manufacturers because of its capabilities and low per-unit cost.
It's also possible to program the ESP8266 with the Arduino IDE, and to use the huge Arduino library.
ESP32
In 2016, Espressif released the successor to the ESP8266, the ESP32:
This tiny chip is amazing, and with the ESP32 Arduino core it too can be programmed like an Arduino
What's in the bag?
If you only have USB-C, let us know and we have USB-C to USB-A adapters
So, what are we going to do with it?
Hardware
USB
Power
Signal
Hardware
Getting Started
CP210x Driver
Note: Only required if your OS doesn't recognize the USB Serial automatically
Download the Silicon Labs CP210x UART to USB Driver (URL in README)
https://www.silabs.com/products/development-tools/software/usb-to-uart-bridge-vcp-drivers
OSX: Unzip, open the .dmg image
Double click the .pkg and follow the prompts
When prompted you will have to open Security & Privacy and allow software from “Silicon Laboratories Inc”
The Arduino IDE
The ESP32 core
This open-source board definition adds�support in the Arduino IDE for programming�ESP32 boards.
https://github.com/espressif/arduino-esp32
The ESP32 Core (cont)
Open Boards Manager
Tools -> Boards: *
-> Board manager
Wait for it to update the list
Search for ESP32
Install version 1.0.1
Libraries
To read data from the DHT11 sensor we will use the libraries published by Adafruit
Adafruit DHT Sensor Library
Adafruit Unified Sensor Library
NTPClient Library
Download the project
Open the IoTWorkshop project in Arduino IDE
Let's walk through the sketch
void setup()
void loop()
The core of the system, this function is called in an endless loop, it:
Create TSDB & Grafana instance
Go to
and follow the instructions to get set up.
(If you already have a Hosted Metrics instance, feel free to use that)
config.h
This file contains the configuration for the project
config.h
How to get the Root CA cert:�https://techtutorialsx.com/2017/11/18/esp32-arduino-https-get-request/
Setting the board type
This tells the Arduino IDE which profile and base libraries to use when compiling the firmware image, and how to flash it to the board
The serial monitor
This allows us to see the debug output from the board, including the bootloader
Building and uploading the firmware
Use the Upload button in the UI to build and upload the firmware to the ESP32
The dashboard
Thanks!