-
Notifications
You must be signed in to change notification settings - Fork 608
Add comprehensive essential knowledge documentation for .NET IoT newcomers #2438
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
…ls, drivers, debouncing Co-authored-by: krwq <[email protected]>
Co-authored-by: krwq <[email protected]>
…ployment docs Co-authored-by: krwq <[email protected]>
Co-authored-by: krwq <[email protected]>
Co-authored-by: krwq <[email protected]>
Documentation/README.md
Outdated
| 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 |
There was a problem hiding this comment.
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!"
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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 (🎉 ✅ ❌
- 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.
Co-authored-by: krwq <[email protected]>
Co-authored-by: krwq <[email protected]>
krwq
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
| ``` | ||
|
|
||
| When not explicitly specified, dotnet iot automatically tries to find a driver compatible to what library version is installed. | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We're missing tiny section on the RaspberryPi3Driver
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in commit 1a5e30c. Added section on RaspberryPi3Driver in gpio.md, noting it's a legacy driver for backward compatibility and recommending LibGpiodDriver for new projects.
Documentation/protocols/gpio.md
Outdated
|
|
||
| ## Quick usage: blink LED example | ||
|
|
||
| This example targets a RaspberryPi 3/4, see comments for more information: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There should be mentions on GpioDriver here and what this means
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in commit 1a5e30c. Added comprehensive "GpioController and GPIO Drivers" section explaining the GpioController class and available driver implementations (LibGpiodDriver, RaspberryPi3Driver, SysFsDriver, Windows10Driver).
| ## Quick usage: blink LED example | ||
|
|
||
| This example targets a RaspberryPi 3/4, see comments for more information: | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other GPIO basics should be included in this docs rather than separately (specifically chosing drivers and basics). Remaining/additional docs should be linked here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in commit 1a5e30c. Consolidated GPIO basics and choosing drivers content directly into protocols/gpio.md. The fundamentals files now serve as detailed references that are linked from the protocol documentation rather than duplicating content.
Documentation/protocols/i2c.md
Outdated
| @@ -0,0 +1,175 @@ | |||
| # Enabling I2C on Raspberry Pi | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be generic title, enabling should be a sub-section.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in commit 1a5e30c. Changed title from "Enabling I2C on Raspberry Pi" to generic "I2C (Inter-Integrated Circuit)". Enabling is now a subsection under platform-specific setup.
Documentation/protocols/i2c.md
Outdated
| @@ -0,0 +1,175 @@ | |||
| # Enabling I2C on Raspberry Pi | |||
|
|
|||
| If you want to use the I2C capabilities of your Raspberry Pi, you will need to activate this feature. And if you want to run your code without elevated root privileged to access them, then, you may as well need to make couple of modifications. This tutorial is here to help you activating I2C and making sure you'll get the right permissions. | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should say what I2C is, link to extra reading materials rather than going into RPi specific stuff.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in commit 1a5e30c. Added "What is I2C?" section at the beginning explaining the protocol generically, including what it is, key features, common devices, and links to external reading materials.
Documentation/protocols/i2c.md
Outdated
|
|
||
| If you want to use the I2C capabilities of your Raspberry Pi, you will need to activate this feature. And if you want to run your code without elevated root privileged to access them, then, you may as well need to make couple of modifications. This tutorial is here to help you activating I2C and making sure you'll get the right permissions. | ||
|
|
||
| ## Basic Hardware I2C code |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just "example"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in commit 1a5e30c. Changed section title from "Basic Hardware I2C code" to "Example".
Documentation/protocols/i2c.md
Outdated
| If you get an error message like this one, it means I2C has not been properly enabled: | ||
|
|
||
| ```text | ||
| Hello I2C! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be somewhere in the bottom in the Troubleshooting section or similar
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in commit 1a5e30c. Moved troubleshooting content to bottom of the document in dedicated "Troubleshooting" section.
…, examples, advanced config, troubleshooting Co-authored-by: krwq <[email protected]>
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 <[email protected]>
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)
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
Updated 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:
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