Difference between revisions of "MOD-RFID1356MIFARE"
(→UART mode) |
m (→UART mode) |
||
Line 158: | Line 158: | ||
* UEXT pin 4 (TX) -> Convertor RX | * UEXT pin 4 (TX) -> Convertor RX | ||
<br> | <br> | ||
− | Open serial port at baud-rate ''' | + | Open serial port at baud-rate '''38400''': |
− | <pre class="sh"># picocom -b | + | <pre class="sh"># picocom -b 38400 /dev/ttyUSB0 |
>? | >? |
Revision as of 03:39, 29 September 2016
Contents
MOD-RFID1356MIFARE
Description
MOD-RFID1356MIFARE is device which allow you to read and write NFC / Mifare RFID tags operating at 13.56Mhz. MOD-RFID1356MIFARE uses NXP PN532 to read and write NFC / Mifare RFID cards. In addition we put second microcontroller on the board which allow 3 additional ways to communicate with host device: USB HID keyboard, USB CDC Serial communication and UART CMOS level for UEXT boards.
Operation
The board can operate in the following modes:
- USB-HID
- USB-CDC
- UART
Additionally there is another one:
- Bootloader mode
Changing operation mode is done by holding the side button for 2 seconds. Depending on leds combination after that the modes are:
- Only green led is blinking: USB-CDC mode
- Only reg led is blinking: USB-HID mode
- Both green and red leds are blinking: UART mode
Bootloader mode
To enter bootloader mode, hold button for 2 seconds during power-up. After that you'll see both leds blinking one after another. In this mode you can upload new firmware.
Uploading new firmware
New versions of the firmware would be downloaded to the board via dedicated software tool without the need of additional hardware.
USB-HID mode
The device is shown as keyboard. On Linux machine you should see something like this:
# dmesg usb 3-2: new full-speed USB device number 45 using uhci_hcd usb 3-2: New USB device found, idVendor=15ba, idProduct=0039 usb 3-2: New USB device strings: Mfr=1, Product=3, SerialNumber=4 usb 3-2: Product: MOD-RFID1356MIFARE Tag Keyboard usb 3-2: Manufacturer: Olimex Ltd. usb 3-2: SerialNumber: xxxxxxxxxxxxxxx input: Olimex Ltd. MOD-RFID1356MIFARE Tag Keyboard as /devices/pci0000:00/0000:00:1d.1/usb3/3-2/3-2:1.0/0003:15BA:0039.000D/input/input16 hid-generic 0003:15BA:0039.000D: input,hidraw3: USB HID v1.11 Keyboard [Olimex Ltd. MOD-RFID1356MIFARE Tag Keyboard] on usb-0000:00:1d.1-2/input0
How to use it?
Open some text editor and approach card to the reader, you will see RFID-card UUID typed as if entered by keyboard.
Note that state of your keyboard CAPSLOCK, SHIFT, CONTROL etc buttons will affect what is typen. For instance if the tag info is 74bc3eb7 and you press CAPSLOCK the reader will type 74BC3EB7, if SHIFT is pressed the reader will type &$BC#EB&
USB-CDC mode
When you switch to this mode, you'll see:
# dmesg usb 3-2: new full-speed USB device number 46 using uhci_hcd usb 3-2: New USB device found, idVendor=15ba, idProduct=003a usb 3-2: New USB device strings: Mfr=1, Product=2, SerialNumber=4 usb 3-2: Product: MOD-RFID1356MIFARE usb 3-2: Manufacturer: Olimex Ltd. usb 3-2: SerialNumber: xxxxxxxxxxxxxxx cdc_acm 3-2:1.0: ttyACM0: USB ACM device
As you can see a new device /dev/ttyACM0 was created. If can be opened by any terminal emulator such as putty, minicom, etc. Since the device is USB-CDC it supports various baud rates - up to 115200.
Open device:
# picocom -b 115200 /dev/ttyACM0
Press Enter and you'll see cursor marker:
> >
To see help enter ?:
>? MOD-RFID1356MIFARE Brief command list and usage description: i - information. ? - this help. b - Switch to bootloader. erB - Read data in block B. ewB,X - Write data to block B. X must be hex, maximum 16 bytes. e0 - Disable eeprom read. e1 - Enable eeprom read. mlE - Set led mode to disabled (E=0) or enabled (E=1) mtF - Set scan interval. Values between 1 and 30000 are accepted.
Usage if the commands is as follow:
- i - information - Prints current firmware release:
>i MOD-RFID1356MIFARE Firmware revision: 01.00 http://www.olimex.com
- ? - this help - Print help commands
b - Switch to bootloader. Go into bootloader mode:
>b Device is entering boot loader mode... FATAL: term closed
After this terminal will close and board will go to bootloader mode.erB - Read data in block B. This will read 16 bytes from block B. Usually card have up to 64 blocks. For example to read what is stored in block 10 type:
>er9
Next time when you check card this will pop:
-74BC3EB72 00000000000000000000000000000000
or this:
-621D31482 AUTHENTICATION ERROR
IMPORTANT NOTE: MIFARE cards have keys, used to access build-in EEPROM. The firmware use default key FF:FF:FF:FF:FF:FF:FF:FF. If your card is locked, then you cannot read/write from the EEPROM.eWB,X - Write data to block B. X must be hex, maximum 16 bytes. This will write hex number to EEPROM. Again your card should NOT be locked. To write 0x1234 to block 9:
>ew9,1234
Write will be executed only once. When you check card:
-74BC3EB72 1234FFFFFFFFFFFFFFFFFFFFFFFFFFFF
The remaining unused bytes are replaced with F.e0 - Disable eeprom read.
-74BC3EB72 1234FFFFFFFFFFFFFFFFFFFFFFFFFFFF >e0 > -74BC3EB7 -74BC3EB7 -74BC3EB7
e1 - Enable eeprom read.
>e1 > -74BC3EB72 1234FFFFFFFFFFFFFFFFFFFFFFFFFFFF -74BC3EB72 1234FFFFFFFFFFFFFFFFFFFFFFFFFFFF
mlE - Set led mode to disabled (E=0) or enabled (E=1) To enable leds:
>ml1
To disable leds:
>ml0
mtF - Set scan interval. Values between 1 and 30000 are accepted Defines scanning interval for near cards. If you want 1 second between scans:
>mt1000
UART mode
The commands are the same as in USB-CDC mode. The difference is connection method and fixed baud-rate.
Connect the USB serial converter as follows:
- UEXT pin 2 (GND) -> GND
- UEXT pin 3 (RX) -> Convertor TX
- UEXT pin 4 (TX) -> Convertor RX
Open serial port at baud-rate 38400:
# picocom -b 38400 /dev/ttyUSB0 >? MOD-RFID1356MIFARE Brief command list and usage description: i - information. ? - this help. b - Switch to bootloader. erB - Read data in block B. ewB,X - Write data to block B. X must be hex, maximum 16 bytes. e0 - Disable eeprom read. e1 - Enable eeprom write. mlE - Set led mode to disabled (E=0) or enabled (E=1) mtF - Set scan interval. Values between 1 and 30000 are accepted.
Changelog
Version 1.0.0 (24 MAY 2016)
- Initial release