This project allows an ESP8266 (ESP-12E) microcontroller to retrieve system performance metrics such as CPU and GPU temperatures and loads from the Open Hardware Monitor Web API and display them in real-time on a 16x2 I2C LCD. It's a lightweight and efficient solution for creating a hardware monitoring dashboard.
- Connects to a Wi-Fi network to retrieve hardware monitoring data from a web server.
- Parses JSON data from the Open Hardware Monitor API.
- Displays CPU and GPU temperatures and loads on a 16x2 I2C LCD screen.
- Automatically retries in case of Wi-Fi disconnection.
-
Hardware:
- ESP8266 (ESP-12E or compatible board)
- I2C 16x2 LCD Display
- Power source for the ESP8266
-
Software:
- Arduino IDE (with ESP8266 Board Package)
- Required Arduino Libraries:
ESP8266WiFi
Wire
LiquidCrystal_I2C
ArduinoJson
ESP8266HTTPClient
-
Open Hardware Monitor:
- Download and install Open Hardware Monitor.
- Enable the web server API in the software (default port:
8085
).
Connect the I2C LCD display to the ESP8266 as follows:
LCD Pin | ESP8266 Pin |
---|---|
VCC | VIN |
GND | GND |
SDA | D2 |
SCL | D1 |
- Clone or download this repository to your local machine.
- Open the
.ino
file in Arduino IDE. - Update the following placeholders in the code:
const char* ssid = ""; // Your Wi-Fi SSID const char* password = ""; // Your Wi-Fi Password const char* serverName = "http://192.168.0.104:8085/data.json"; // Replace with your Open Hardware Monitor server IP
- Install required libraries in the Arduino IDE:
- Go to Tools > Manage Libraries, search for each library name, and install it.
- Upload the code to your ESP8266 board.
- Start the Open Hardware Monitor application on your computer.
- Ensure the ESP8266 and the computer are on the same Wi-Fi network.
- Power up the ESP8266. It will:
- Connect to the Wi-Fi network.
- Fetch hardware data from the Open Hardware Monitor API every 2 seconds.
- Display CPU and GPU statistics on the LCD.
- Wi-Fi Credentials:
ssid
andpassword
. - API Server:
serverName
(URL to the Open Hardware Monitor data). - LCD Setup:
LiquidCrystal_I2C lcd
initializes the I2C LCD. - Fetch Timing:
fetchInterval
controls the API data fetch frequency.
setup()
:- Initializes the LCD and Wi-Fi connection.
- Displays IP address upon successful connection.
loop()
:- Periodically fetches data from the API.
fetchData()
:- Sends an HTTP GET request to the API server.
- Calls
parseAndDisplayData()
to process and display the response.
parseAndDisplayData()
:- Parses the JSON response and extracts CPU/GPU temperatures and loads.
- Displays data on the LCD.
reconnectWiFi()
:- Reconnects to Wi-Fi if the connection is lost.
getSubstring()
:- Extracts a substring up to a specific delimiter.
CPU: 55C° 40%
GPU: 60C° 70%
-
Wi-Fi Connection Issues:
- Verify SSID and password.
- Ensure the ESP8266 and computer are on the same network.
-
No Data on LCD:
- Check the Open Hardware Monitor web server status.
- Verify the API server IP in the code.
-
JSON Parsing Error:
- Confirm that the Open Hardware Monitor JSON structure matches the code.
This project is open-source and available under the MIT License. Feel free to modify and use it for personal projects.