вторник, 15 октября 2019 г.

John Deere error code


Коды неисправностей
ECU (Level 16)

    000028.03 Digital Throttle Signal Out of Range High
    000028.04 Digital Throttle Signal Out of Range Low
    000028.14 Digital Throttle Inhibited
    000029.03 Secondary Analog Throttle Signal Out of Range High
    000029.03 Hand Throttle Short to Power
    000029.04 Secondary Analog Throttle Signal Out of Range Low
    000029.04 Hand Throttle Open or Short
    000029.14 Secondary Analog Throttle Inhibited
    000029.14 Hand Throttle Out of Range
    000084.31 ECU Calculated Vehicle Speed and CAN Vehicle Speed Mismatch
    000091.03 Primary Analog Throttle Signal Out of Range High
    000091.03 Foot Throttle Short to Power
    000091.04 Primary Analog Throttle Signal Out of Range Low
    000091.04 Foot Throttle Open or Short
    000091.09 Primary Analog Throttle Signal Erratic
    000091.14 Primary Analog Throttle Inhibited
    000091.14 Foot Throttle Sensor Out of Range
    000094.03 Low Pressure Fuel Signal Out of Range High
    000094.04 Low Pressure Fuel Signal Out of Range Low
    000094.17 Low Pressure Fuel Signal Slightly Low
    000097.03 Water In Fuel Signal Out of Range High
    000097.04 Water In Fuel Signal Out of Range Low
    000097.16 Water In Fuel Detected
    000100.01 Engine Oil Pressure Signal Extremely Low
    000100.04 Engine Oil Pressure Signal Out of Range Low
    000100.18 Engine Oil Pressure Signal Moderately Low
    000100.31 Engine Oil Pressure Detected with Engine Stopped
    000105.00 Manifold Air Temperature Signal Extremely High
    000105.03 Manifold Air Temperature Signal Out of Range High
    000105.04 Manifold Air Temperature Signal Out of Range Low
    000105.15 Manifold Air Temperature Signal Slightly High
    000105.16 Manifold Air Temperature Signal Moderately High
    000107.00 Air Filter Restriction Switch Activated
    000108.02 Barometric Air Pressure Signal Invalid
    000110.00 Coolant Temperature Signal Extremely High
    000110.03 Coolant Temperature Signal Out of Range High
    000110.04 Coolant Temperature Signal Out of Range Low
    000110.15 Coolant Temperature Signal Slightly High
    000110.16 Coolant Temperature Signal Moderately High
    000111.01 Coolant Level Extremely Low
    000157.03 Fuel Rail Pressure Signal Out of Range High
    000157.04 Fuel Rail Pressure Signal Out of Range Low
    000157.10 Fuel Rail Pressure Loss Detected
    000157.17 Fuel Rail Pressure Not Developed
    000158.17 ECU Power Down Error
    000160.02 Vehicle Speed Signal Invalid
    000171.03 Ambient Air Temperature Out of Range High
    000171.04 Ambient Air Temperature Out of Range Low
    000174.00 Fuel Temperature Signal Extremely High
    000174.03 Fuel Temperature Signal Out of Range High
    000174.04 Fuel Temperature Signal Out of Range Low
    000174.16 Fuel Temperature Signal Moderately High
    000189.00 Engine Speed Derate Condition Exists
    000190.00 Engine Speed Extremely High
    000190.16 Engine Speed Moderately High
    000237.02 VIN Security Data Invalid
    000237.13 VIN Option Code Security Data Conflict
    000237.31 VIN Security Data Missing
    000569.03 Rear Axle Differential Lock Signal Out of Range High
    000569.04 Rear Axle Differential Lock Signal Out of Range Low
    000611.03 Injector Shorted to Voltage Source
    000611.04 Injector Shorted to Ground
    000627.01 All Injector Circuits Have High Resistance
    000627.18 Injector Power Supply Voltage Out of Range Low
    000629.12 ECU EEPROM Error
    000629.13 ECU Boot Block Error
    000636.02 Camshaft Position Signal Invalid
    000636.05 Camshaft Position Circuit Has High Resistance
    000636.06 Camshaft Position Circuit Has Low Resistance
    000636.08 Camshaft Position Signal Missing
    000636.10 Camshaft Position Signal Rate of Change Abnormal
    000637.02 Crankshaft Position Signal Invalid
    000637.05 Crankshaft Position Circuit Has High Resistance
    000637.06 Crankshaft Position Circuit Has Low Resistance
    000637.07 Crankshaft and Camshaft Position Signals Out of Sync
    000637.08 Crankshaft Position Signal Missing
    000637.10 Crankshaft Position Signal Rate of Change Abnormal
    000640.31 External Derate Commanded
    000647.05 Engine Fan Drive Circuit Has High Resistance
    000647.31 Engine Fan Drive Manual Purge Switch Active Too Long
    000651.02 Injector #1 Part Number Invalid
    000651.05 Injector #1 Circuit Has High Resistance
    000651.06 Injector #1 Circuit Has Low Resistance
    000651.07 Injector #1 Not Responding
    000651.13 Injector #1 Calibration Fault
    000652.02 Injector #2 Part Number Invalid
    000652.05 Injector #2 Circuit Has High Resistance
    000652.06 Injector #2 Circuit Has Low Resistance
    000652.07 Injector #2 Not Responding
    000652.13 Injector #2 Calibration Fault
    000653.02 Injector #3 Part Number Invalid
    000653.05 Injector #3 Circuit Has High Resistance
    000653.06 Injector #3 Circuit Has Low Resistance
    000653.07 Injector #3 Not Responding
    000653.13 Injector #3 Calibration Fault
    000654.02 Injector #4 Part Number Invalid
    000654.05 Injector #4 Circuit Has High Resistance
    000654.06 Injector #4 Circuit Has Low Resistance
    000654.07 Injector #4 Not Responding
    000654.13 Injector #4 Calibration Fault
    000655.02 Injector #5 Part Number Invalid
    000655.05 Injector #5 Circuit Has High Resistance
    000655.06 Injector #5 Circuit Has Low Resistance
    000655.07 Injector #5 Not Responding
    000655.13 Injector #5 Calibration Fault
    000656.02 Injector #6 Part # Data Invalid
    000656.05 Injector #6 Circuit Has High Resistance
    000656.06 Injector #6 Circuit Has Low Resistance
    000656.07 Injector #6 Not Responding
    000656.13 Injector #6 Calibration Fault
    000676.03 Cold Start Aid Signal Received When Not Expected
    000676.05 Cold Start Aid Circuit Has High Resistance
    000898.09 Engine Speed CAN Message Invalid
    000970.31 External Shutdown Switch Activated
    000970.31 External Shutdown Switch Activated
    000971.31 External Derate Switch Activated
    001069.31 Tire Size Invalid
    001075.05 Low Pressure Fuel Pump Circuit Has High Resistance
    001075.05 Fuel Transfer Pump Relay Open Circuit
    001075.06 Low Pressure Fuel Pump Circuit Has Low Resistance
    001075.06 Fuel Transfer Pump Relay Short to Ground
    001109.31 Approaching Engine Protection Shutdown
    001110.31 Engine Protection Shutdown Active
    001136.00 ECU Temperature Signal Extremely High
    001136.16 ECU Temperature Signal Moderately High
    001321.05 Starter Solenoid Lockout Relay Drive Circuit Has High Resistance
    001321.05 Starter Relay Open Circuit
    001321.06 Starter Solenoid Lockout Relay Drive Circuit Has Low Resistance
    001321.06 Starter Relay Short to Ground
    001321.16 Crank Cycle Too Long
    001321.30 Starter Solenoid Lockout Relay Drive Circuit Fault
    001347.03 Suction Control Valve Signal Out of Range High
    001347.05 Suction Control Valve Circuit Has High Resistance
    001347.07 Fuel Rail Pressure Actual to Desired Mismatch
    001569.31 Engine in Power Derate Condition
    001638.09 Hydraulic Oil Temperature Erratic
    001639.01 Fan Speed Signal Extremely Low
    001639.16 Fan Speed Signal Moderately High
    002000.13 Incorrect ECU for Application
    002003.09 No CAN Message Received From Source Address 3
    002004.09 No CAN Message Received From Source Address 4
    002023.09 No CAN Message From Source Address 23
    002023.09 Hand Throttle Message Missing
    002033.09 No CAN Message Received From Source Address 33
    002033.14 Incorrect CAN Message Received From Source Address 33
    002033.19 Synchronizing Problem with Source Address 33
    002057.09 No CAN Message Received From Source Address 57
    002071.09 No CAN Message From Source Address 71
    003509.03 Sensor Supply #1 Voltage Out of Range High
    003509.04 Sensor Supply #1 Voltage Out of Range Low
    003510.03 Sensor Supply #2 Voltage Out of Range High
    003510.04 Sensor Supply #2 Voltage Out of Range Low
    003511.03 Sensor Supply #3 Voltage Out of Range High
    003511.04 Sensor Supply #3 Voltage Out of Range Low
    523702.09 Flex Power Message Missing
    523792.04 EPGDS LTC Pump Signal Out of Range Low
    524037.02 MFWD Switch Circuit Fault
    524099.11 EPGDS LTC Pump Blockage
    524223.03 Rear Axle Differential Lock Circuit Fault
    524225.31 Engine Start Protection Bypass Detected
    524235.03 MFWD Solenoid Signal Out of Range High
    524235.04 MFWD Solenoid Signal Out of Range Low


EMU

    000070.04 Park Brake Switch Out of Range Low
    000070.07 Park Brake Switch Data Invalid
    000096.03 Fuel Sensor Out of Range High
    000096.04 Fuel Sensor Out of Range Low
    000107.00 Engine Air Filter Restricted
    000158.00 System Voltage Above Normal
    000158.16 System Voltage High
    000158.18 System Voltage Low
    000177.00 Torque Converter Oil Temperature Too High
    000177.03 Torque Converter Oil Temperature Sensor Out of Range High
    000177.04 Torque Converter Oil Temperature Sensor Out of Range Low
    000525.03 Gear Switch Out of Range High
    000525.04 Gear Switch Out of Range Low
    000525.05 Gear Switch Open Circuit
    000525.07 Gear Switch Data Invalid
    000604.06 FNR Supply Out of Range High
    000736.06 Y3 Solenoid Short to Ground
    000736.12 Y3 Solenoid Open or Short to Power
    000737.06 Y4 Solenoid Short to Ground
    000737.12 Y4 Solenoid Open or Short to Power
    000738.06 Y5 Solenoid Short to Ground
    000738.12 Y5 Solenoid Open or Short to Power
    000767.02 Reverse Switch Data Invalid
    000767.05 Reverse Switch Data Out of Range Low
    000880.05 Service Brake Lights Open Circuit
    000903.02 Forward Switch Data Invalid
    000903.05 Forward Switch Data Out of Range Low
    000920.03 Audible Alarm Open or Short to Power
    000920.04 Audible Alarm Short to Ground
    001713.00 Hydraulic Oil Filter Restricted
    298816.14 Park Brake Data Invalid
    522379.03 Park Brake Solenoid Short to Power
    522379.05 Park Brake Solenoid Open Circuit
    522379.06 Park Brake Solenoid Short to Ground
    522398.14 Park Brake Data Invalid
    522405.03 Park Brake Pressure Switch Short to Power
    522411.02 FNR Data Invalid
    522411.03 FNR Short to Power
    522411.05 FNR Open Circuit
    522411.06 FNR Short to Ground
    523702.02 Flex Power ECU Watchdog Error
    523702.07 Flex Power Authentication Error
    523702.08 Flex Power Inactive
    523702.09 Flex Power Status Message Not Received
    523702.10 Flex Power Timeout With ECU
    524172.00 Clutch Disconnect Switch Data Above Normal
    524172.03 Clutch Disconnect Switch Out of Range High
    524172.04 Clutch Disconnect Switch Short to Ground


FLC

    002000.09 CAN Communication Lost with ECU

воскресенье, 10 июня 2018 г.

rules

  sudo chmod a+rw /dev/ttyACM0
(echo '# DFU (Internal bootloader for STM32 MCUs)'
 echo 'SUBSYSTEM=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="df11", MODE="0664", GROUP="plugdev"') | sudo tee /etc/udev/rules.d/45-stdfu-permissions.rules > /dev/null
 

среда, 25 октября 2017 г.

четверг, 27 апреля 2017 г.

Using a generic stm32 board on linux with Maple bootloader

## Теперь эта информация была заменена. См. Страницу загрузчика stm32duino в вики.
Подробности от @ahull на форуме Arduino о том, как его можно установить и использовать загрузчик Maple на общей плате STM32 (на которой нет оборудования для сброса USB Maple) в Linux
Использование загрузочного загрузчика Maple в Linux, чтобы разрешить доступ к последовательному порту USB на общих платах STM32 с установленным на них загрузчиком клена (также должен работать с подлинными платами Maple).
Очевидно, что основными требованиями являются Linux-ПК и плата Maple, или общая плата с установленным загрузчиком Maple, USB-кабель и т. Д.
В дополнение к требованиям для установки среды IDE Arduino и т. Д., Как описано здесь ...

https://github.com/rogerclarkmelbourne/Arduino_STM32/wiki/Installation


... вам нужно ...

dfu-util

Либо установите упакованную версию для вашего конкретного Linux (sudo apt-get install dfu-util для версий на базе Debian, включая Ubuntu и т. Д.) Или установите с ...

http://dfu-util.sourceforge.net/

Для обеспечения корректности перечисления устройств 1leaf на клен необходимы некоторые дополнительные правила udev.
Подробнее см. В документации к Linux. Ниже приведены правила для большинства версий Linux.

ATTRS{idProduct}=="1001", ATTRS{idVendor}=="0110", MODE="664", GROUP="plugdev"
ATTRS{idProduct}=="1002", ATTRS{idVendor}=="0110", MODE="664", GROUP="plugdev"
ATTRS{idProduct}=="0003", ATTRS{idVendor}=="1eaf", MODE="664", GROUP="plugdev" SYMLINK+="maple"
ATTRS{idProduct}=="0004", ATTRS{idVendor}=="1eaf", MODE="664", GROUP="plugdev" SYMLINK+="maple"

Save the rules locally as 45-maple.rules then do something like...

    sudo cp -v 45-maple.rules /etc/udev/rules.d/45-maple.rules
    sudo chown root:root /etc/udev/rules.d/45-maple.rules
    sudo chmod 644 /etc/udev/rules.d/45-maple.rules

and restart udev

sudo /etc/init.d/udev restart

(Или все, что подходит для вашей версии Linux)
Затем вам нужно убедиться, что upload_router работает. В то время, когда эта страница была впервые написана, в git repo не было версии загружаемого маршрутизатором Linux.
Должна быть более актуальная версия upload_router, включенная в последний код, но приведенная ниже версия позволит вам увидеть, как это работает.
Скрипт upload_router опирается на lsusb, dfu-util, поэтому, если эти зависимости не установлены в вашей системе, сначала установите их.

#!/bin/bash
# Translates the windows Arduino IDE upload call - something like..
#
# upload_router ttyUSB0 1 1EAF:0003 /tmp/build9114565021046468906.tmp/STM32_Blink.cpp maple_dfu 0
#
# to the linux dfu-util equivalent of the form...
#
# dfu-util -D ./STM32_Blink.cpp.bin -d 1eaf:0003 --intf 0 --alt 1
#
#

function leaf_status() 
{

this_leaf_status=$(lsusb |grep "1eaf" | awk '{ print $NF}')
# Find the mode of the leaf bootloader
case $this_leaf_status in 
   "1eaf:0003")
      echo "dfu"
   ;;
   "1eaf:0004")
      echo "ttyACMx"
   ;;
   *)
      #echo "$this_leaf_status"
      echo "unknown"
   ;;
esac
}


DEVICE="$3"
# Lowercase the 1eaf device name, since in Windows land everybody shouts.
DEVICE=${DEVICE,,}

BINFILE="$4.bin"
INTERFACE="$6"
ALT_INTERFACE="$2"

# You will need the usb-reset code, see https://github.com/rogerclarkmelbourne/Arduino_STM32/wiki/Using-a-generic-stm32-board-on-linux-with-Maple-bootloader
#
USBRESET=$(which usb-reset) || USBRESET="./usb-reset"

# Check to see if a maple compatible board is attached
LEAF_STATUS=$(leaf_status)

# Borard not found, or no boot loader on board.
if [[ $(leaf_status) = "unknown" ]]
then
   echo "STM32 Maple Bootloader compatible board not found."
   sleep 5
   exit 1
fi

# We got this far, so we need to get the board in bootloader mode. 
# After the timeout period, the board goes back in to serial mode, we need it in dfu mode, which happens for the first few seconds at power on 
# so we ask the user to unplug and re-plug the board. 
echo -e "\n\rSTM32 Maple board is in $LEAF_STATUS mode."

echo "Please unplug and replug the USB cable to the Maple device."
sleep 2
# On unplugging the board will be "unknown"
while [[ $(leaf_status) != "unknown" ]]
do
   echo -n "."
   sleep 1
done
# On re-plugging the board will be "dfu"
while [[ $(leaf_status) != "dfu" ]]
do
   echo -n "."
   sleep 1
done

echo -e "\n\rProgramming STM32 device with dfu-util"
until dfu-util  -D "$BINFILE" -d "$DEVICE" --intf "$INTERFACE" --alt "$ALT_INTERFACE" 2>&1
do
    echo -n "."
    sleep 1
done

echo -e "\n\rUnplug and replug the USB cable to the STM32 board again please...."
while [[  $(leaf_status) != "unknown" ]]
do
    echo -n "."
    sleep 1
done

echo -e "\n\rReconnecting"
while [[ $(leaf_status) = "unknown" ]]
do
    echo -n "."
    sleep 1
done

echo -e "\n\rWaiting for bootloader to exit."
for i in {1..6}
do
    echo -n "."
    sleep 1
done

"$USBRESET" "/dev/bus/usb/$(lsusb |grep "1eaf" |awk '{print $2,$4}'|sed 's/\://g'|sed 's/ /\//g')" >/dev/null 2>&1

while [[ $(leaf_status) = "unknown" ]]
do
    echo -n "."
    sleep 1
done
THIS_TTY=$(find /dev/ttyACM* -cmin -2)
echo -e "\n\rSTM32 Maple board serial port re-created..."
echo -e "\n\rSerial port is $THIS_TTY Please allow 15 seconds before attempting to read from serial port."


Далее нам нужен метод для сброса узла устройства в Linux после того, как мы запрограммировали плату, чтобы правильно перечислить последовательное устройство клена как tty, иначе Linux все же думает, что к нему подключено устройство dfu.
Мы используем код отсюда

 http://askubuntu.com/questions/645/how-do-you-reset-a-usb-device-from-the-command-line.

Copy the 'c' code below and save as usb-reset.c


/* usb-reset -- send a USB port reset to a USB device
 
    Compile with ...  
    gcc usb-reset.c -o usb-reset
    ... then copy the resulting usb-reset binary to /usr/bin or some other suitable place in your PATH

*/

#include <stdio.h>
#include <unistd.h>
#include <fcntl.h>
#include <errno.h>
#include <sys/ioctl.h>

#include <linux/usbdevice_fs.h>


int main(int argc, char **argv)
{
    const char *filename;
    int fd;
    int rc;

    if (argc != 2) {
        fprintf(stderr, "Usage: usbreset device-filename\n");
        return 1;
    }
    filename = argv[1];

    fd = open(filename, O_WRONLY);
    if (fd < 0) {
        perror("Error opening output file");
        return 1;
    }

    printf("Resetting USB device %s\n", filename);
    rc = ioctl(fd, USBDEVFS_RESET, 0);
    if (rc < 0) {
        perror("Error in ioctl");
        return 1;
    }
    printf("Reset successful\n");

    close(fd);
    return 0;
}

Compile the 'c' with ...
gcc usb-reset.c -o usb-reset
... then copy the resulting usb-reset binary to /usr/bin or some other suitable place in your PATH
The work flow now is pretty much as described in the bash script.
Plug in your board with Maple Bootloader, select Maple Mini Generic as the board type and compile your sketch to prove it compiles, When you are happy that this all works, press the Upload button in the IDE. This should start upload_router if you have followed the above instructions without any problems.
  1. upload_router prompts you to unplug the board from the USB port, and re-plug it. upload_router then uses dfu-util to program the board.
  2. upload_router then prompts to unplug and replug the board again. usb-reset then identifies the leaf (1EAF) device and resets it using the usb-reset command (from the c code above).
  3. upload_router then waits while linux re-enumerated the device. /dev/ttyACM0 or /dev/ttyACM{whatever} automagically appears and if we look in lsusb, the device has changed from something like...
Bus 001 Device 114: ID 1eaf:0003
.. to ..
Bus 001 Device 115: ID 1eaf:0004
You should be able to use the USB serial port and the serial monitor in the IDE if you set serial.port=/dev/ttyACM1 (or serial.port=/dev/ttyACM2 or whatever the board enumerates as) in your IDE preferences.txt
If you are afraid of wearing out your laptop usb port with all that unplugging, use a USB extension lead.
Once in a while the IDE fails to connect the serial monitor after running the above upload_router. It almost invariably works on the 2nd (or worst case 3rd) attempt at clicking "Serial Monitor" in the IDE. Other than that minor flaw, it works.
This looks to be some sort of timeout in the maple bootloader, so allow 15 seconds once the board has rebooted for the serial port to come back up.
I took a look at trying to reset the STM32 USB device from software, but the problem is that I need to cut the USB power and there seems to be no reliable programatic method to do this. Although a lot of USB chipsets include this feature, most hardware vendors don't include the necessary circuitry to actually implement it.
I think we are stuck with physical reset. i.e. Physically cut the USB power and reconnect, for non Maple boards.
I tried toggling DTR and echoing "1eaf" to the device, but it just ignored me. Even pressing the reset button on the STM32 board doesn't make a difference, only powering the board off and back on lets Linux know it has changed state.
Perhaps I might take another look if I get the time, but to be honest it would be quicker to wire up a make/break switch on the +5V line in a USB extension lead to do the same thing if damaging your USB ports is a concern.
Just make something like one of these >> http://www.ebay.com/itm/USB-Power-Cable-with-ON-OFF-Switch-Power-Control-for-Raspbeery-Pi-Arduino-Phone-/261837515315?pt=LH_DefaultDomain_0&hash=item3cf6bb6a33 << and (assuming you have used 4 core wire, which you would need to do), wire the data lines through, but put the switch in line with the +5V (usually the red wire)... or build you own solution from whatever you have to hand.
Alternatively, use ...
http://www.ebay.com/itm/4-Ports-USB-2-0-Hub-High-Speed-Up-to-480Mbps-With-Power-On-Off-Button-Switch-Led-/201259337620?pt=LH_DefaultDomain_0&hash=item2edbfdc794
... one of these, or if you have lots of devices to program...
http://www.ebay.com/itm/New-Hot-7-Port-USB-2-0-Hub-High-Speed-ON-OFF-Sharing-Switch-For-PC-Laptop-/330989851927?pt=LH_DefaultDomain_2&var=&hash=item4d10885517
...one of these, will do the trick but you would probably need to externally power it to let you use multiple boards.

пятница, 24 марта 2017 г.

Fixing LVDS Cables for CCFL LCD Screens



CCFL inverter pinout (M662)

On the inverter port, when looking from the cable side, from left to right, numbering from 1 to 6, the pins are connected with the following colors of wires:

1 - green
2 - yellow
3 - black
4 - orange
5 - brown
6 - red

According to my testing, the function of pins is as follows

1 : + (19/12 V)
2 : + (19/12 V)
3 : on switch (inverter activates at > cca 1.8V)
4 : brightness (0V = low brightness; higher voltage gives higher brightness)
5 : GND
6 : GND

Pins 1&2 and 5&6 seem to be Излишне connected, supplying power.

The notebook is broken so I couldn't watch pins 3 and 4 in use, but from testing, it seems they are control pins. I don't know exactly how they should be used, but the inverter doesn't start without voltage on pin 3. Applying 3.3V to pins 3&4 seems to make the panel shine nice and bright. I don't know if they are PWM, voltage controlled, or what is

понедельник, 3 октября 2016 г.

RFID-RC522 под Raspberry Pi

1. Подключение

Все ножки модуля кроме IRQ должны быть задействованы!
 
 
 
2. Оживляем SPI

Для этого открываем конфиг
sudo nano /etc/modprobe.d/raspi-blacklist.conf

Там комментируем (это знак # в начале строки) вот эту строчку:
blacklist spi-bcm2708


3. spi для python
 
sudo apt-get install python-dev
 
git clone https://github.com/lthiery/SPI-Py.git
 
cd SPI-Py
 
sudo python setup.py install
 

 4. Запускаем пример
 
git clone https://github.com/rasplay/MFRC522-python.git
 
cd MFRC522-python
 
sudo python read.py



Ссылка на репозиторий в котором библиотека для работы с RC522 и пример вот:
https://github.com/rasplay/MFRC522-python