SimpleGPIO icon indicating copy to clipboard operation
SimpleGPIO copied to clipboard

Support more complex hardware wanted? (e.g. MFRC522 RFID Reader)

Open sandreas opened this issue 3 years ago • 5 comments
trafficstars

As a developer, I want to integrate my MFRC522 RFID Reader, so that the lib would provide a nice and clean API to this device.

First I would like to thank you for this lib, my examples are not fully working, but at least it looks promising. Are you willing to extend it to support more complex stuff? Or should this be implemented in another lib?

I'm currently trying to implement support for the MFRC522 RFID Reader, would you like me to submit a PR, if I'm done?

For more information see:

  • https://stackoverflow.com/questions/34284498/rfid-rc522-raspberry-pi-2-windows-iot
  • https://github.com/mlowijs/mfrc522-netmf/tree/master/Mfrc522

sandreas avatar Dec 14 '21 21:12 sandreas

💯 Thanks for your words of encouragement! SPI has been in the backlog for quite some time (#10) so this would be a good excuse to finally figure out a good abstraction API over the underlying library.

Feel free to make any suggestions as a PR, or if you wanted to create an implementation on your own and we could work together to bring it inline/upstream, I think either one of those would work.

Alternatively, I was hoping that a chunk of the backlog could get handled in the next month or so, and get a 2.0 release out the door, so if time is not if the essence, the SPI API should hopefully be settled by then.

SteveDesmond-ca avatar Dec 14 '21 23:12 SteveDesmond-ca

Not #10, #6; #10 depends on #6

SteveDesmond-ca avatar Dec 14 '21 23:12 SteveDesmond-ca

Hey,

well, unfortunately I'm not much into electronics, why I currently have to understand, what is happening on the hardware layer... That said, there is an abstraction of SPI in the nanoFramework:

https://docs.nanoframework.net/api/System.Device.Spi.html

And here is a pure python implementation, that may be a good base for a port: https://github.com/tkegan/python-spi/blob/master/spi.py

So maybe you could describe, what to do, how to test it and if it is only a matter of implementation, I'll take a look. Got my small dotnet 6 app working on the raspberry yesterday, so there is definetely a testing environment up and running :-)

Heres the lib I'm experimenting with currently: https://github.com/gusmanb/RaspiSharp (looks really promising)

Here is some more unfiltered research stuff:

  • https://github.com/JTrotta/RaspberrySharp
  • https://elinux.org/RPi_Low-level_peripherals (GPIO Tutorial / Information)
  • https://github.com/raspberry-sharp/raspberry-sharp-io/tree/master/Raspberry.IO.SerialPeripheralInterface
  • https://github.com/PowerShell/PowerShell-IoT
  • https://github.com/nanoframework/Windows.Devices.Spi
  • https://github.com/nanoframework/System.Device.Spi
  • https://github.com/nanoframework/nanoFramework.IoT.Device
  • https://github.com/cypherkey/RaspberryPi.Net
  • https://github.com/unosquare/raspberryio
  • https://github.com/Petermarcu/Pi
  • https://github.com/mshmelev/RPi.I2C.Net

sandreas avatar Dec 15 '21 21:12 sandreas

SPI Input devices have been implemented as of 2.0.0-beta.4, but we unfortunately don't have any SPI devices that output to do a final hardware test with, so this feature is blocked on that.

Commissions have now been opened to prioritize this feature: https://github.com/sponsors/ecoAPM/sponsorships?tier_id=106618&preview=false

Until then, the underlying System.Device.Gpio and System.Iot.Device libraries have an MFRC522 implementation at https://github.com/dotnet/iot/tree/main/src/devices/Mfrc522.

SteveDesmond-ca avatar Dec 28 '21 16:12 SteveDesmond-ca

This is great news. I'd be happy to be a tester for this...

  • Is there some example code, you would like me to test?
  • What hardware would you need to do the final testing?
  • Is Linux also targeted with this library? Or is it Windows only?

Maybe I can provide some hardware I own or donate a little amount of money to help you out?

sandreas avatar Dec 28 '21 17:12 sandreas