Skip to content

Conversation

@JakubAndrysek
Copy link
Owner

By completing this PR sufficiently, you help us to review this Pull Request quicker and also help improve the quality of Release Notes

Checklist

  1. Please provide specific title of the PR describing the change, including the component name (eg. „Update of Documentation link on Readme.md“)
  2. Please provide related links (eg. Issue which will be closed by this Pull Request)
  3. Please update relevant Documentation if applicable
  4. Please check Contributing guide
  5. Please confirm option to "Allow edits and access to secrets by maintainers" when opening a Pull Request

This entire section above can be deleted if all items are checked.


Description of Change

Please describe your proposed Pull Request and it's impact.

Test Scenarios

Please describe on what Hardware and Software combinations you have tested this Pull Request and how.

(eg. I have tested my Pull Request on Arduino-esp32 core v2.0.2 with ESP32 and ESP32-S2 Board with this scenario)

Related links

Please provide links to related issue, PRs etc.

(eg. Closes #number of issue)

@github-actions
Copy link

github-actions bot commented Dec 10, 2025

Warnings
⚠️

Some issues found for the commit messages in this PR:

  • the commit message "feat(docs): Enhance documentation build process with environment variable configuration":
    • summary appears to be too long
  • the commit message "feat(docs): Update ADC, RMT, and Timer examples to use wokwi-example directive; modify AnalogRead example pin usage":
    • summary appears to be too long
  • the commit message "feat(docs): enhance security in command execution and improve error handling in scripts":
    • summary appears to be too long
  • the commit message "feat(gpio): Update GPIO examples for clarity and functionality; add interrupt example":
    • summary appears to be too long
  • the commit message "fix(docs): Update import paths for documentation build scripts to use esp_extensions":
    • summary appears to be too long
    • body must have leading blank line
  • the commit message "fix(examples): Update AnalogRead example to read from pin 2; adjust CI configurations for consistency":
    • summary appears to be too long
  • the commit message "refactor(docs): migrate argument parsing to Click and enhance command execution in docs_build_examples.py":
    • summary appears to be too long

Please fix these commit messages - here are some basic tips:

  • follow Conventional Commits style
  • correct format of commit message should be: <type/action>(<scope/component>): <summary>, for example fix(esp32): Fixed startup timeout issue
  • allowed types are: change,ci,docs,feat,fix,refactor,remove,revert,test
  • sufficiently descriptive message summary should be between 10 to 72 characters and start with upper case letter
  • avoid Jira references in commit messages (unavailable/irrelevant for our customers)

TIP: Install pre-commit hooks and run this check when committing (uses the Conventional Precommit Linter).

Messages
📖 This PR seems to be quite large (total lines of code: 1200), you might consider splitting it into smaller PRs

👋 Hello JakubAndrysek, we appreciate your contribution to this project!


📘 Please review the project's Contributions Guide for key guidelines on code, documentation, testing, and more.

🖊️ Please also make sure you have read and signed the Contributor License Agreement for this project.

Click to see more instructions ...


This automated output is generated by the PR linter DangerJS, which checks if your Pull Request meets the project's requirements and helps you fix potential issues.

DangerJS is triggered with each push event to a Pull Request and modify the contents of this comment.

Please consider the following:
- Danger mainly focuses on the PR structure and formatting and can't understand the meaning behind your code or changes.
- Danger is not a substitute for human code reviews; it's still important to request a code review from your colleagues.
- Resolve all warnings (⚠️ ) before requesting a review from human reviewers - they will appreciate it.
- Addressing info messages (📖) is strongly recommended; they're less critical but valuable.
- To manually retry these Danger checks, please navigate to the Actions tab and re-run last Danger workflow.

Review and merge process you can expect ...


We do welcome contributions in the form of bug reports, feature requests and pull requests.

1. An internal issue has been created for the PR, we assign it to the relevant engineer.
2. They review the PR and either approve it or ask you for changes or clarifications.
3. Once the GitHub PR is approved we do the final review, collect approvals from core owners and make sure all the automated tests are passing.
- At this point we may do some adjustments to the proposed change, or extend it by adding tests or documentation.
4. If the change is approved and passes the tests it is merged into the default branch.

Generated by 🚫 dangerJS against 576b303

"""Execute a shell command with error handling."""
try:
return subprocess.run(
cmd, check=check, capture_output=capture_output, text=text

Check failure

Code scanning / CodeQL

Uncontrolled command line Critical

This command depends on
a user-provided value
.
This command depends on
a user-provided value
.
This command depends on
a user-provided value
.
This command depends on
a user-provided value
.
This command depends on
a user-provided value
.
This command depends on
a user-provided value
.
if not os.listdir(root):
try:
os.rmdir(root)
except Exception:

Check notice

Code scanning / CodeQL

Insufficient Logging Low

Try-catch except, Pass/Continue detected.
data = yaml.safe_load(ci_yml.read_text())
if "upload-binary" in data and data["upload-binary"]:
res.append(str(ino))
except Exception:

Check notice

Code scanning / CodeQL

Insufficient Logging Low

Try-catch except, Pass/Continue detected.
@github-actions
Copy link

Memory usage test (comparing PR against master branch)

The table below shows the summary of memory usage change (decrease - increase) in bytes and percentage for each target.

MemoryFLASH [bytes]FLASH [%]RAM [bytes]RAM [%]
TargetDECINCDECINCDECINCDECINC
ESP32C50⚠️ +3760.00⚠️ +0.13000.000.00
ESP32P40⚠️ +3720.00⚠️ +0.12000.000.00
ESP32S30⚠️ +2400.00⚠️ +0.08000.000.00
ESP32S20⚠️ +2400.00⚠️ +0.09000.000.00
ESP32C30⚠️ +3700.00⚠️ +0.13000.000.00
ESP32C60⚠️ +4140.00⚠️ +0.16000.000.00
ESP32H20⚠️ +3660.00⚠️ +0.13💚 -160💚 -0.120.00
ESP320⚠️ +2280.00⚠️ +0.08000.000.00
Click to expand the detailed deltas report [usage change in BYTES]
TargetESP32C5ESP32P4ESP32S3ESP32S2ESP32C3ESP32C6ESP32H2ESP32
ExampleFLASHRAMFLASHRAMFLASHRAMFLASHRAMFLASHRAMFLASHRAMFLASHRAMFLASHRAM
libraries/BLE/examples/Server000000--00000000
libraries/ESP32/examples/AnalogRead0000000000000000
libraries/ESP32/examples/GPIO/Blink----------------
libraries/ESP32/examples/GPIO/GPIOInterrupt⚠️ +3760⚠️ +3720⚠️ +2400⚠️ +2400⚠️ +3700⚠️ +4140⚠️ +366💚 -16⚠️ +2280
libraries/ESP32/examples/RMT/RMTWrite_RGB_LED0000000000000000
libraries/ESP32/examples/Timer/RepeatTimer0000000000000000
libraries/ESP32/examples/Timer/WatchdogTimer0000000000000000
libraries/Insights/examples/MinimalDiagnostics00--00000000--00
libraries/NetworkClientSecure/examples/WiFiClientSecure000000000000--00
libraries/Wire/examples/LiquidCrystal_I2C----------------
libraries/ESP32/examples/Camera/CameraWebServer----0000------00
ESP32/examples/Camera/CameraWebServer (2)----0000------00
ESP32/examples/Camera/CameraWebServer (3)----00----------

@github-actions
Copy link

github-actions bot commented Dec 10, 2025

Test Results

 83 files   83 suites   37m 43s ⏱️
 62 tests  52 ✅ 0 💤 8 ❌  2 🔥
522 runs  486 ✅ 0 💤 8 ❌ 28 🔥

For more details on these failures and errors, see this check.

Results for commit 576b303.

♻️ This comment has been updated with latest results.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds Wokwi simulation integration to documentation examples, enabling interactive hardware simulations embedded directly in the documentation pages. The changes include CI/CD automation for building example binaries, Wokwi diagram configurations, and updates to the documentation build system.

Key Changes

  • Added Wokwi simulation support through new upload-binary CI configurations and diagram definitions for multiple examples (GPIO, Timer, ADC, I2C, RMT)
  • Created docs_build_examples.py script to automate example compilation and binary preparation for documentation
  • Updated documentation build workflows to compile examples and generate Wokwi diagrams during CI/CD

Reviewed changes

Copilot reviewed 22 out of 23 changed files in this pull request and generated 12 comments.

Show a summary per file
File Description
libraries/Wire/examples/LiquidCrystal_I2C/ci.yml New CI config for I2C LCD example with ESP32 target and Wokwi diagram
libraries/Wire/examples/LiquidCrystal_I2C/LiquidCrystal_I2C.ino New example demonstrating I2C LCD control
libraries/ESP32/examples/Timer/WatchdogTimer/ci.yml New CI config enabling watchdog timer example build
libraries/ESP32/examples/Timer/RepeatTimer/ci.yml New CI config enabling repeat timer example build
libraries/ESP32/examples/RMT/RMTWrite_RGB_LED/ci.yml New CI config with Wokwi diagrams for ESP32 and ESP32H2
libraries/ESP32/examples/RMT/RMTWrite_RGB_LED/RMTWrite_RGB_LED.ino Updated RGB LED pin from 21 to 4 to match Wokwi diagram
libraries/ESP32/examples/GPIO/GPIOInterrupt/ci.yml New CI config with button wiring diagrams for multiple targets
libraries/ESP32/examples/GPIO/GPIOInterrupt/GPIOInterrupt.ino Updated button pins to 0 and 4, added serial output for better debugging
libraries/ESP32/examples/GPIO/Blink/ci.yml New CI config with LED and button wiring diagrams
libraries/ESP32/examples/GPIO/Blink/Blink.ino New blink example with button control
libraries/ESP32/examples/AnalogRead/ci.yml New CI config with potentiometer wiring diagram
docs/requirements.txt Updated Sphinx and dependencies, added esp-docs from feature branch
docs/en/contributing.rst Added comprehensive documentation for examples, Wokwi integration, and CI/CD setup
docs/en/api/timer.rst Replaced literalinclude with wokwi-example directive for interactive examples
docs/en/api/i2c.rst Added LiquidCrystal_I2C example section with Wokwi integration
docs/en/api/gpio.rst Replaced code blocks with wokwi-example directives for GPIO examples
docs/en/api/adc.rst Replaced literalinclude with wokwi-example directive
docs/conf_common.py Added docs_embed extension for Wokwi integration
.gitignore Added pattern to exclude Wokwi diagram files except in tests
.github/workflows/docs_deploy.yml Added Arduino CLI setup, example building, and environment configuration for deployments
.github/workflows/docs_build.yml Added Arduino CLI setup and example building to docs build workflow
.github/scripts/sketch_utils.sh Enhanced build script with custom build directory support and first-only FQBN option
.github/scripts/docs_build_examples.py New Python script to build documentation examples with diagram and LaunchPad config generation

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

branches:
- release/v2.x
- master
- docs-embed
Copy link

Copilot AI Dec 10, 2025

Choose a reason for hiding this comment

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

[nitpick] The branch name docs-embed has been added to the workflow triggers. This appears to be a development/feature branch. Before merging to production, consider whether this branch should remain in the trigger list or if it should be removed to keep the workflow running only on the main branches (master, release/v2.x).

Suggested change
- docs-embed

Copilot uses AI. Check for mistakes.
branches:
- master
- release/v2.x
- docs-embed
Copy link

Copilot AI Dec 10, 2025

Choose a reason for hiding this comment

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

[nitpick] The branch name docs-embed has been added to the workflow triggers. This appears to be a development/feature branch. Before merging to production, consider whether this branch should remain in the trigger list or if it should be removed to keep the workflow running only on the main branches (master, release/v2.x).

Suggested change
- docs-embed

Copilot uses AI. Check for mistakes.
The ``<target>`` is the target name (e.g., ``esp32``, ``esp32s3``, etc.). You can create the diagram using ``docs-embed`` tool installed together with documentation building tools.

To create the diagram, run the ``docs-embed init-diagram --platforms esp32`` command in the sketch folder.
You can edit them and before you run the documentation build command, you have to convert the diagram config to the ``ci.yml`` file format by running:
Copy link

Copilot AI Dec 10, 2025

Choose a reason for hiding this comment

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

Typo: "You can edit them and before you run" should be "You can edit them, and before you run" (missing comma) or better "You can edit them. Before you run" (use a period to separate the sentences more clearly).

Suggested change
You can edit them and before you run the documentation build command, you have to convert the diagram config to the ``ci.yml`` file format by running:
You can edit them. Before you run the documentation build command, you have to convert the diagram config to the ``ci.yml`` file format by running:

Copilot uses AI. Check for mistakes.
# OR
docs-embed ci-from-diagram --override
There is also opposite command to generate diagram from ``ci.yml`` file:
Copy link

Copilot AI Dec 10, 2025

Choose a reason for hiding this comment

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

Typo: "There is also opposite command" should be "There is also an opposite command" (missing article "an").

Suggested change
There is also opposite command to generate diagram from ``ci.yml`` file:
There is also an opposite command to generate diagram from ``ci.yml`` file:

Copilot uses AI. Check for mistakes.
docs-embed diagram-from-ci
The documentation building tools is working only with `ci.yml` files, so `diagram.<target>.json` files are just for configuration using GUI tool.
Copy link

Copilot AI Dec 10, 2025

Choose a reason for hiding this comment

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

Typo: "using GUI tool" should be "using a GUI tool" (missing article "a").

Suggested change
The documentation building tools is working only with `ci.yml` files, so `diagram.<target>.json` files are just for configuration using GUI tool.
The documentation building tools is working only with `ci.yml` files, so `diagram.<target>.json` files are just for configuration using a GUI tool.

Copilot uses AI. Check for mistakes.
deploy-prod-docs:
name: Deploy Documentation on Production
if: github.repository == 'espressif/arduino-esp32'
# if: github.repository == 'espressif/arduino-esp32'
Copy link

Copilot AI Dec 10, 2025

Choose a reason for hiding this comment

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

The repository check has been commented out, which means this workflow will now run on forks. This could be intentional for testing, but in production, this should typically remain uncommented to prevent unnecessary workflow runs on forks. Consider whether this change is intentional or if it should be reverted before merging.

Suggested change
# if: github.repository == 'espressif/arduino-esp32'
if: github.repository == 'espressif/arduino-esp32'

Copilot uses AI. Check for mistakes.

.. code-block:: rst
.. wokwi-example:: libraries/<library_name>/examples/<example_name>/<example_name>.ino
Copy link

Copilot AI Dec 10, 2025

Choose a reason for hiding this comment

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

The documentation example shows the wokwi-example directive with the .ino file included (<example_name>.ino), but the actual usage throughout this PR (in gpio.rst, adc.rst, i2c.rst) uses just the directory path without the .ino file. This inconsistency should be corrected - either update this documentation to match the actual usage, or update all the actual usages to match this documentation.

Suggested change
.. wokwi-example:: libraries/<library_name>/examples/<example_name>/<example_name>.ino
.. wokwi-example:: libraries/<library_name>/examples/<example_name>

Copilot uses AI. Check for mistakes.
LiquidCrystal_I2C
^^^^^^^^^^^^^^^^^

This example demonstrates how to use the `LiquidCrystal_I2C`_ library to control an LCD display via I2C.
Copy link

Copilot AI Dec 10, 2025

Choose a reason for hiding this comment

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

The LiquidCrystal_I2C reference is used but never defined. You need to add a link definition at the end of the file, for example:

.. _LiquidCrystal_I2C: https://github.com/johnrickman/LiquidCrystal_I2C

Otherwise, the Sphinx build will produce a warning about an undefined reference.

Copilot uses AI. Check for mistakes.
Examples
********

All libraries in the Arduino ESP32 core has its own examples. You can found them in the ``libraries/<library_name>/examples/`` folder.
Copy link

Copilot AI Dec 10, 2025

Choose a reason for hiding this comment

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

Grammatical error: "All libraries in the Arduino ESP32 core has" should be "All libraries in the Arduino ESP32 core have" (subject-verb agreement).

Suggested change
All libraries in the Arduino ESP32 core has its own examples. You can found them in the ``libraries/<library_name>/examples/`` folder.
All libraries in the Arduino ESP32 core have their own examples. You can find them in the ``libraries/<library_name>/examples/`` folder.

Copilot uses AI. Check for mistakes.
esp-docs>=1.4.0
sphinx~=7.1.2

esp-docs @ git+https://github.com/JakubAndrysek/esp-docs.git@extensions/wokwi_embed
Copy link

Copilot AI Dec 10, 2025

Choose a reason for hiding this comment

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

Using a Git URL with a specific branch for esp-docs can cause issues:

  1. This references a non-default branch (extensions/wokwi_embed) which may be unstable or temporary
  2. Using @ with a branch name (not a commit hash or tag) means builds are not reproducible - the branch content can change
  3. This could break documentation builds if the branch is deleted or rebased

Consider using a specific commit hash instead of a branch name for reproducibility, or better yet, use a released version once this feature is merged into a stable release.

Suggested change
esp-docs @ git+https://github.com/JakubAndrysek/esp-docs.git@extensions/wokwi_embed
esp-docs @ git+https://github.com/JakubAndrysek/esp-docs.git@<commit-hash>

Copilot uses AI. Check for mistakes.
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