This is an old revision of the document!


Projekt RFID Read-Write

Project owner: Overdrive
Interested:
Related: [Project Dvere]
References:[Dioda pro lamy - ENG][GPIO explanations][BananaPi GPIO manual]
Materials: BananaPi, RFID-RC522, nepajive pole, kabely samec-samice s jumper konci, 5V napajeni, pajecka, pocitac s SSH
License: Uveďte původ-Zachovejte licenci; CC BY-SA
RFID-RC522 PinBanana Pi PinBanana PI Pin NameCable color
3.3V1+3.3VRed
GND6GNDBlack
MOSI19GPIO10/MOSI brown
MISO21GPIO09/MSO blue
CLOCK23GPIO11/SCLK yellow
SS24COE0#/GPIO07green

Reference:

  • SCLK : Serial Clock (output from master).
  • MOSI : Master Output, Slave Input (output from master).
  • MISO : Master Input, Slave Output (output from slave).
  • SS : Slave Select (active low, output from master).
[root@picka ~]# echo "spi-sun7i" >> /etc/modules
[root@picka ~]# shutdown -r now "SPI module load, test after restart"
[root@picka ~]# lsmod
Module                  Size  Used by
spidev                  6177  0 
spi_sun7i              17962  0 
8192cu                453603  0 
mali_drm                2608  0 
drm                   209014  1 mali_drm
mali                  111136  0 
ump                    51819  1 mali
lcd                     3778  0 
[root@picka ~]# aptitude install python-dev
No packages will be installed, upgraded, or removed.
0 packages upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B of archives. After unpacking 0 B will be used.
                                         
[root@picka ~]# git clone https://github.com/lthiery/SPI-Py.git
Cloning into 'SPI-Py'...
remote: Counting objects: 77, done.
remote: Total 77 (delta 0), reused 0 (delta 0), pack-reused 77
Unpacking objects: 100% (77/77), done.
Checking connectivity... done.

[root@picka ~]# cd SPI-Py
[root@picka SPI-Py]# python setup.py install
running install
running build
running build_ext
building 'spi' extension
creating build
creating build/temp.linux-armv7l-2.7
arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c spi.c -o build/temp.linux-armv7l-2.7/spi.o
creating build/lib.linux-armv7l-2.7
arm-linux-gnueabihf-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-z,relro -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wl,-z,relro -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security build/temp.linux-armv7l-2.7/spi.o -o build/lib.linux-armv7l-2.7/spi.so
running install_lib
copying build/lib.linux-armv7l-2.7/spi.so -> /usr/local/lib/python2.7/dist-packages
running install_egg_info
Writing /usr/local/lib/python2.7/dist-packages/SPI_Py-1.0.egg-info

[root@picka SPI-Py]# cd ..
[root@picka ~]# git clone https://github.com/mxgxw/MFRC522-python.git 
Cloning into 'MFRC522-python'...
remote: Counting objects: 60, done.
remote: Total 60 (delta 0), reused 0 (delta 0), pack-reused 60
Unpacking objects: 100% (60/60), done.
Checking connectivity... done.

[root@picka ~]# cd MFRC522-python 

[root@picka MFRC522-python]# python Read.py
BAPI: Banana Pi!!
BAPI: Banana Pi!!
BAPI: Banana Pi!!
BAPI: Banana Pi!!
BAPI: revision(3)
Welcome to the MFRC522 data read example
Press Ctrl-C to stop.
Card read UID: 100,83,136,50
Size: 8
Sector 8 [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
Card detected
Card read UID: 100,83,136,50
Size: 8
Sector 8 [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
Card detected
Card read UID: 100,83,136,50
Size: 8
Sector 8 [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
Card detected
Card read UID: 100,83,136,50
Size: 8
Sector 8 [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
  • projects/rfid.1464550187.txt.gz
  • Last modified: 2016/05/29 21:29
  • by over23