- Arduino library that serves a web UI (assets hosted at
https://thelastoutpostworkshop.github.io/microcontroller_devkit/gpio_viewer_1_5/) to monitor GPIO, PWM, ADC, heap, and PSRAM data from ESP32 boards via Async WebServer + Server-Sent Events. - ESP32 Arduino core v3+ is required; older cores intentionally
#error. Library release string lives insrc/gpio_viewer.h(release) andlibrary.properties(version).
src/gpio_viewer.h: Entire library implementation. Sets up AsyncWebServer +/events, trapsledc*andpinModecalls via macros to detect PWM/pin modes, reads ADC/touch capabilities (unlessNO_PIN_FUNCTIONSis defined), and builds the minimal HTML shim pointing to hosted assets.gpio_viewer.ino: Dev/test sketch that exercises GPIO/PWM/analog tasks; usessecrets.hfor WiFi creds.examples/gpioviewer/gpioviewer.ino: Minimal usage example expected to ship with the library (keep includes/comments aligned with README).examples/platformio: PlatformIO example (platformio.ini,src/main.cpp) showing library usage.sketch.yaml: Arduino CLI profiles (next_release,user_setup,example) for compile/upload.- Generated/ephemeral:
build/outputs (bins, map, compile_commands),.vscode/configs; leave untouched unless intentionally regenerating locally.
- Arduino CLI (preferred for quick compile): from repo root
arduino-cli compile --profile next_release(usessketch.yaml). Use--profile exampleto validate the shipped example. Upload witharduino-cli upload --profile <profile>after confirming theportinsketch.yaml. - PlatformIO example:
cd examples/platformio && pio runorpio run -t upload(adjustdefault_envs/board if needed). - Dependencies are pulled by the toolchains: ESPAsyncWebServer >=3.9.4, AsyncTCP >=3.4.10, SimpleRotary for the dev sketch. Ensure ESP32 core v3.x is installed.
- Users must include
<gpio_viewer.h>first so the macro wrappers forpinMode/ledcAttach*hook correctly; changing this breaks pin tracking. - WiFi mode must be
WIFI_STA; AP/AP_STA are explicitly unsupported.connectToWifionly handles STA. - SSE endpoints and event names are coupled to the hosted UI:
/eventsstream events namedgpio-state,free_heap, andfree_psram; REST endpoints/release,/sampling,/free_psram,/espinfo,/partition,/pinmodes, and/pinfunctionsmust remain stable unless you also update the frontend. NO_PIN_FUNCTIONScan be defined before the include to disable ADC/touch detection for boards where function probing causes issues.- Default HTTP port is
8080;setPortallows override. Sampling interval defaults to100ms(setSamplingIntervalto change). - If adding features that affect assets, update
baseURLinsrc/gpio_viewer.hto point at the correct hosted bundle or add bundling logic. - Keep
releasestring andlibrary.propertiesversion in sync when cutting releases.
- No automated tests. Do a compile check (
arduino-cli compile --profile next_release) before shipping changes. For library-facing changes, also build the shipped example (--profile example) and optionally flash to confirm runtime behaviour.
secrets.h(WiFi credentials) is.gitignored; do not expose or commit its contents. PlatformIO example uses_secrets.has a template.- Avoid committing
build/artifacts or.vscode/configs; they are local/editor outputs.