Difference between revisions of "MOD-RFID1356MIFARE"

(Uploading new firmware)
(Operation)
Line 16: Line 16:
 
* Bootloader mode
 
* Bootloader mode
  
 +
Changing the mode of operation is done by holding the side button for at least 2 seconds. Depending on the behavior of the LEDs when the button is pressed you can predict the mode that the board would enter upon releasing the button. The combinations of LED behavior during a button press and board mode after button release are:
 +
 +
* Only '''green''' led is blinking,: USB-CDC mode
 +
* Both '''green''' and '''red''' leds are blinking: UART mode
 +
* Only '''reD''' led is blinking: USB-HID 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
 
  
  

Revision as of 02:56, 4 October 2016

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 the mode of operation is done by holding the side button for at least 2 seconds. Depending on the behavior of the LEDs when the button is pressed you can predict the mode that the board would enter upon releasing the button. The combinations of LED behavior during a button press and board mode after button release are:

  • Only green led is blinking,: USB-CDC mode
  • Both green and red leds are blinking: UART mode
  • Only reD led is blinking: USB-HID 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 the mini USB connector from your personal computer with the help of a serial terminal software without the need of additional hardware.

To update the firmware

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.
 erS,E - Read data from block S to block E.
 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.
 mkK - Set work key, (K=a) for Key_A or (K=b) for Key_B.
 kA - Read current key, where A is 'a' or 'b'.
 kA,X - Set new key, where A is 'a' or 'b'. X is 6 bits in hex format.

Usage if the commands is as follow:

  • i - information - Prints current firmware release:
>i
MOD-RFID1356MIFARE
Firmware revision: 01.01
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:
>er0,7

Next time when you check card this will pop:

-1E68EFA6
Block   0 : 1E 68 EF A6 3F 88 04 00 47 B9 94 D6 45 30 36 09 
Block   1 : 12 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 
Block   2 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
Block   3 : 00 00 00 00 00 00 FF 07 80 69 FF FF FF FF FF FF 
Block   4 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
Block   5 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
Block   6 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
Block   7 : 00 00 00 00 00 00 FF 07 80 69 FF FF FF FF FF FF 
OK
>
  • 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
OK

Write will be executed only once. When you check card:

>er9
-1E68EFA6
Block   9 : 12 34 FF FF FF FF FF FF FF FF FF FF FF FF FF FF 
OK

The remaining unused bytes are replaced with F.

  • e0 - Disable eeprom read.
-74BC3EB72
Block   9 : 12 34 FF FF FF FF FF FF FF FF FF FF FF FF FF FF 
OK
>e0
>
-74BC3EB7
-74BC3EB7
-74BC3EB7
  • e1 - Enable eeprom read.
>e1
>
-74BC3EB72
Block   9 : 12 34 FF FF FF FF FF FF FF FF FF FF FF FF FF FF 
OK
-74BC3EB72
Block   9 : 12 34 FF FF FF FF FF FF FF FF FF FF FF FF FF FF 
OK

mlE - Set led mode to disabled (E=0) or enabled (E=1) To enable leds:

>ml1
OK

To disable leds:

>ml0
OK
  • 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
OK
  • mkA - mkK - Set work key, (K=a) for Key_A or (K=b) for Key_B. Key B is optional for some cards.
>mka
OK
  • kA,X - Set new key, where A is 'a' or 'b'. X is 6 bits in hex format
>ka,112233445566
OK
  • kA - Read current key, where A is 'a' or 'b'.
>ka
Key A : 112233445566
OK

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

Version 1.0.1 (29 SEP 2016)

  • Increased UART baudrate to 38400
  • Added option for selecting authentication key