Skip to content

Port the ES8311 audio-reactive board definition to the Waveshare ESP3… - #130

Merged
ewowi merged 2 commits into
MoonModules:mainfrom
TouchMyLight:esp32-p4-eth_ar
Oct 7, 2026
Merged

ewowi merged 2 commits into
MoonModules:mainfrom
TouchMyLight:esp32-p4-eth_ar

Conversation

@TouchMyLight

Copy link
Copy Markdown

…2-P4-ETH

Writes the hardware reference page for the Waveshare ESP32-P4-ETH's onboard ES8311 codec and Ethernet wiring, which PR #128's firmware-variant approach never landed on main after PR #129 made the codec runtime configuration. Also renames the shared P4 Ethernet preset to "P4-NANO/ETH" so its UI label doesn't imply it's NANO-only.

Core

  • EthernetModule.h: kEthPresets' shared P4 RMII row renamed "P4-NANO" → "P4-NANO/ETH", naming both boards that use it; doc comment updated to match.

Scripts/MoonDeck

  • check_devices.py: its own restatement of the preset label (cross-checked against platform_config.h's chip default) updated to match the rename — this is the check that caught the miss on the first pass.

Docs/CI

  • New docs/reference/hardware/esp32-p4-eth.md: audio (ES8311) and Ethernet pin tables, free-GPIO table, bench-verification notes, written against the current runtime-codec architecture (AudioService/I2cBusModule), not copied from the closed PR Add ES8311 audio-reactive support for the Waveshare ESP32-P4-ETH #128.
  • firmware-variants.md, gpio-usage.md: P4-ETH named alongside the P4-NANO as sharing esp32p4rev1-eth.
  • mkdocs.yml: nav entry for the new page.
  • mooninstaller/deviceModels.json: the renamed preset label carried into all 5 P4-family catalog entries that reference it.

Bench-verified on the Waveshare ESP32-P4-ETH (plain esp32p4rev1-eth firmware, no new variant): I2C bus scan ACKs the codec at 0x18, AudioService reports live mic data, Ethernet link + DHCP hold, and the renamed preset round-trips cleanly on an already-provisioned board (auto-resolves to the new label, same pins, no reseed to Custom).

Reviews

  • Pre-existing, unrelated to this diff (confirmed by reproducing on a clean main): check_docgen carries 1 pre-existing error (Hub75Slots.h) and check_code a 4-finding drift, both from commits already on main before this branch started — named here rather than fixed, since neither file is touched by this change.

…2-P4-ETH

Writes the hardware reference page for the Waveshare ESP32-P4-ETH's onboard ES8311 codec and Ethernet wiring, which PR MoonModules#128's firmware-variant approach never landed on main after PR MoonModules#129 made the codec runtime configuration. Also renames the shared P4 Ethernet preset to "P4-NANO/ETH" so its UI label doesn't imply it's NANO-only.

**Core**
- `EthernetModule.h`: `kEthPresets`' shared P4 RMII row renamed `"P4-NANO"` → `"P4-NANO/ETH"`, naming both boards that use it; doc comment updated to match.

**Scripts/MoonDeck**
- `check_devices.py`: its own restatement of the preset label (cross-checked against `platform_config.h`'s chip default) updated to match the rename — this is the check that caught the miss on the first pass.

**Docs/CI**
- New `docs/reference/hardware/esp32-p4-eth.md`: audio (ES8311) and Ethernet pin tables, free-GPIO table, bench-verification notes, written against the current runtime-codec architecture (`AudioService`/`I2cBusModule`), not copied from the closed PR MoonModules#128.
- `firmware-variants.md`, `gpio-usage.md`: P4-ETH named alongside the P4-NANO as sharing `esp32p4rev1-eth`.
- `mkdocs.yml`: nav entry for the new page.
- `mooninstaller/deviceModels.json`: the renamed preset label carried into all 5 P4-family catalog entries that reference it.

Bench-verified on the Waveshare ESP32-P4-ETH (plain `esp32p4rev1-eth` firmware, no new variant): I2C bus scan ACKs the codec at 0x18, `AudioService` reports live mic data, Ethernet link + DHCP hold, and the renamed preset round-trips cleanly on an already-provisioned board (auto-resolves to the new label, same pins, no reseed to Custom).

Reviews
- Pre-existing, unrelated to this diff (confirmed by reproducing on a clean `main`): `check_docgen` carries 1 pre-existing error (`Hub75Slots.h`) and `check_code` a 4-finding drift, both from commits already on `main` before this branch started — named here rather than fixed, since neither file is touched by this change.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration
  • Configuration used: Repository: MoonModules/MoonLight/.coderabbit.yaml
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 58f3884b-7ebc-4f71-9e43-ecd8ff49a6c3

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autopilot · 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

Comment @coderabbitai help to get the list of available commands.

@TouchMyLight

Copy link
Copy Markdown
Author

note: the ESP32-P4-ETH definition is important for an upcoming PR using this board: a MountSd service to use the microSD slot on this board

@ewowi

ewowi commented Oct 7, 2026

Copy link
Copy Markdown
Collaborator

Thanks for this, and for testing it on the real board end to end (codec ACK at 0x18, live mic data, Ethernet link): that is exactly the verification we want for a new board.

A few changes before we merge:

1. Drop the preset rename (3 files). We are renaming the shared presets by their wiring rather than by the boards that use them, so the label does not grow with every board on the same pinout. P4-NANO becomes P4 RMII and S31 CoreBoard becomes S31 RGMII, beside Classic RMII. That lands in our next PR, together with its MIGRATING entry. Please revert your changes to src/core/system/EthernetModule.h, moondeck/check/check_devices.py and mooninstaller/deviceModels.json, so the PR leaves those files as they are on main. The Waveshare ESP32-P4-ETH catalog entry is already on main from #129.

2. Name the preset P4 RMII on the page. That is the line Catalog entry: EthernetModule.ethBoard = "P4-NANO/ETH".

3. Keep the page to what only it knows. Every fact has one home in this repo, and a page links to it rather than repeating it:

  • The Ethernet pin table repeats the P4 RMII preset row in EthernetModule.h. One sentence saying the board uses P4 RMII, plus the link, covers it.
  • The audio pins and codec settings are the catalog entry's. Saying the entry configures the ES8311 and linking AudioService and I2cBus is enough.
  • The free-GPIO section repeats gpio-usage.md's P4 set. Your new row there already covers the board, so the section, and the extra sentence after the NANO's clear set, can go.

What stays is what nobody else records: the pins read from the schematic, the speaker path not being supported (DSDIN 9, PA_Ctrl 53), and the other onboard features.

4. Documentation style (documentation-standards.md):

  • No em-dashes; the page has 7. A colon, a comma or a new sentence works in each place.
  • Present tense, describing what is, with no process history. "Bench-verified 2026-10-06", "the flattened PDF text extraction was ambiguous here; confirmed by eye" and "carried over from the P4-NANO preset" belong in the PR description, which already has them.
  • datasheet/ESP32-P4-ETH/ESP32-P4-ETH-datasheet.pdf is not in the repo. Link the Waveshare wiki or schematic URL instead.

uv run moondeck/check/check_prose.py and uv run moondeck/docs/build_docs.py --strict catch most of point 4 locally.

5. Merge order. Once points 1 to 4 are done, this PR and ours touch no common lines, so either can merge first.

firmware-variants.md, the gpio-usage.md row and the nav entry are good as they are. Thanks again for adding the board.

…TH page, fix pins

Reverts this branch's P4-NANO -> P4-NANO/ETH preset rename in full, since the maintainer is renaming shared Ethernet presets by their wiring rather than by the boards that share one, in a separate upcoming PR. Trims the ESP32-P4-ETH hardware page to what it alone records, fixes its sourcing and prose style, and corrects two wrong pin claims the page and the catalog entry both carried.

**Core**
- `EthernetModule.h`: reverted to `main`, no `P4-NANO/ETH` rename.

**Scripts/MoonDeck**
- `check_devices.py`: reverted to `main`, same reason.

**Docs/CI**
- `esp32-p4-eth.md`: rewritten per review — the Ethernet section keeps only the RMII data lines (TXD0/1, RXD0/1, TXEN, RXDV) that `EthernetModule.h`'s preset row doesn't already carry, one sentence replaces the duplicated 4-field table; the audio software-config sentence now links `AudioService`/`I2cBusModule` instead of repeating control values; the free-GPIO section is gone (lives in `gpio-usage.md`). DSDIN (9) and PA_Ctrl (53) now read as wired on the board rather than "not wired up" — MoonLight just doesn't implement playback. Added the amplifier's name (NS4150B, same chip the S31 uses) and a new microSD section (D0 39, D1 40, D2 41, CD/D3 42, CLK 43, CMD 44, VDD gate 45): wired, unimplemented, and not recorded anywhere else in the repo. Sources now cite the real Waveshare schematic/drawing URLs instead of a local path that was never in the repo. No em-dashes, no process history, present tense throughout.
- `gpio-usage.md`: the P4-ETH row's free-GPIO set was wrong (copied the P4-NANO's blind of the board having no C6/WiFi, and of GPIO 24/25 actually being USB D-/D+); now `2-6, 14-23, 26, 27, 32, 33, 46-48, 54`, with Ethernet RMII, audio, USB, and the microSD slot named as the reserved set.
- `deviceModels.json`: reverted the preset rename on all 5 P4-family entries; separately fixed the Waveshare ESP32-P4-ETH's `ParallelLedDriver` default from `20,21,22,23,24,25,26,27` to `16,17,18,19,20,21,22,23`, since the original drove the board's USB D-/D+ pins as LED lanes.

Checks run: `check_prose.py` (vale newly installed this session; added lines clean, confirmed directly against the final file content since the script's own `main...HEAD` diff still includes this branch's pre-fix commit until this one lands), `build_docs.py --strict`, `check_devices.py`, `check_specs.py`, `check_docgen.py` — all clean, no new findings. The committed `prose.md` baseline is left untouched: vale's first real run in this environment shows it's far out of date (pre-existing debt, unrelated to this diff), and refreshing it is its own sweep.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@TouchMyLight

Copy link
Copy Markdown
Author

Good point using the generic P4 RMII name. I made the corresponding changes and completed the GPIO usage.

@ewowi
ewowi merged commit 131bca9 into MoonModules:main Oct 7, 2026
7 checks passed
@ewowi

ewowi commented Oct 7, 2026

Copy link
Copy Markdown
Collaborator

Merged the PR, thx! due to this we have a better name for the P4 ethernet preset and the better default pins for the p4-eth.

And this is the first PR merged by somebody else than me , congratulations;-)

(I still have some things in my head to better explain how contributions work , as some things are quite complex and with a lot of rules. So any feedback you have is welcome as well

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.

2 participants