Site Guide

Find your way around the Engineering Club.

Know what you need? Search for a component, concept or project.

Around the site

Start

Labs

TestingExperimental

Build

Club

LearnExperimental

Go a little deeper

Entry points to larger collections. Use Search for individual records.

Learning paths & reference

Inside PiCrawlerExperimental

Inside Inventory

ESP32 Wireless Display Dashboard / Stage 2 of 3

Validated incoming value

POST a bounded JSON value to /sample.

Firmware source authored · compile not attempted in this pass

Download stage 2 PlatformIO projectRead code & run steps ↓

What changes now?

POST a bounded JSON value to /sample.

Expected after hardware review: Accepted integer 0..1000 changes the display; invalid payloads are rejected.

Builds on stage 1: Local network diagnostic.

What you need

Check availability and exact module markings before starting.

Connections / current hardware gate

Before connecting power. Confirm the classic ESP32 target and SSD1309 carrier supply/pull-ups. The local access-point example does not establish campus-network access or deployment readiness.

  • Review the OLED module, address and electrical interface before power.
  • Use the actual address printed by the authored local access-point program after qualification.
  • Keep incoming values bounded and preserve invalid-payload and stale-data behavior.
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 / pinTo device / pinSignal / voltageConnection status and notes
2.42-inch SSD1309 128×64 OLED Display Module (I²C)
SDA
ELEGOO ESP-WROOM-32 development board
GPIO21
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 board
GPIO22
I2C SCL
3.3 V
Conditional reference

Use labeled GPIOs on classic ESP32; not the C6 onboard map.

display/peripheral
GND
controller
GND
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/peripheral
VCC
verified supply
Pin 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
  • product family verified · preflight required

    Compatibility and unresolved details
    • Headers/USB bridge: Exact carrier count and bridge unverified

Use this complete project

Target: esp32dev · Environment: checkpoint2 · Stage branch: DISPLAY_STAGE=2

  1. Open the complete project. Download the stage ZIP, extract it and open the folder containing platformio.ini and src in VS Code. Keep its supporting headers and libraries together.
  2. Build stage 2. Select checkpoint2 in PlatformIO Project Tasks → General → Build, or use a PlatformIO terminal:
    pio run -e checkpoint2
    A successful Build compiles the program; it does not upload it or approve electrical connections.
  3. 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 checkpoint2 -t upload

Open the matching Monitor at 115200 baud, then compare the expected result with what actually happens.

pio device monitor -b 115200

Record 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/esp32-wireless-dashboard/src/main.cpp

main.cpp
#include <Arduino.h>
#include <Wire.h>
#include <U8g2lib.h>
#include <DisplayCore.h>
#include "board_profile.h"
U8G2_SSD1309_128X64_NONAME2_F_HW_I2C oled(U8G2_R0,U8X8_PIN_NONE,22,21);
bool ready=false;uint32_t lastUpdate=0;
#include "network.h"
void setup(){Serial.begin(115200); if(!kElectricalReviewComplete){Serial.println("STOP: complete wiring/power review in guide before enabling hardware.");return;}Wire.begin(21,22);oled.setI2CAddress(kOledAddress7<<1);oled.begin();oled.setFont(u8g2_font_6x10_tf);beginNetwork();ready=true;}

 void loop(){if(!ready)return;pollNetwork();uint32_t now=millis();if(!displaylab::elapsed(now,lastUpdate,250))return;lastUpdate=now;oled.clearBuffer();oled.drawStr(0,10,"Local HTTP dashboard");oled.setCursor(0,28);
 #if DISPLAY_STAGE == 1
 oled.print("AP: see Serial IP");
 #else
 oled.print(networkFresh(now)?"Fresh ":"Stale ");oled.print(networkValue());
 #endif
 #if DISPLAY_STAGE >= 3
 oled.drawFrame(0,40,128,12);oled.drawBox(1,41,networkValue()*126/1000,10);
 #endif
 oled.sendBuffer();}
Source integrity · SHA-2564d7e0807d07a156c5c9e7f30607df6e4e8533e3a755edb2f94d580f43035eea2

Raw downloads and standalone ZIPs retain the canonical bytes and supporting files. Copy follows the selected Comments setting.

Check the result

Accepted integer 0..1000 changes the display; invalid payloads are rejected.

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
  1. Build the exact selected environment; distinguish dependency resolution from source compilation.
  2. Observe the stated output and record actual behavior; expected result is not an observed transcript.
  3. Test the named failure mode before proceeding.

Troubleshooting

Client cannot reach endpoint

Confirm it joined the ESP32 AP, use the printed local IP and inspect the request method/path. Mobile devices may try to leave a network without Internet.

400 or 413 response

Check JSON type/range/length. Quoted numbers and oversized bodies are intentionally rejected rather than coerced.

Display says stale

Send an accepted update and then intentionally stop. Distinguish absence of recent valid data from a broken OLED.

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

POST a bounded JSON value to /sample.

Open workspaces/esp32-wireless-dashboard in VS Code/PlatformIO. Select checkpoint2 and run pio run -e checkpoint2. This is FIRMWARE_SOURCE_AUTHORED with embedded compilation unverified. Review the electrical flag and canonical conditional wiring before any upload.

Understand it

network.cpp owns connectivity and server state. The handler rejects body lengths above sixty-four characters and parses into a bounded StaticJsonDocument. It accepts only an unsigned integer field in the specified range. Invalid requests do not refresh the last-success timestamp. The display continues to show the last value with a stale label after five seconds. The polling loop avoids an endless connection wait, but the synchronous WebServer library can still spend time handling clients; this baseline is not a hard-real-time or fully asynchronous guarantee.

Source review precision: All environments start the AP and accept the bounded /sample POST. Checkpoint1 draws the AP diagnostic; checkpoint2 draws value/freshness; checkpoint3 adds the bar. Five seconds after the last accepted message the value is stale. AP readiness alone does not prove a valid sample.

Expected result and verification

Accepted integer 0..1000 changes the display; invalid payloads are rejected.

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

Client cannot reach endpoint: Confirm it joined the ESP32 AP, use the printed local IP and inspect the request method/path. Mobile devices may try to leave a network without Internet.

400 or 413 response: Check JSON type/range/length. Quoted numbers and oversized bodies are intentionally rejected rather than coerced.

Display says stale: Send an accepted update and then intentionally stop. Distinguish absence of recent valid data from a broken OLED.

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