In my project I have a Raspberry Pi 3 with Windows IoT OS, and I have a RC522 RFID reader. I would like to use this component (RC522) from my ASP.NET Core application.

I would like to use this library in this project, because I have some experience with this library.

If it is not possible to use this than what should I use to read my RC522 using SPI pins?


The mfrc522-netmf code is build for the MicroFramework and its not the code but the PIN numbering that is not compatible withe the Raspberry Pi

One way is try and copy the code into your project and just replace all the Cpu.Pin with the actual RaspberryPi specific static ones.

That code "should" then be able to work on the SPI since the SPI is the same implementation on any device.

For more infomration on working with SPI you can look at this to see how it communicates on IoT on the Pi - There is more information on the SPI here and a whole bunch of samples here

It not really that difficult to port it over you may just need to invest some time for it. And when you do get it working, please consider pushing your code to the IoT github or host it your self. More people can use it and improve it then.

A good sample is here - Try and follow how the SPI device is used. - In particular the InitSPIAccel method.

| improve this answer | |
  • Thanks for the lot of useful links! My main problem is that I can not use Windows.Devices.Spi namespace in my ASP .NET Core project. I found some wrapper classes for Windows.Devices.Gpio and Windows.Devices.I2C (this) but I have not found for SPI yet. – dinci11 Oct 4 '17 at 13:31
  • Errrrr.... I missed that. ASP.NET Core? Core? Maybe I have not heard the news but can you do that on IoT? I thought you can only build Universal Applications.. You can probably get a RaspberryPi package then and it will have all of that. – Piotr Kula Oct 4 '17 at 13:51
  • Please give me the tutorial you followed or some indication. I am not sure this is possible. Winodws IoT runs on .NET and Windows 10 API – Piotr Kula Oct 4 '17 at 13:53
  • 1
    I have found this article for how to run ASP.NET Core on Windows IoT (I have not tried yet). For controlling the GPIO pins from ASP.NET Core application here are some wrapper (for GPIO, I2C but no for SPI :( ) – dinci11 Oct 6 '17 at 8:06
  • 1
    And here is a useful video too! – dinci11 Oct 6 '17 at 8:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.