Skip to content

Add M5Stack NanoC6 board - #3115

Open
Ludovic BOUÉ (lboue) wants to merge 3 commits into
esphome:mainfrom
lboue:add-m5stack-nanoc6-board
Open

Ludovic BOUÉ (lboue) wants to merge 3 commits into
esphome:mainfrom
lboue:add-m5stack-nanoc6-board

Conversation

@lboue

Copy link
Copy Markdown
Contributor

What does this implement/fix?

Adds a curated board manifest for the M5Stack NanoC6 — a tiny USB-C
powered ESP32-C6 devkit — so it's selectable in the board picker with
a real pinout instead of falling back to the generic ESP32-C6 board.

The pin map, connectivity (Wi-Fi 6 / Bluetooth 5 / Zigbee 3.0 / Thread
1.3), and onboard peripherals (WS2812 RGB LED + power-enable gate, IR
transmitter, blue status LED, front button, 4-pin Grove I2C port) are
sourced from M5Stack's official docs
(https://docs.m5stack.com/en/core/M5NanoC6) and the community config
at https://devices.esphome.io/devices/M5Stack-NanoC6/. That
devices.esphome.io page has no local photo yet, so the automatic
script/sync_esphome_devices.py importer can't pick it up (it
requires at least one local image); the product photo here comes
from static-cdn.m5stack.com, a domain already referenced by other
M5Stack board manifests in this catalog.

Regenerated board_bodies/m5stack-nanoc6.json and refreshed
boards.index.json / featured_components.index.json via
script/update_board.py m5stack-nanoc6.

Related issue or feature (if applicable):

  • N/A

Types of changes

  • Bugfix (non-breaking change which fixes an issue) — bugfix
  • New feature (non-breaking change which adds functionality) — new-feature
  • Enhancement to an existing feature — enhancement
  • Breaking change (fix or feature that would cause existing functionality to not work as expected) — breaking-change
  • Refactor (no behaviour change) — refactor
  • Documentation only — docs
  • Maintenance / chore — maintenance
  • CI / workflow change — ci
  • Dependencies bump — dependencies

Frontend coordination

  • No frontend change needed
  • Companion frontend PR: esphome/device-builder-frontend#

Checklist

  • The code change is tested and works locally.
  • Pre-commit hooks pass (ruff, codespell, yaml/json/python checks).
  • Tests have been added or updated under tests/ where applicable.
  • components.index.json / definitions/components/*.json have not been hand-edited (regenerate via script/sync_components.py if a sync is needed).
  • Architecture-level changes are reflected in docs/ARCHITECTURE.md and/or docs/API.md.

ESP32-C6 devkit with WS2812 RGB LED, IR transmitter, status LED,
button, and a Grove I2C port. Sourced from M5Stack's docs and the
community config at devices.esphome.io/devices/M5Stack-NanoC6/.
@codspeed

codspeed Bot commented Nov 26, 2026 •

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 28 untouched benchmarks
⏩ 1 skipped benchmark1


Comparing lboue:add-m5stack-nanoc6-board (7c3461d) with main (8c74e3d)2

Open in CodSpeed

Footnotes

  1. 1 benchmark was skipped, so the baseline result was used instead. If it was deleted from the codebase, click here and archive it to remove it from the performance reports. ↩

  2. No successful run was found on main (8a54edf) during the generation of this report, so 8c74e3d was used instead as the comparison base. There might be some changes unrelated to this pull request in this report. ↩

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Six critical manifest issues leave generated ESPHome configurations invalid, including missing component identities and unresolved dependencies.

6 open issues
What changed in this PR

Adds the M5Stack NanoC6 as a curated ESP32-C6 board with documented hardware metadata, pin assignments, onboard peripherals, and featured component recommendations.

Changes:

  • Adds the NanoC6 board manifest with ESPHome configuration, connectivity, GPIO definitions, images, and documentation links.
  • Adds recommendations for the RGB LED, status LED, button, IR transmitter, IR proxy, and Grove I²C port.
  • Regenerates the board body, board picker index, and featured-components index.
File Description
esphome_device_builder/​definitions/​featured_components.index.json Adds the generated NanoC6 featured-component recommendations to the aggregated catalog.
esphome_device_builder/​definitions/​boards/​m5stack-nanoc6/​manifest.yaml Defines the curated NanoC6 board, including its hardware metadata, pin map, and featured component presets.
esphome_device_builder/​definitions/​boards.index.json Adds the NanoC6 entry to the generated board picker index.
esphome_device_builder/​definitions/​board_bodies/​m5stack-nanoc6.json Provides the generated full catalog body for the NanoC6 board.

Review effort: Lite (adaptive)

Comment on lines +240 to +249
- id: rgbpwr
component_id: power_supply
name: RGB LED power enable
description: Load switch gating power to the onboard WS2812 RGB LED.
fields:
pin:
value: 19
locked: true
enable_time: 5ms
keep_on_time: 10ms
Comment on lines +250 to +263
- id: rgb_led
component_id: light.esp32_rmt_led_strip
name: RGB LED
description: Onboard WS2812 RGB LED.
fields:
pin:
value: 20
locked: true
chipset: ws2812
channel_colors: GRB
num_leds: 1
power_supply:
value: rgbpwr
locked: true
Comment on lines +264 to +271
- id: status_led
component_id: light.status_led
name: Status LED
description: Onboard blue status LED.
fields:
pin:
value: 7
locked: true
Comment on lines +272 to +285
- id: button
component_id: binary_sensor.gpio
name: Button
description: Front panel button. Also used to enter download mode at boot.
fields:
pin:
value:
number: 9
mode:
input: true
pullup: true
inverted: true
ignore_strapping_warning: true
locked: true
Comment on lines +286 to +294
- id: ir_tx
component_id: remote_transmitter
name: IR Transmitter
description: Onboard infrared LED.
fields:
pin:
value: 3
locked: true
carrier_duty_percent: 50%
Comment on lines +295 to +301
- id: ir_proxy_tx
component_id: infrared.ir_rf_proxy
name: IR Proxy Transmitter
fields:
remote_transmitter_id:
value: ir_tx
locked: true
@codecov

codecov Bot commented Nov 26, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (8c74e3d) to head (7c3461d).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##              main     #3115   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          305       305           
  Lines        27006     27006           
=========================================
  Hits         27006     27006           
Flag Coverage Δ
py3.12 99.96% <ø> (ø)
py3.14 99.85% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

power_supply and remote_transmitter need a locked id so the RGB
light's power_supply reference and the IR proxy's
remote_transmitter_id reference resolve; the entity-style
components (light, binary_sensor, infrared) need a name/id of
their own since the catalog's display name isn't copied into
fields. Also declares requires: so adding the RGB LED or IR proxy
card standalone pulls in its prerequisite component.

Verified the generated YAML with `esphome config`.
@lboue

Copy link
Copy Markdown
Contributor Author

Fixed the 6 issues flagged by the Copilot review (missing YAML identities / dangling cross-references in the featured components):

  • Locked id: rgbpwr on the power_supply preset and id: ir_tx on the remote_transmitter preset, so the RGB light's power_supply: rgbpwr and the IR proxy's remote_transmitter_id: ir_tx references resolve.
  • Added name under fields for the RGB LED, Status LED, Button, and IR Proxy entity presets — the catalog's display name is card-only metadata and isn't copied into the generated YAML, and each of those components requires id or name.
  • Added requires: [rgbpwr] / requires: [ir_tx] so picking the RGB LED or IR Proxy card standalone from the Recommended tab pulls in its prerequisite component first.

Verified the resulting YAML with esphome config (Configuration is valid!) and re-ran script/update_board.py m5stack-nanoc6.

ESP32-C6 has only 96 symbols of RMT TX memory in 48-symbol blocks
(two channels total). Without an explicit rmt_symbols, the WS2812
strip and the IR transmitter each default to requesting more than
one block, so enabling both from the dashboard exhausts the TX pool
and the IR transmitter fails to register its RMT channel at boot
(confirmed on real hardware: "no free tx channels" /
ESP_ERR_NOT_FOUND). Locking rmt_symbols: 48 on each keeps both
within the two-channel budget.
@lboue

Copy link
Copy Markdown
Contributor Author

Follow-up from flashing the board directly: the RGB LED + IR transmitter combo as originally catalogued compiled fine but failed at boot on real hardware:

[E][rmt:000]: rmt_tx_register_to_group(169): no free tx channels
[E][rmt:000]: rmt_new_tx_channel(287): register channel failed
[E][remote_transmitter:057]: RMT driver failed: ESP_ERR_NOT_FOUND

Root cause: the ESP32-C6 has only 96 symbols of RMT TX memory (two 48-symbol blocks = two TX channels total). Without an explicit rmt_symbols, esp32_rmt_led_strip and remote_transmitter each default to requesting more than one block, so the LED strip alone can exhaust the whole TX pool and leave nothing for the IR transmitter.

Pushed a fix locking rmt_symbols: 48 on both rgb_led and ir_tx in the manifest, so each claims exactly one block and both fit within budget. Verified the resulting config with esphome config — valid, no more RMT conflict.

@lboue

Ludovic BOUÉ (lboue) commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor Author

Confirmed on real hardware: re-flashed with rmt_symbols: 48 on both the RGB LED (esp32_rmt_led_strip) and the IR transmitter (remote_transmitter) — no more RMT channel conflict at boot. Both components now initialize successfully together on the M5Stack NanoC6.

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

new-feature New feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants