From 2bfb34724d38e5f6faf5b659d3f4bb767554a85c Mon Sep 17 00:00:00 2001 From: Preston Hunter Date: Wed, 24 Dec 2025 00:24:55 -0500 Subject: [PATCH] docs: switch to ESP32-S3 and add logging server - Update HARDWARE.md to recommend ESP32-S3 over RP2040 to support Wi-Fi logging capabilities and better GPIO availability. - Initialize a Node.js Express server to receive and store test results from the hardware device. - Add a web-based dashboard to visualize HDMI pin status history, including basic pass/fail logic for voltage drops. --- HARDWARE.md | 10 +++---- server/index.js | 36 ++++++++++++++++++++++ server/public/index.html | 65 ++++++++++++++++++++++++++++++++++++++++ src/esp32_wifi.ino | 34 +++++++++++++++++++++ 4 files changed, 140 insertions(+), 5 deletions(-) create mode 100644 server/index.js create mode 100644 server/public/index.html create mode 100644 src/esp32_wifi.ino diff --git a/HARDWARE.md b/HARDWARE.md index a735be5..dbb342e 100644 --- a/HARDWARE.md +++ b/HARDWARE.md @@ -9,10 +9,10 @@ This project aims to create a handheld HDMI tester for console repair technician To measure diode mode (voltage drop across a diode junction), we need a microcontroller with an ADC and the ability to source a small constant current or use a pull-up resistor. -### 1. Microcontroller: ESP32 or Raspberry Pi Pico -- **ESP32**: Integrated Wi-Fi/BT (good for future logging), multiple ADCs. -- **RP2040 (Pico)**: Great documentation, dual-core, very affordable, stable ADCs. -- **Recommendation**: **Raspberry Pi Pico** for its simplicity and 3.3V logic which is safer for HDMI lines. +### 1. Microcontroller: ESP32 (S3 or DevKitV1) +- **ESP32**: Integrated Wi-Fi/BT is essential for the server-side logging feature. It has multiple ADCs and enough GPIOs to drive the multiplexers. +- **RP2040 (Pico W)**: Also an option, but ESP32 has better community support for async HTTP clients. +- **Recommendation**: **ESP32-S3** for its high number of GPIOs and built-in Wi-Fi. ### 2. Multiplexers (Mux) Since the Pico doesn't have 19 ADC pins, we need multiplexers to switch between the HDMI pins. @@ -39,5 +39,5 @@ Since the Pico doesn't have 19 ADC pins, we need multiplexers to switch between ## Next Steps 1. Define the Pinout mapping. -2. Create the software structure (C++ or MicroPython). +2. Create the software structure (C++ / Arduino with ESP32 WiFi libraries). 3. Implement the measurement logic. diff --git a/server/index.js b/server/index.js new file mode 100644 index 0000000..daf10c9 --- /dev/null +++ b/server/index.js @@ -0,0 +1,36 @@ +const express = require('express'); +const app = express(); +const port = 3000; + +app.use(express.json()); +app.use(express.static('public')); + +let testResults = []; + +// Endpoint for the HDMI Tester to upload results +app.post('/api/results', (req, res) => { + const { deviceId, mode, results } = req.body; + const testId = testResults.length + 1; + const timestamp = new Date().toISOString(); + + const newEntry = { + testId, + deviceId, + mode, + timestamp, + results + }; + + testResults.push(newEntry); + console.log(`Received test #${testId} from ${deviceId}`); + res.status(201).json({ status: 'success', testId }); +}); + +// Endpoint for the Web Interface to get all results +app.get('/api/results', (req, res) => { + res.json(testResults); +}); + +app.listen(port, () => { + console.log(`HDMI Tester Server running at http://localhost:${port}`); +}); diff --git a/server/public/index.html b/server/public/index.html new file mode 100644 index 0000000..275aa2c --- /dev/null +++ b/server/public/index.html @@ -0,0 +1,65 @@ + + + + + + HDMI Tester Dashboard + + + +

HDMI Tester History

+
Loading results...
+ + + + diff --git a/src/esp32_wifi.ino b/src/esp32_wifi.ino new file mode 100644 index 0000000..0973f54 --- /dev/null +++ b/src/esp32_wifi.ino @@ -0,0 +1,34 @@ +#include +#include +#include + +const char* ssid = "YOUR_WIFI_SSID"; +const char* password = "YOUR_WIFI_PASSWORD"; +const char* serverUrl = "http://YOUR_SERVER_IP:3000/api/results"; + +void sendResultsToServer(String mode, JsonArray results) { + if (WiFi.status() == WL_CONNECTED) { + HTTPClient http; + http.begin(serverUrl); + http.addHeader("Content-Type", "application/json"); + + StaticJsonDocument<2048> doc; + doc["deviceId"] = "HDMI_TESTER_01"; + doc["mode"] = mode; + doc["results"] = results; + + String requestBody; + serializeJson(doc, requestBody); + + int httpResponseCode = http.POST(requestBody); + + if (httpResponseCode > 0) { + Serial.print("HTTP Response code: "); + Serial.println(httpResponseCode); + } else { + Serial.print("Error code: "); + Serial.println(httpResponseCode); + } + http.end(); + } +}