Skip to content

Add OLED 72x40 usermod to Community Usermods - #398

Open
doccaz wants to merge 1 commit into
wled:mainfrom
doccaz:add-oled-72x40-usermod
Open

doccaz wants to merge 1 commit into
wled:mainfrom
doccaz:add-oled-72x40-usermod

Conversation

@doccaz

@doccaz doccaz commented Nov 24, 2026 •

Copy link
Copy Markdown

Adds the OLED 72x40 usermod to the Community Usermods index.

It drives the 0.42" 72x40 OLED built into the ESP32-C3 Super Mini. It shows a dashboard with the current effect, a brightness graph and speed/intensity/brightness, a splash screen with the device name or IP, and a configurable sleep timer. It also has a heartbeat LED and 180° flip support.

This was originally proposed in-tree as wled/WLED#5475. The reviewers suggested it fit better as an out-of-tree usermod because it needs specific hardware to test, so it now lives in its own repo. It is tagged wled-usermod, is EUPL-1.2, and builds against current main in CI.

Repo: https://github.com/doccaz/wled-usermod-oled-72x40

The code was tested on hardware (ESP32-C3 Super Mini, WLED 16.0.x) during the in-tree review.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Documentation
    • Added OLED 72x40 to the community usermod index, with a repository link and details about its features, license, and tested WLED version.

@doccaz

doccaz commented Nov 24, 2026

Copy link
Copy Markdown
Author

@coderabbitai please perform an external usermod code inspection for this PR.
Include the inspected revision, files inspected, findings, and coverage limits in your reply.

@coderabbitai

coderabbitai Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The community usermod index adds OLED 72x40, with a repository link and details about its dashboard, features, platform, license, and tested WLED version.

Changes

Community usermod index

Layer / File(s) Summary
Add OLED 72x40 entry
docs/advanced/community-usermods.md
The index adds OLED 72x40 and documents its ESP32-C3 Super Mini dashboard, features, EUPL-1.2 license, and WLED 16.0.x testing note.

Estimated code review effort: 1 (Trivial) | ~3 minutes

Change: Other

Possibly related PRs

  • wled/WLED-Docs#372: Updates the structure and contribution format of the same community usermods index.

Suggested reviewers: willmmiles, softhack007

Merge Risk: Minimal · up to 99e47

This adds a documentation index entry for a community usermod. It has no runtime impact and is ready to merge.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title "Add OLED 72x40 usermod to Community Usermods" matches the changeset. The only change is one added entry in docs/advanced/community-usermods.md for the OLED 72x40 usermod, so the title names…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title "Add OLED 72x40 usermod to Community Usermods" matches the changeset. The only change is one added entry in docs/advanced/community-usermods.md for the OLED 72x40 usermod, so the title names the main change directly.

Finishing Touches

Simplify code

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

A rabbit found a screen aglow,
With OLED details set in rows.
A dashboard shines on ESP32,
Its features listed clearly too.
A license and test note join the page,
The bunny hops off, pleased with the change.

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: wled/WLED-Docs
  • Branch: main
  • File: .coderabbit.yaml
  • Commit: 25e6c73
  • Layers: Repository YAML (base), Repository UI (inherited), Organization UI (inherited)
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 4760ffb4-4c87-45a8-9840-054aabc5b26d
Commits

Reviewing files that changed from the base of the PR and between 25e6c73 and 99e479d.

Files selected for processing: 1

  • docs/advanced/community-usermods.md

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 1 remain after this review.

Recent review details

Context from checks skipped due to timeout: 1

  • GitHub Check: CodeRabbit
Additional context used

Code guidelines: 1

AGENTS.md — configured
Path-based instructions: 4

For each newly added usermod or changed repository link: Validate the index entry against public repository information.

CodeRabbit configuration file

Files:

  • docs/advanced/community-usermods.md
Review against the writing style guidelines, markdown/page style conventions, and checklists provided in `AGENTS.md`.

CodeRabbit configuration file

Files:

  • docs/advanced/community-usermods.md
Source excerpt: Every documentation page must begin with a YAML front matter block: Source excerpt: `title` is required and must match the nav entry in `mkdocs.yml`.

CodeRabbit inference engine (AGENTS.md)

Files:

  • docs/advanced/community-usermods.md
Source excerpt: [ ] Changes are limited to documentation.

CodeRabbit inference engine (AGENTS.md)

Files:

  • docs/advanced/community-usermods.md
Learnings: 3

Common learnings

Learnt from: softhack007
Repo: wled/WLED-Docs PR: 0
File: :0-0
Timestamp: 2026-10-14T11:09:30.597Z
Learning: In wled/WLED-Docs issue #382, softhack007 reported that `coderabbit full review` did not post an external usermod source-inspection summary as a PR comment after path instructions were configured for docs/advanced/community-usermods.md. The cause is unconfirmed; do not attribute it to platform limitations as an established fact. Maintainers can explicitly request an inspection with a top-level PR comment: `coderabbitai please perform an external usermod code inspection for this PR.` An earlier explicit chat request in issue #382 produced a pinned external-source inspection report through the GitHub API; this does not guarantee equivalent automatic PR-review behavior.
Learnt from: softhack007
Repo: wled/WLED-Docs PR: 0
File: :0-0
Timestamp: 2026-05-01T12:26:45.821Z
Learning: In wled/WLED-Docs and WLED-related repositories, "usermod" (plural: "usermods") is the correct and intentional project-specific terminology. It refers to user-contributed addons to the WLED core, maintained by individual contributors (written in C++, with individual library.json). Usermods can be in-tree (part of the WLED repository) or out-of-tree (a feature introduced since release 16.0.0). Do NOT flag "usermod" or "usermods" as a spelling error or suggest alternative spellings.
Learning: 2026-10-26T21:09:37.034Z

Learnt from: CR
Repo: wled/WLED-Docs PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-10-26T21:09:37.034Z
Learning: Applies to docs/** : Source excerpt:
# AGENTS.md

## PR Review Checklist

### Scope

- [ ] Changes are limited to documentation. This repository does not contain WLED firmware code.

Applied to files:

  • docs/advanced/community-usermods.md
Learning: 2026-05-12T21:38:22.698Z

Learnt from: softhack007
Repo: wled/WLED-Docs PR: 292
File: docs/basics/compatible-controllers.md:125-125
Timestamp: 2026-05-12T21:38:22.698Z
Learning: When reviewing Markdown GFM tables in this repository, only flag a pipe style issue (missing leading and/or trailing pipe characters on a data row) if the existing, unchanged data rows in that same table already use leading/trailing pipes. If the existing (unchanged) data rows consistently omit leading/trailing pipes, then a newly added/changed data row that also omits leading/trailing pipes should be treated as acceptable and not flagged.

Applied to files:

  • docs/advanced/community-usermods.md
LanguageTool

docs/advanced/community-usermods.md

[style] ~39-~39: This sentence may be long and difficult for your reader to follow. Consider inserting a period and starting a new sentence here.
Context: ...Mini's built-in 0.42" 72x40 SSD1306 OLED, with heartbeat LED, flip support and a sleep timer | @docc...

(WITH_THE_SENTENCE)

Additional comments: 1

docs/advanced/community-usermods.md: 1

39-39: Functional Correctness

The index row's "Tested on WLED 16.0.x" accurately describes the hardware test. It does not state a build limit, so it needs no version-range change based on the inspected evidence.

The concern depends on a v17 build failure. The CI workflow builds against WLED main, but no CI run result was inspected, and the reported Network symbol rename was not confirmed in the usermod source or in WLED main. Without that failure, the row contains no unsupported version claim to correct.

@coderabbitai

coderabbitai Bot commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

Tip

For best results, initiate chat on the files or code changes.

Analysis chain

Script executed:

#!/bin/bash
set -u
echo '=== External usermod repository metadata ==='
curl -fsSL https://api.github.com/repos/doccaz/wled-usermod-oled-72x40 | jq '{full_name, default_branch, description, license, pushed_at}'
echo '=== External usermod HEAD and recursive tree ==='
curl -fsSL https://api.github.com/repos/doccaz/wled-usermod-oled-72x40/commits/HEAD | jq '{sha, commit: {message: .commit.message, date: .commit.committer.date}}'
curl -fsSL 'https://api.github.com/repos/doccaz/wled-usermod-oled-72x40/git/trees/HEAD?recursive=1' | jq '{sha, truncated, tree: [.tree[] | {path, type, size}]}'
echo '=== Docs guidance files ==='
fd -HI '^(AGENTS\.md|community-usermods\.md|custom-features\.md)$' . | sort
for f in $(fd -HI '^(AGENTS\.md|community-usermods\.md|custom-features\.md)$' .); do
  echo "=== $f ==="
  cat -n "$f"
done
echo '=== WLED firmware usermod guidance ==='
curl -fsSL https://raw.githubusercontent.com/wled/WLED/main/AGENTS.md | nl -ba

Length of output: 66661


Script executed:

#!/bin/bash
set -euo pipefail
sha=94e751267d86c8dc94a424a477359a77dddf5481
base="https://raw.githubusercontent.com/doccaz/wled-usermod-oled-72x40/$sha"
tmp=$(mktemp -d)
for f in oled_72x40.cpp README.md library.json LICENSE .github/workflows/build.yml; do
  mkdir -p "$tmp/$(dirname "$f")"
  curl -fsSL "$base/$f" -o "$tmp/$f"
done
echo '=== Source outline ==='
ast-grep outline "$tmp/oled_72x40.cpp" --items all || true
for f in oled_72x40.cpp README.md library.json .github/workflows/build.yml; do
  echo "=== $f ==="
  cat -n "$tmp/$f"
done
echo '=== LICENSE opening ==='
cat -n "$tmp/LICENSE" | sed -n '1,55p'
echo '=== Repository topics ==='
curl -fsSL https://api.github.com/repos/doccaz/wled-usermod-oled-72x40/topics | jq .
echo '=== Workflow runs for inspected revision ==='
curl -fsSL "https://api.github.com/repos/doccaz/wled-usermod-oled-72x40/actions/runs?head_sha=$sha&per_page=20" | jq '{total_count, workflow_runs: [.workflow_runs[] | {name, head_sha, status, conclusion, html_url, created_at}]}'
echo '=== WLED security guidance ==='
for f in docs/hardening.instructions.md docs/securecode.instructions.md; do
  echo "--- $f ---"
  curl -fsSL "https://raw.githubusercontent.com/wled/WLED/main/$f" | nl -ba
done

Length of output: 48838


Script executed:

#!/bin/bash
set -euo pipefail
tmp=$(mktemp -d)
wsha=$(curl -fsSL https://api.github.com/repos/wled/WLED/commits/main | jq -r .sha)
echo "=== WLED main revision: $wsha ==="
curl -fsSL "https://api.github.com/repos/wled/WLED/git/trees/$wsha?recursive=1" -o "$tmp/tree.json"
jq '{truncated, paths: [.tree[] | select(.path | test("^wled00/[^/]+\\.(cpp|h)$")) | .path]}' "$tmp/tree.json"
jq -r '.tree[] | select(.path | test("^wled00/(wled|cfg|set|usermod|pin_manager|FX|util)[^/]*\\.(cpp|h)$")) | .path' "$tmp/tree.json" | while IFS= read -r f; do
  mkdir -p "$tmp/$(dirname "$f")"
  curl -fsSL "https://raw.githubusercontent.com/wled/WLED/$wsha/$f" -o "$tmp/$f"
done
echo '=== WLED lifecycle and config call sites ==='
rg -n -C 5 'usermods\.(setup|readFromConfig|onStateChange|loop)|readFromConfig\(|sin_approx\s*\(|I2CSDAPIN|i2c_sda|Wire\.begin\s*\(' "$tmp/wled00" || true
echo '=== U8g2 v2.34.4 files ==='
curl -fsSL 'https://api.github.com/repos/olikraus/u8g2/git/trees/v2.34.4?recursive=1' -o "$tmp/u8tree.json"
jq '{sha, truncated, paths: [.tree[] | select(.path | test("(U8g2lib|U8x8lib|u8x8_byte).*(cpp|h|c)$")) | .path]}' "$tmp/u8tree.json"
jq -r '.tree[] | select(.path | test("^cppsrc/(U8g2lib|U8x8lib)\\.(cpp|h)$|^csrc/u8x8_byte\\.c$")) | .path' "$tmp/u8tree.json" | while IFS= read -r f; do
  mkdir -p "$tmp/u8g2/$(dirname "$f")"
  curl -fsSL "https://raw.githubusercontent.com/olikraus/u8g2/v2.34.4/$f" -o "$tmp/u8g2/$f"
done
rg -n -C 5 'Wire\.begin\s*\(|U8X8_MSG_BYTE_INIT|begin\s*\(' "$tmp/u8g2" | head -n 250 || true

Length of output: 12581


Script executed:

#!/bin/bash
set -u
tmp=$(mktemp -d)
wsha=eaf9cb4b4f3cea6de703fd79f8c26683247ff1da
for f in wled00/um_manager.cpp wled00/wled.cpp wled00/wled_main.cpp wled00/wled_math.cpp wled00/set.cpp; do
  mkdir -p "$tmp/$(dirname "$f")"
  curl -fsSL "https://raw.githubusercontent.com/wled/WLED/$wsha/$f" -o "$tmp/$f" || echo "Fetch failed: $f"
done
echo '=== WLED manager lifecycle ==='
cat -n "$tmp/wled00/um_manager.cpp" | sed -n '1,240p'
echo '=== WLED boot and settings calls ==='
rg -n -C 5 'UsermodManager::(setup|readFromConfig)|doReboot|case 8|i2c_sda !=' "$tmp/wled00/wled.cpp" "$tmp/wled00/wled_main.cpp" "$tmp/wled00/set.cpp" | head -n 220
echo '=== WLED sine approximation ==='
cat -n "$tmp/wled00/wled_math.cpp" | sed -n '88,103p'
echo '=== WLED 16_x sine approximation ==='
curl -fsSL https://raw.githubusercontent.com/wled/WLED/16_x/wled00/wled_math.cpp | nl -ba | grep -A6 -B3 'float sin_approx' || true
echo '=== U8g2 available 2.34 tags ==='
curl -fsSL 'https://api.github.com/repos/olikraus/u8g2/tags?per_page=100' | jq -r '.[].name' | grep -E '2\.34' | head -n 30 || true
echo '=== U8g2 upstream hardware-I2C callback ==='
curl -fsSL https://raw.githubusercontent.com/olikraus/u8g2/master/cppsrc/U8x8lib.cpp -o "$tmp/U8x8lib.cpp" || true
rg -n -C 8 'U8X8_MSG_BYTE_INIT|Wire\.begin\s*\(' "$tmp/U8x8lib.cpp" | head -n 180 || true
echo '=== Signed int conversion threshold ==='
python - <<'PY'
import math
ms = (2**31) / ((65535 / (2 * math.pi)) * (math.pi / 2000))
print(f"approximate millis threshold: {ms:.0f} ms, {ms/3600000:.2f} hours")
PY

Length of output: 22033


@doccaz I inspected the external usermod at revision 94e751267d86c8dc94a424a477359a77dddf5481.

Findings

  1. Enabling after a disabled boot does not initialize the display. In oled_72x40.cpp, Line 112, setup() returns if the usermod is disabled. If the user enables it later without rebooting, readFromConfig(), Line 321 does not initialize it because initDone is false. The display and heartbeat remain inactive until reboot. Initialize on enable when the shared I2C bus is ready, or document that a reboot is required.

  2. The heartbeat can fail after about 36.4 hours of uptime. oled_72x40.cpp, Line 173 passes an ever-growing angle to sin_approx(). In WLED’s implementation, Line 93, the scaled value is converted to a signed int. After about 36.4 hours, that conversion exceeds its range and has undefined behavior. Reduce millis() modulo the four-second pulse period before converting it to an angle.

Coverage

I inspected oled_72x40.cpp, README.md, library.json, .github/workflows/build.yml, and the opening of LICENSE. I also checked the repository topic and relevant WLED lifecycle and math code. I applied the supplied guidance for out-of-tree usermods, including the shared-I2C and pin-ownership rules.

The recorded CI run succeeded for the inspected revision. It builds esp32dev, not the documented ESP32-C3 environment. I did not build or run the code, test hardware, or audit dependencies for vulnerabilities. I could not verify the declared U8g2 version’s shared-I2C initialization. The PR description reports earlier hardware testing; I did not independently repeat it.

You are interacting with an AI system


Learnings used

Learnt from: softhack007
Repo: wled/WLED-Docs PR: 0
File: :0-0
Timestamp: 2026-10-14T11:09:30.597Z
Learning: In wled/WLED-Docs issue #382, softhack007 reported that `coderabbit full review` did not post an external usermod source-inspection summary as a PR comment after path instructions were configured for docs/advanced/community-usermods.md. The cause is unconfirmed; do not attribute it to platform limitations as an established fact. Maintainers can explicitly request an inspection with a top-level PR comment: `@coderabbitai please perform an external usermod code inspection for this PR.` An earlier explicit chat request in issue #382 produced a pinned external-source inspection report through the GitHub API; this does not guarantee equivalent automatic PR-review behavior.
Learnt from: softhack007
Repo: wled/WLED-Docs PR: 0
File: :0-0
Timestamp: 2026-10-14T09:46:34.908Z
Learning: In wled/WLED-Docs, out-of-tree community usermods linked from docs/advanced/community-usermods.md reside in separate public repositories, with implementation source, README, library.json, and license information normally at the repository root. Reviews should apply the usermod guidance in wled/WLED/AGENTS.md and docs/advanced/custom-features.md without requiring the in-tree usermods/<name>/ layout.

You are interacting with an AI system.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant