Add comprehensive essential knowledge documentation for .NET IoT newcomers#2438
Add comprehensive essential knowledge documentation for .NET IoT newcomers#2438
Conversation
…ls, drivers, debouncing Co-authored-by: krwq <660048+krwq@users.noreply.github.com>
Co-authored-by: krwq <660048+krwq@users.noreply.github.com>
…ployment docs Co-authored-by: krwq <660048+krwq@users.noreply.github.com>
Co-authored-by: krwq <660048+krwq@users.noreply.github.com>
Co-authored-by: krwq <660048+krwq@users.noreply.github.com>
Co-authored-by: krwq <660048+krwq@users.noreply.github.com>
Co-authored-by: krwq <660048+krwq@users.noreply.github.com>
krwq
left a comment
There was a problem hiding this comment.
protocols should be basic information on the protocols - what they are, sample code, then advanced settings and troubleshooting section. I've put comments on GPIO and I2C as examples, apply it for all protocols. All relevant docs should be linked from there.
Make sure other files don't repeat the same info
…, examples, advanced config, troubleshooting Co-authored-by: krwq <660048+krwq@users.noreply.github.com>
Done in commit 1a5e30c. Restructured all protocol files (GPIO, I2C, SPI, PWM, UART) to follow consistent format:
All protocol docs now link to related fundamentals documentation instead of repeating content. |
Co-authored-by: krwq <660048+krwq@users.noreply.github.com>
joperezr
left a comment
There was a problem hiding this comment.
Documentation Review — Aggregated Findings
This review was generated by running two independent AI reviewers (Claude Opus 4.6 and GPT 5.4) in parallel against the full diff, then aggregating and verifying findings against the actual source code. Only verified issues are reported below.
Overview
This is a great documentation effort — 18 new files covering essential knowledge that newcomers genuinely need. The structure (fundamentals → protocols → deployment) is logical and the progressive learning path is well-designed. The issues below are all fixable and shouldn't block the overall direction.
Summary of Findings
🔴 Critical (code examples won't compile / technically wrong):
PinNumberingScheme.Logicalwas removed from the API — 19 code examples across 6 files use itargs.ChangeTimedoesn't exist onPinValueChangedEventArgs— 2 filesLibGpiodDriverVersionenum doesn't exist, andchipNumber:is the wrong parameter name — 3 files- Container guide recommends
/dev/gpiomemfor libgpiod apps, but libgpiod uses/dev/gpiochip*
🟡 Important (broken links, stale content, misleading info):
5. Link to non-existent platforms/raspberry-pi-4.md in getting-started.md
6. cross-compilation.md references .NET Core 3.1, VS 2017, and defunct Channel 9
7. Broken relative link in protocols/pwm.md (fundamentals/... should be ../fundamentals/...)
8. I2C doc links to SPI page on raspberrypi.org
9. systemd doc switches from <myiotapp>.service to myscript.service mid-document
10. Default driver auto-detection behavior is oversimplified (Pi-specific logic is more nuanced)
💡 Suggestions:
11. DebouncedButton class has Dispose() but doesn't implement IDisposable
12. Async debouncing example creates async void lambda — worth noting the exception risk
|
@copilot can you look at all of the feedback that has been shared on this PR and address all of the issues? |
… review feedback - Remove PinNumberingScheme.Logical from 19 examples across 6 files (API removed) - Fix args.ChangeTime to args.PinNumber in 2 files (property doesn't exist) - Replace LibGpiodDriverVersion enum with LibGpiodV2Driver type (enum doesn't exist) - Remove DOTNET_IOT_LIBGPIOD_DRIVER_VERSION env var references (doesn't exist) - Fix containers.md to recommend /dev/gpiochip* for libgpiod apps - Remove broken link to non-existent platforms/raspberry-pi-4.md - Rewrite cross-compilation.md with .NET 8 content (was .NET Core 3.1) - Fix broken relative link in pwm.md (fundamentals/ → ../fundamentals/) - Fix I2C doc external link pointing to SPI page - Fix inconsistent myscript.service placeholder in systemd doc - Add IDisposable to DebouncedButton class in debouncing.md - Remove subtitle numbering in gpio.md driver sections - Simplify gpio.md terminology (remove "character device") - Use parameterless LibGpiodDriver constructor in examples Agent-Logs-Url: https://github.com/dotnet/iot/sessions/b0830029-ce3c-44f0-b9f6-c6ab604a74f8 Co-authored-by: joperezr <13854455+joperezr@users.noreply.github.com>
All issues addressed in commit 5edae09: Critical fixes:
Important fixes:
Suggestions:
|
joperezr
left a comment
There was a problem hiding this comment.
Final Review Pass — Aggregated Findings (Opus 4.6 + GPT 5.4)
All 10 issues from the previous review are confirmed fixed — nice work on the turnaround.
This final pass found no critical issues (nothing that would prevent code examples from compiling). There are 3 remaining items worth addressing — 2 important and 1 suggestion. Both reviewers independently flagged the same core theme: the driver auto-detection documentation is misleading in several places.
Remaining Findings
🟡 Important:
- Driver auto-detection claims are inaccurate —
LibGpiodDriveris described as "auto-detecting" libgpiod version, but it's v1-only. The actual auto-detection lives inGpioController()→UnixDriver.Create(). Also,new GpioController()on Pi 3/4 usesRaspberryPi3Driver, notLibGpiodDriver. (Found independently by both reviewers) - Invalid systemctl command syntax —
systemctl is-active status <myiotapp>.servicecombines two subcommands (Found by Opus 4.6)
💡 Suggestion:
3. I2C scanner leaks file descriptors on exception path (Found by Opus 4.6)
See inline comments for details.
|
@copilot One more round of reviews, please address the new feedback. Also, it looks like the markdownlint and markdown-link-check checks are failing. Can you look into those and make sure you fix them for your next push? |
Add blank lines around lists (MD032), fenced code blocks (MD031), and tables (MD058). Add language specifiers to bare fenced code blocks (MD040) using 'text' for error output. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: joperezr <13854455+joperezr@users.noreply.github.com>
- MD040: Add language specifiers to fenced code blocks (text, bash, csharp) - MD036: Convert bold-text-as-heading to proper ### headings in debouncing.md - MD029: Use consistent 1. prefix for ordered list items in reading-datasheets.md - MD024: Make duplicate subsection headings unique in understanding-protocols.md - MD026: Remove trailing colons from headings in understanding-protocols.md - MD001: Use ### (not ####) for headings under ## to maintain proper hierarchy Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: joperezr <13854455+joperezr@users.noreply.github.com>
- MD036: Convert bold-text-as-heading to proper headings (containers.md) - MD040: Add language specifiers to fenced code blocks (all three files) - MD024: Make duplicate 'Prerequisites' heading unique (iot-project-setup.md) - MD029: Fix ordered list numbering to use 1. prefix (raspberry-pi-5.md) - MD060: Fix table column style spacing (raspberry-pi-5.md) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: joperezr <13854455+joperezr@users.noreply.github.com>
Fix MD032 (blank lines around lists), MD031 (blank lines around code blocks), MD040 (fenced code block language), MD060 (table column alignment), MD024 (duplicate headings), MD026 (trailing punctuation in headings), and MD022 (blank lines before headings) in: - Documentation/protocols/spi.md - Documentation/protocols/uart.md - Documentation/README.md Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: joperezr <13854455+joperezr@users.noreply.github.com>
- Add 'text' language specifier to 11 bare fenced code blocks (MD040) - Change ordered list prefixes to use 1. style (MD029) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: joperezr <13854455+joperezr@users.noreply.github.com>
Align table pipe characters vertically across all rows in 7 documentation files so that column widths are consistent and separator rows match headers. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: joperezr <13854455+joperezr@users.noreply.github.com>
…lint and link-check CI failures - Correct driver auto-detection documentation: LibGpiodDriver is v1-only, LibGpiodV2Driver is v2-only, GpioController() auto-selects best driver (RaspberryPi3Driver on Pi 3/4, LibGpiodDriver on Pi 5) - Fix invalid systemctl command: remove combined is-active + status - Fix I2C scanner to use 'using' pattern to prevent file descriptor leaks - Fix broken https://github.com/dotnet/iot/discussions link (404) - Fix all markdownlint errors: MD040 (fenced code language), MD032 (blanks around lists), MD031 (blanks around fences), MD060 (table alignment), MD029 (ordered list prefix), MD024 (duplicate headings), MD036 (emphasis as heading), MD026 (trailing punctuation), MD022 (blanks around headings), MD058 (blanks around tables) Agent-Logs-Url: https://github.com/dotnet/iot/sessions/9a680a51-19cd-4d96-92a1-80e243acf221 Co-authored-by: joperezr <13854455+joperezr@users.noreply.github.com>
All addressed in commit 83ba5b0: Review feedback:
CI failures:
|
Replace dead link (https://learn.microsoft.com/visualstudio/iot/ returning 404) with valid .NET IoT deployment documentation link. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
….md, fundamentals/gpio-basics.md, fundamentals/choosing-drivers.md) Agent-Logs-Url: https://github.com/dotnet/iot/sessions/c24b48b9-932c-4ad1-a39d-b2fca64a84a2 Co-authored-by: krwq <660048+krwq@users.noreply.github.com>
Addresses #2262 by creating structured documentation for essential IoT concepts that were previously scattered or missing, reducing onboarding friction for new users.
Documentation Structure
Created four organizational directories:
Key Additions
Getting Started
getting-started.md- 5-minute LED blink tutorial with clear prerequisites and next stepsFundamentals (5 new guides)
IDisposable-correctDebouncedButtonclass)Protocols (5 comprehensive guides)
All protocol documentation follows consistent structure:
Reference
glossary.md- IoT/electronics terminology (150+ terms)troubleshooting.md- Diagnostic decision trees for GPIO, I2C, SPI, UART, PWM failuresiot-project-setup.md- Project creation with .NET CLI and Visual Studio, including DI patternsPlatform-Specific
gpiochip0→gpiochip4)Deployment
/dev/gpiochip*device mounting for libgpiod-based apps, with rootless security best practicesUpdated Main README
Reorganized
Documentation/README.mdwith progressive learning path:Simplified navigation hierarchy by moving "Learn the Fundamentals" directly under "New to .NET IoT? Start Here!" section for cleaner, more professional documentation structure.
Documentation Style
All documentation follows professional formatting standards:
API Accuracy
All code examples verified against current source code:
GpioController()andGpioController(GpioDriver)constructors (removedPinNumberingSchemewas eliminated from all examples)PinValueChangedEventArgsproperties (ChangeType,PinNumber)LibGpiodDriver(gpioChip)parameter name andLibGpiodV2Driverfor v2/dev/gpiochip*for libgpiod apps (not/dev/gpiomem)Example: Before vs After
Before: User searches through scattered docs to understand why button presses register multiple times.
After: User finds answer in two clicks:
README.md→ Troubleshootingtroubleshooting.md→ "Button Presses Register Multiple Times" → Links tofundamentals/debouncing.mdComplete code examples provided:
Metrics
Original prompt
This section details on the original issue you should resolve
<issue_title>Creating the documentation with the essential knowledge (or links)</issue_title>
<issue_description>In the triage we observed questions on topics that can be considered essential knowledge to know when interfacing devices and sensors with our library.
We all agreed that it would be important creating one or more documents providing the «essentials» concepts useful for every user. This documentation is meant to collect only the topics that are not related to specific bindings.
These are the topics I suggest to include:
libpiodvssysfsand why)Please feel free to add other topics or suggest removing one or more of the above list.
</issue_description>
Comments on the Issue (you are @copilot in this section)
@krwq Here is what copilot came up with:Documentation Strategy for Newbies
I'd like to suggest a comprehensive strategy to make the IoT library more accessible to newcomers:
1. Create a "Getting Started" Landing Page
Build a central
Documentation/getting-started.mdthat serves as the main entry point for new users:2. Organize Documentation by User Journey
Structure documentation to match how users actually learn:
Phase 1: Setup (Day 1)
Phase 2: Understanding Fundamentals (Week 1)
libgpiodvssysfs)Phase 3: Common Patterns (Week 2-4)
Phase 4: Production (Advanced)
3. Add Practical Elements to Each Doc
Each documentation page should include:
4. Create Protocol-Specific Guides
Expand the existing I2C/SPI/PWM docs to include:
i2cdetect, etc.)Missing protocol docs to add:
5. Interactive Troubleshooting Guide
Create
Documentation/troubleshooting.mdwith:6. Glossary and Concepts
Add
Documentation/glossary.mdwith:7. Platform-Specific Quickstart Guides
Create quick reference pages:
Documentation/platforms/raspberry-pi-5.md(already tracked in Raspberry Pi 5 -> GPIO Package Can it Support as of Today ???? #2262)Documentation/platforms/raspberry-pi-4.mdDocumentation/platforms/orange-pi.mdEach should include: GPIO pin...
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.
Microsoft Reviewers: Open in CodeFlow