It was suggested that I post this here rather than in corefx or coreclr. I am intrigued by the support for Raspberry Pi in the core platform and getting that up and running on the nearest Pi is on my todo list.
What _really_ intrigues me is the ability to access the GPIO system from within a .NET Core application so that I can read from sensors, control LEDs, and send I2C signals to other components chained up with the Pi.
I would love to know if this is supported and what the steps are to get it working.
@petermarcu suggested I create this issue here.
I did some searching and found a few good options from the Mono community that will probably work just fine on .NET Core.
https://github.com/raspberry-sharp/raspberry-sharp-system
https://github.com/AlexSartori/Raspberry-GPIO-Manager
https://github.com/andycb/PiSharp
@eerhardt any advice?
For general usage, https://github.com/raspberry-sharp/raspberry-sharp-system was the one I looked into briefly when prototyping/designing my drone/RF24 work.
However, I took a slightly different route. Since I was only concerned about radio signals, I ended up wrapping the native RF24 library in a managed wrapper and used that to talk to the radio. My reasoning was that the RF24 library already had a good API for talking to the radio and I didn't want to rewrite it in managed code over a general purpose GPIO API. I think it worked out well for me, and if there was a native library that already exists and solved my needs, I would take the same approach.
That said, I would love to see https://github.com/raspberry-sharp/raspberry-sharp-io ported to .NET Core. 馃槈
UPDATE: I should have taken 2 seconds to look. Looks like someone already did: https://github.com/ScramOnline/raspberry-sharp-io
Are we talking about general purpose and unified GPIO APIs (with abstracted support for universal protocols and interfaces such as I2C), that can then be specialized in hardware-specific libraries?
My core need is just to be able to detect pin status and to raise and lower pins. Obviously wrapper libraries above such a core would be useful for specialized tasks. But for now I'd love to be able to demo a microservice running on a Pi that controls an LED and reports the status of a temperature sensor, etc.
In other words, a demo for the maker community indicating that you're not stuck with Python or Node for all the things.
I like the idea of a blog post with code samples, using one of the available libraries then.
We need .NET in this space again! I've used Netduino, and gadgeteer for years, but getting .NET Core with general purpose and unified GPIO APIs would be awesome!
I expect more will happen in this space after .NET Core 2.0 ships.
I'm not seeing anything immediately actionable in this issue. Closing.
I have a library you could use. It's .NET Standard 2.0, you can read/write to GPIO and PWM pins on any linux device.
https://github.com/utilitydelta-io/dotnet-gpio
Most helpful comment
In other words, a demo for the maker community indicating that you're not stuck with Python or Node for all the things.