{"id":45147055,"url":"https://github.com/dbryant4/esp32-lcd","last_synced_at":"2026-02-20T02:01:22.041Z","repository":{"id":339417283,"uuid":"1161799687","full_name":"dbryant4/esp32-lcd","owner":"dbryant4","description":"Arduino sketches for ESP32 with JC4827W543 LCD (LVGL v9) and BME280 I2C scanner.","archived":false,"fork":false,"pushed_at":"2026-02-19T18:35:32.000Z","size":45,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-02-19T19:15:16.931Z","etag":null,"topics":["arduino","bme280","dashboard","esp32","i2c","lcd","lvgl"],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dbryant4.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-02-19T14:32:02.000Z","updated_at":"2026-02-19T15:38:58.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/dbryant4/esp32-lcd","commit_stats":null,"previous_names":["dbryant4/esp32-lcd"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/dbryant4/esp32-lcd","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dbryant4%2Fesp32-lcd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dbryant4%2Fesp32-lcd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dbryant4%2Fesp32-lcd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dbryant4%2Fesp32-lcd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dbryant4","download_url":"https://codeload.github.com/dbryant4/esp32-lcd/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dbryant4%2Fesp32-lcd/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29638772,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-19T22:32:43.237Z","status":"online","status_checked_at":"2026-02-20T02:00:07.535Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["arduino","bme280","dashboard","esp32","i2c","lcd","lvgl"],"created_at":"2026-02-20T02:01:21.232Z","updated_at":"2026-02-20T02:01:22.017Z","avatar_url":"https://github.com/dbryant4.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ESP32 LCD Arduino Sketches\n\nThis repo is intentionally cleaned down to the two active Arduino sketches:\n\n- `arduino/JC4827W543_LVGLv9/JC4827W543_LVGLv9.ino`\n- `arduino/I2C_Pin_Scanner_BME280/I2C_Pin_Scanner_BME280.ino`\n\n## Table of Contents\n\n- [Structure](#structure)\n- [Firmware Dashboard Sketch](#firmware-dashboard-sketch)\n- [Flashing from Release](#flashing-from-release)\n- [Wi-Fi Provisioning (ESPHome-Style)](#wi-fi-provisioning-esphome-style)\n- [Web UI and API](#web-ui-and-api)\n- [Historical Data Storage](#historical-data-storage)\n- [Firmware Versioning](#firmware-versioning)\n- [I2C Scanner Sketch](#i2c-scanner-sketch)\n\n## Structure\n\n- `arduino/JC4827W543_LVGLv9/` - main LVGL dashboard firmware\n- `arduino/JC4827W543_LVGLv9/data/` - portal HTML/JS (SPIFFS)\n- `arduino/I2C_Pin_Scanner_BME280/` - I2C/BME280 scanner firmware\n- `scripts/fw-arduino.sh` - build/upload script for dashboard sketch\n- `scripts/upload-portal-data.sh` - upload portal files to SPIFFS\n- `scripts/scan-i2c-pins.sh` - build/upload/monitor script for scanner sketch\n- `scripts/version.sh` - semantic version management helper\n\n## Firmware Dashboard Sketch\n\nUses ESP32S3 `huge_app` partition scheme via `scripts/fw-arduino.sh` so larger firmware images can compile/upload.\n\n```bash\n# install toolchain + libraries\n./scripts/fw-arduino.sh deps\n\n# build\n./scripts/fw-arduino.sh build\n\n# build + upload\n./scripts/fw-arduino.sh upload --port /dev/cu.usbmodem101\n```\n\n## Flashing from Release\n\nPre-built firmware binaries are attached to [GitHub Releases](https://github.com/derrickbryant/esp32-lcd/releases). To flash without building from source:\n\n1. **Download the .bin file** from the latest release (e.g. `JC4827W543_LVGLv9-1.2.1.bin`).\n\n2. **Install esptool** (if needed):\n   ```bash\n   pip install esptool\n   ```\n\n3. **Flash the firmware** (replace `PORT` with your device, e.g. `/dev/cu.usbmodem101` on macOS):\n   ```bash\n   esptool.py --chip esp32s3 -p PORT write_flash 0x0 JC4827W543_LVGLv9-1.2.1.bin\n   ```\n\n4. **Reset the device** — it will boot into the new firmware.\n\n## Wi-Fi Provisioning (ESPHome-Style)\n\nThe dashboard sketch now provisions Wi-Fi with an ESPHome-style recovery flow:\n\n- Saved STA credentials are loaded from ESP32 `Preferences` (NVS) on boot.\n- If no credentials exist or STA connect times out, the device starts a fallback AP.\n- Fallback AP defaults:\n  - SSID: `ESP32LCD-\u003cchipid\u003e`\n  - Password: random easy-to-type words plus 2 digits (example: `maple-river-42`)\n  - Captive portal + provisioning page: `http://192.168.4.1`\n- Submitting credentials in the portal stores them in NVS and immediately retries STA mode.\n- In AP mode, AP SSID/password/portal address are shown on the debug screen.\n- When connected to STA Wi-Fi, time is synced via NTP and shown on the main screen.\n\nValidation checklist:\n\n1. Flash firmware and open Serial Monitor at `115200`.\n2. On first boot, confirm logs indicate AP provisioning mode.\n3. Connect to the fallback AP and submit router credentials at `http://192.168.4.1`.\n4. Confirm device reconnects in STA mode and logs local IP.\n5. Reboot and verify the device reconnects without entering AP mode.\n6. Power off router/AP temporarily and confirm reconnect or fallback behavior without UI lockups.\n\n## Web UI and API\n\nThe portal (HTML/JS) is served from SPIFFS. After flashing firmware, upload the portal data:\n\n```bash\n./scripts/upload-portal-data.sh --port /dev/cu.usbmodem101\n```\n\nWhen connected (STA or AP mode), the web UI at `http://\u003cdevice-ip\u003e/` has two pages:\n\n- **Status** (default): Live readings (refreshed every 5 seconds), 7-day history chart (temp, humidity, pressure), history table, and CSV download link\n- **Settings**: Wi-Fi provisioning, timezone, and brightness controls\n\n**API endpoints** (JSON):\n\n- `GET /api/readings` — Current sensor values (temp_c, temp_f, humidity_pct, pressure_hpa, timestamp, valid)\n- `GET /api/history` — 7-day history; `?res=5min` (2016 pts), `?res=15min` (672), `?res=30min` (336), `?res=hourly` (168)\n- `GET /api/status` — Settings plus current readings\n- `GET /history.csv` — Download full 7-day history as CSV\n\nHistory is stored at 5-minute resolution with NTP timestamps. Gaps (device off) are marked with `valid: false` in the API and omitted from the CSV.\n\n## Historical Data Storage\n\nHistorical sensor data is stored entirely on the ESP32:\n\n- **RAM (ring buffer)**: 2016 slots in a circular buffer (~20 KB). Each slot holds: Unix timestamp, temperature (0.1°C), humidity (%), pressure (hPa), and a valid flag. Data is written every 5 minutes as an average of the 1-second BME280 readings.\n- **Flash (NVS)**: The ring buffer is persisted to non-volatile storage (Preferences namespace `history`) every 30 minutes. On boot, the buffer is restored so history survives power cycles.\n- **Gap handling**: When the device was off, missed 5-minute intervals are filled with gap entries (`valid: false`) so the timeline stays correct. Gaps are not written to the CSV download.\n- **Resolution**: 7 days at 5-minute intervals (12 samples/hour × 24 hours × 7 days = 2016 slots).\n\n## Firmware Versioning\n\n- Semantic version source of truth is in `arduino/JC4827W543_LVGLv9/JC4827W543_LVGLv9.ino`:\n  - `FW_VERSION_MAJOR`\n  - `FW_VERSION_MINOR`\n  - `FW_VERSION_PATCH`\n- Current version: `1.2.0`.\n- The debug screen shows `Firmware: v\u003cmajor.minor.patch\u003e`.\n\n```bash\n# print current version\n./scripts/version.sh show\n\n# set explicit version\n./scripts/version.sh set 1.1.0\n\n# bump semantic part\n./scripts/version.sh bump patch\n./scripts/version.sh bump minor\n./scripts/version.sh bump major\n\n# chat workflow helper: minor++, patch=0\n./scripts/version.sh new-chat\n```\n\n## I2C Scanner Sketch\n\n```bash\n# build + upload scanner\n./scripts/scan-i2c-pins.sh upload --port /dev/cu.usbmodem101\n\n# monitor scanner output\n./scripts/scan-i2c-pins.sh monitor --port /dev/cu.usbmodem101\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdbryant4%2Fesp32-lcd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdbryant4%2Fesp32-lcd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdbryant4%2Fesp32-lcd/lists"}