Final Display Console / Stage 3 of 3
Persistent/network integration
Add local HTTP JSON input and NVS page persistence.
Firmware source authored · compile not attempted in this pass
Download stage 3 PlatformIO projectRead code & run steps ↓
What changes now?
Add local HTTP JSON input and NVS page persistence.
Expected after hardware review: Freshness and storage errors are visible; the chosen page survives reboot when persistence succeeds.
Builds on stage 2: Input and page model.
What you need
- 2.42-inch SSD1309 128×64 OLED Display Module (I²C)
- ELEGOO ESP-WROOM-32 development board
- Small tactile pushbutton
- DHT11 humidity-temperature module
Check availability and exact module markings before starting.
Connections / current hardware gate
Before connecting power. Qualify the SSD1309 carrier, DHT11 voltage and button wiring before integration. Network and NVS features are stage-specific; SD, RTC and touch are not baseline implementations.
- Establish the reviewed OLED/sensor and input baselines first.
- Keep the supplied multi-file layout and shared library intact when opening the complete project.
- Test each subsystem's errors separately after qualification; stage 2 intentionally has no network/NVS integration.
Conditional connection table and full module facts
Electrical review is incomplete. Conditional references require confirmation; unresolved pins or rails are not wiring instructions. Power off before changing connections.
| From device / pin | To device / pin | Signal / voltage | Connection status and notes |
|---|---|---|---|
2.42-inch SSD1309 128×64 OLED Display Module (I²C)SDA | ELEGOO ESP-WROOM-32 development boardGPIO21 | I2C SDA 3.3 V | Conditional reference Carrier supply/address and pull-up rail need confirmation; catalog establishes SSD1309 family only. |
2.42-inch SSD1309 128×64 OLED Display Module (I²C)SCL | ELEGOO ESP-WROOM-32 development boardGPIO22 | I2C SCL 3.3 V | Conditional reference Use labeled GPIOs on classic ESP32; not the C6 onboard map. |
DHT11 humidity-temperature moduleverified DATA label | ELEGOO ESP-WROOM-32 development boardGPIO26 | DHT11 digital data 3.3 V | Conditional reference Choose a compatible module supply and data pull-up; do not apply 5 V DATA to ESP32. |
Small tactile pushbuttoncontact side A | ELEGOO ESP-WROOM-32 development boardGPIO27 | Active-low button 3.3 V | Conditional reference Other contact side to GND; INPUT_PULLUP. |
display/peripheralGND | controllerGND | Signal reference 0 V | Conditional reference Unpowered wiring check; use correct common-ground topology and keep high-current panel returns out of thin signal paths. |
display/peripheralVCC | verified supplyPin unresolved | Peripheral power Voltage unresolved | Conditional reference Supply voltage/current unknown at carrier level until reviewed; no assumed 5 V or 3.3 V instruction. |
Access describes the source of a requirement. Check availability, the exact revision and the complete power/driver/harness system before starting. Inventory quantities are expected purchase/BOM quantities, not live stock.
controller verified · preflight required
Compatibility and unresolved details
- Controller: SSD1309
- Resolution: 128 × 64
- Diagonal: 2.42 inches
- Interface: I²C, four-pin version
- Emission color: Variant-dependent / not tracked; requested yellow
- Carrier voltage/address: Not established; verify actual module
- ELEGOO ESP-WROOM-32 development boardClub-owned
product family verified · preflight required
Compatibility and unresolved details
- Headers/USB bridge: Exact carrier count and bridge unverified
- Small tactile pushbuttonClub-owned
product family verified · preflight required
Compatibility and unresolved details
- Contact/header current rating: Unverified; use as signal input
- DHT11 humidity-temperature moduleClub-owned
product family verified · preflight required
Use this complete project
Target: esp32dev · Environment: checkpoint3 · Stage branch: DISPLAY_STAGE=3
- Open the complete project. Download the stage ZIP, extract it and open the folder containing
platformio.iniandsrcin VS Code. Keep its supporting headers and libraries together. - Build stage 3. Select
checkpoint3in PlatformIO Project Tasks → General → Build, or use a PlatformIO terminal:
A successful Build compiles the program; it does not upload it or approve electrical connections.pio run -e checkpoint3 - Stop at the hardware gate. The supplied electrical-review flag remains false. Have a qualified reviewer complete the actual module, wiring and power checks before using an approved configuration for hardware operation.
As supplied, Serial at 115200 baud reports
STOP: complete wiring/power review in guide before enabling hardware.and initialization stops.
After electrical review: Upload and Monitor
Only with the actual setup reviewed and the configuration explicitly approved, choose this stage's Upload task. Close any monitor using the board first.
pio run -e checkpoint3 -t uploadOpen the matching Monitor at 115200 baud, then compare the expected result with what actually happens.
pio device monitor -b 115200Record Build, Upload and physical observations separately.
Complete source
The viewer starts at src/main.cpp. Use Source file for the board profile, PlatformIO configuration and supporting code. Keep the complete ZIP together.
workspaces/final-console/src/main.cpp
#include <Arduino.h>
#include <DisplayCore.h>
#include "board_profile.h"
#include "display.h"
#include "sensors.h"
#include "ui.h"
#include "network.h"
#include "storage.h"
bool ready=false,storageOk=false;uint32_t drawn=0;
void setup(){Serial.begin(115200); if(!kElectricalReviewComplete){Serial.println("STOP: complete wiring/power review in guide before enabling hardware.");return;}beginDisplay();beginSensors();
#if DISPLAY_STAGE >= 3
storageOk=beginStorage();beginUi(loadPage());beginNetwork();
#else
beginUi(0);
#endif
ready=true;}
void loop(){if(!ready)return;uint32_t now=millis();pollSensors(now);const bool changed=pollUi(now);
#if DISPLAY_STAGE >= 3
pollNetwork();if(changed)storageOk=savePage(page());
#endif
if(!changed&&!displaylab::elapsed(now,drawn,250))return;drawn=now;
#if DISPLAY_STAGE == 1
drawConsole(0,reading(),false,0,false);
#elif DISPLAY_STAGE == 2
drawConsole(page(),reading(),false,0,false);
#else
drawConsole(page(),reading(),networkFresh(now),networkValue(),storageOk);
#endif
}
Source integrity · SHA-256
5911cd8f34e79875ea610dd326152918ddcb9d09bbde711c6bec17a2ecf55152Raw downloads and standalone ZIPs retain the canonical bytes and supporting files. Copy follows the selected Comments setting.
Check the result
Freshness and storage errors are visible; the chosen page survives reboot when persistence succeeds.
As supplied, the false electrical-review flag prevents this hardware result. After qualified review, record what actually happens; the text above is an expected result, not a bench transcript.
Original verification checklist
- Resolve the exact vendor driver/source/version/license.
- Review actual carrier power and pins.
- Author and compile the physical target before upload and bench testing.
Troubleshooting
Complete device shows sensor error
Return to the raw DHT checkpoint and identify pin/type/polling failure. Do not debug the whole network/UI stack at once.
Page not restored
Check NVS begin/write results and stored enum range. Distinguish a failed save from a wrong displayed page.
Stale value appears current
Inspect the last accepted request time. Invalid requests, render cycles and a running AP must not refresh measurement freshness.
Technical explanation / original guide
Read the complete original stage guide
Original source/research wording is preserved. The stage's dated build evidence above supersedes earlier blanket compile-status wording; no physical results are implied.
Build it
Add local HTTP JSON input and NVS page persistence.
Open workspaces/final-console in VS Code/PlatformIO. Select checkpoint3 and run pio run -e checkpoint3. This is FIRMWARE_SOURCE_AUTHORED with embedded compilation unverified. Review the electrical flag and canonical conditional wiring before any upload.
Understand it
main coordinates display, sensors, ui, network and storage modules. Each has a narrow header contract and owns its internal state. Sensor polling at two seconds is independent from 250 ms drawing and per-loop input/server work. Validity and freshness remain distinct. Preferences opens a named NVS namespace, validates the stored page domain and checks write results. Saves happen after a page change rather than every loop, limiting pointless repeated writes. This still needs a wear policy for a product with extremely frequent changes.
Source review precision: Checkpoint1 always renders the Environment page, though input polling still runs. Checkpoint2 exposes three pages while network and NVS initialization remain disabled: the network is stale with value zero and the diagnostic reports NVS unavailable. Checkpoint3 adds the actual AP/server and NVS page restoration/writes. No SD logging or touch driver is part of this baseline.
Expected result and verification
Freshness and storage errors are visible; the chosen page survives reboot when persistence succeeds.
This is expected after a correct build and electrical review, not a captured bench transcript.
Check the selected source branch and named failure conditions. Record actual build or software output separately from future physical observations.
Likely failures
Complete device shows sensor error: Return to the raw DHT checkpoint and identify pin/type/polling failure. Do not debug the whole network/UI stack at once.
Page not restored: Check NVS begin/write results and stored enum range. Distinguish a failed save from a wrong displayed page.
Stale value appears current: Inspect the last accepted request time. Invalid requests, render cycles and a running AP must not refresh measurement freshness.
Build evidence, target and remaining verification
Original status: unverified.
No successful build for this stage is recorded in the dated embedded compile ledger.
No compile was attempted in this pass under the user's testing limit. Upload and physical bench observation remain untested.
espressif32@6.12.0 · arduino
Diagnostics before integration
- OLED border/corner profile fixture Environment: checkpoint1
- Debounced press monitor Environment: checkpoint1
- AP/network diagnostic Environment: checkpoint1
- Optional disposable write/read path, not capstone baseline
Optional separate diagnostic; review its carrier and disposable test-file constraints.
Environment: esp32-sd