Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 6, 2025

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:

  • fundamentals/ - Core concepts (GPIO basics, protocol comparison, driver selection, signal debouncing, datasheet reading)
  • protocols/ - Setup guides for I2C, SPI, PWM, UART/RS232/RS485, and libgpiod
  • platforms/ - Platform-specific guides (Raspberry Pi 5 GPIO chip changes)
  • deployment/ - Docker containers, systemd services, cross-compilation

Key Additions

Getting Started

  • getting-started.md - 5-minute LED blink tutorial with clear prerequisites and next steps

Fundamentals (5 new guides)

  • GPIO pin modes, pull-up/pull-down resistors, interrupts
  • Protocol decision guide (I2C vs SPI vs UART vs PWM with comparison table)
  • Driver selection (libgpiod vs sysfs, auto-detection, performance comparison)
  • Signal debouncing patterns with multiple implementation approaches
  • Datasheet reading guide (extracting register maps, timing, electrical specs)

Protocols

  • Reorganized existing I2C/SPI/PWM docs into protocols/ directory
  • New: Comprehensive UART/Serial guide covering RS232/RS485, baud rates, flow control

Reference

  • glossary.md - IoT/electronics terminology (150+ terms)
  • troubleshooting.md - Diagnostic decision trees for GPIO, I2C, SPI, UART, PWM failures
  • iot-project-setup.md - Project creation with .NET CLI and Visual Studio, including DI patterns

Platform-Specific

  • Raspberry Pi 5 guide highlighting critical GPIO chip number change (gpiochip0gpiochip4)

Deployment

  • Docker container guide with rootless security best practices and hardware device mounting

Updated Main README

Reorganized Documentation/README.md with progressive learning path:

  1. Getting started → 2. Fundamentals → 3. Protocol setup → 4. Project creation → 5. Deployment

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:

  • Removed unicode emojis from all section titles and content (92 instances across 10 files)
  • Consistent use of plain text formatting for checkmarks, warnings, and emphasis
  • Clean, professional appearance suitable for technical documentation

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:

  1. README.md → Troubleshooting
  2. troubleshooting.md → "Button Presses Register Multiple Times" → Links to fundamentals/debouncing.md

Complete code examples provided:

const int debounceMs = 50;
DateTime lastPress = DateTime.MinValue;

controller.RegisterCallbackForPinValueChangedEvent(pin, PinEventTypes.Falling,
    (sender, args) =>
    {
        if ((DateTime.UtcNow - lastPress).TotalMilliseconds >= debounceMs)
        {
            lastPress = DateTime.UtcNow;
            // Handle button press
        }
    });

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:

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.md that serves as the main entry point for new users:

  • Quick Start: A 5-minute "Hello World" example (blink an LED)
  • Prerequisites: Hardware requirements, .NET installation, supported platforms
  • Common Pitfalls: Permission issues, GPIO access, common error messages
  • Navigation: Clear links to all essential topics below

2. Organize Documentation by User Journey

Structure documentation to match how users actually learn:

Phase 1: Setup (Day 1)

  • Hardware setup and verification
  • Permissions and GPIO access troubleshooting
  • First successful program

Phase 2: Understanding Fundamentals (Week 1)

  • GPIO basics (input/output, pull-up/pull-down resistors)
  • Understanding protocols: When to use I2C vs SPI vs UART
  • Driver selection guide (libgpiod vs sysfs)
  • Reading datasheets and wiring diagrams

Phase 3: Common Patterns (Week 2-4)

  • Debouncing signals (not tied to specific binding)
  • Handling interrupts and events
  • Power management considerations
  • Error handling best practices

Phase 4: Production (Advanced)

  • Deployment strategies
  • Container usage
  • Performance optimization
  • Hardware debugging tools

3. Add Practical Elements to Each Doc

Each documentation page should include:

  • Prerequisites: What you need to know/have before starting
  • Step-by-step instructions: With expected output at each step
  • Troubleshooting section: Common errors and solutions
  • Verification: How to confirm it's working correctly
  • Next steps: Where to go from here

4. Create Protocol-Specific Guides

Expand the existing I2C/SPI/PWM docs to include:

  • What is it?: Brief explanation for absolute beginners
  • When to use it?: Comparison with alternatives
  • How to verify it works: Using command-line tools (i2cdetect, etc.)
  • Common issues: With specific error messages and fixes
  • Pin configuration: Including alternatives and conflicts

Missing protocol docs to add:

  • UART/Serial (RS232/RS485)
  • 1-Wire
  • GPIO basics (digital input/output fundamentals)

5. Interactive Troubleshooting Guide

Create Documentation/troubleshooting.md with:

  • Decision tree format: "Are you seeing error X? Try Y"
  • Diagnostic commands to run
  • Log interpretation guide
  • Platform-specific issues (Raspberry Pi vs others)

6. Glossary and Concepts

Add Documentation/glossary.md with:

  • Pull-up/pull-down resistors
  • Active high/low
  • Open drain/collector
  • Voltage levels (3.3V vs 5V)
  • Common abbreviations (GPIO, I2C, SPI, UART, PWM, etc.)

7. Platform-Specific Quickstart Guides

Create quick reference pages:

Each 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

Copilot AI self-assigned this Nov 6, 2025
@dotnet-policy-service dotnet-policy-service bot added area-System.Device.Gpio Contains types for using general-purpose I/O (GPIO) pins area-device-bindings Device Bindings for audio, sensor, motor, and display hardware that can used with System.Device.Gpio labels Nov 6, 2025
Copilot AI changed the title [WIP] Create documentation for essential knowledge on interfacing devices Add comprehensive essential knowledge documentation for .NET IoT newcomers Nov 6, 2025
Copilot AI requested a review from krwq November 6, 2025 17:29
Copilot finished work on behalf of krwq November 6, 2025 17:29
1. **System.Device.Gpio** library and tests which is the main library that has the implementation for protocols such as: GPIO, SPI, I2C, PWM. This library is fully supported by the dotnet team since it has the same level of support that dotnet/corefx does. All the code for the library lives under src/System.Device.Gpio. This library targets .NET Standard 2.0, and will work on both Windows and Linux. It's implementation consists of just IL code, so that means that it is supported across different platforms. In order to add new API to this library, an API Proposal would have to be submitted and approved first. [Here](https://github.com/dotnet/iot/issues/122) is an example of a how a good API proposal should look like.
Doing a PR on this part of the project may result in API review, higher exigence for the code quality and longer discussions. You need to be ready for this.
1. **Iot.Device.Bindings** device bindings library. This is a collection of types which work as wrappers (or bindings) for devices and sensors which are able to talk to a microcontroller unit (or MCU like a Raspberry Pi for example) using the protocols supported by System.Device.Gpio. For example: [BME280](../src/devices/Bmxx80/README.md) is a temperature sensor which uses SPI and I2C in order to communicate with a MCU and is able to report the current temperature. Because the process of how to compute the temperature from the data is not trivial, we have a `Bme280` class which exposes friendly methods like `ReadTemperature()` which will internally use either SPI or I2C to get the current temperature value. In order to start adding a new binding, check out our [guide on how to contribute a new binding](../tools/templates/DeviceBindingTemplate/README.md). It is worth noting that even though all device bindings will be built and packaged as a single library (Iot.Device.Bindings), the code is split under src/devices on individual projects for easier development of a single binding and developer inner-loop.
## 📚 Essential Knowledge for Newcomers
Copy link
Member

Choose a reason for hiding this comment

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

@copilot remove unicode emojis from the title
also please just remove "Essential Knowledge for Newcomers" - "Learn the Fundamentals" can go directly under "New to .NET IoT? Start Here!"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done in commit b6fbe45. Removed all unicode emojis from section titles and moved "Learn the Fundamentals" directly under "New to .NET IoT? Start Here!" by removing the "Essential Knowledge for Newcomers" section.

Copy link
Member

Choose a reason for hiding this comment

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

@copilot thanks, please proceed with similar changes in all the other files in this pull request

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done in commit e571139. Removed all unicode emojis (🎉 ✅ ❌ ⚠️) from 9 documentation files across the PR:

  • getting-started.md
  • fundamentals/choosing-drivers.md
  • fundamentals/debouncing.md
  • fundamentals/reading-datasheets.md
  • fundamentals/understanding-protocols.md
  • protocols/uart.md
  • deployment/containers.md
  • troubleshooting.md
  • iot-project-setup.md

Total of 92 emoji instances removed for consistent, professional documentation style.

Copilot AI requested a review from krwq November 13, 2025 16:57
Copilot finished work on behalf of krwq November 13, 2025 16:57
Copilot finished work on behalf of krwq November 13, 2025 17:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-device-bindings Device Bindings for audio, sensor, motor, and display hardware that can used with System.Device.Gpio area-System.Device.Gpio Contains types for using general-purpose I/O (GPIO) pins

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Creating the documentation with the essential knowledge (or links)

2 participants