Module – ACM1252U-Z2 – Small NFC reader module
Hardware
Informatie (ENG)
ACM1252U-Z2 is a small NFC reader module developed based on 13.56 MHz contactless technology, for fast and easy integration to embedded systems.
The ACM1252U-Z2 supports ISO 14443 Type A and B cards, and MIFARE®, FeliCa, and ISO 18092–compliant NFC tags. It also supports other NFC devices with an access speed of up to 424 Kbps and proximity operating distance of up to 30 mm (depending on tag type used). ACM1252U-Z2 also has an anti-collision feature that ensures only one card is accessed when multiple cards are presented simultaneously.
It is PC/SC-compliant and firmware upgradeable. Its small size allows it to be integrated to compact machines. It can be used with a detachable micro-USB cable that allows it flexibility to be located far from the USB host interface.
- USB 2.0 Full Speed Interface
- CCID Compliance
- Contactless Card Support:
- Read/write speed of up to 424 kbps
- Built-in antenna for contactless tag access, with card reading distance of up to 30 mm (depending on tag type)
- Supports ISO 14443 Part 4 Type A and B cards, MIFARE, FeliCa and all four types of NFC (ISO 18092 tags)
- Built-in anti-collision feature (only one tag is accessed at any time)
- Application Programming Interface
- Supports PC/SC
- USB Firmware Upgradability
Physical Characteristics | |
---|---|
Dimensions (mm) | 52.0 mm (L) x 20.0 mm (W) x 6.0 mm (H) |
Weight (g) | 3.65 g |
USB Interface | |
Protocol | USB CCID |
Connector Type | Micro USB |
Power Source | From USB port |
Speed | USB Full Speed (12 Mbps) |
Cable Length | 1.0 m, Detachable (Optional) |
Contactless Smart Card Interface | |
Standard | ISO/IEC 18092 NFC, ISO 14443 Type A & B, MIFARE®, FeliCa® |
Protocol | ISO14443-4 Compliant Cards, T=CL MIFARE® Classic Card Protocol, T=CL ISO 18092, NFC Tags FeliCa® |
Antenna | 20 mm x 22 mm |
Built-in Peripherals | |
LED | 1 bi-color: Red and Green |
Other Features | |
Firmware Upgrade | Supported |
Certifications/Compliance | |
Certifications/Compliance | ISO 14443 ISO 18092 USB Full Speed PC/SC CCID CE FCC RoHS 2 REACH Microsoft® WHQL |
Device Driver Operating System Support | |
Device Driver Operating System Support | Windows® Linux® MAC OS® Solaris Android™ |
Pinout
GEEN GEGEVENS
Raspberry Pi
When plugged in:
1 2 3 4 5 6 |
usb 1-1.3: new full-speed USB device number 3 using xhci_hcd usb 1-1.3: not running at top speed; connect to a high speed hub usb 1-1.3: New USB device found, idVendor=072f, idProduct=223e, bcdDevice= 2.07 usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=0 usb 1-1.3: Product: ACR1252 Reader usb 1-1.3: Manufacturer: ACS |
1 |
Bus 001 Device 003: ID 072f:223e Advanced Card Systems, Ltd |
Install the drivers for ACM1252
command: sudo dpkg -i libacsccid1_1.1.8-1~bpo10+1_armhf.deb
1 2 3 4 5 |
Selecting previously unselected package libacsccid1. (Reading database ... 154371 files and directories currently installed.) Preparing to unpack libacsccid1_1.1.8-1~bpo10+1_armhf.deb ... Unpacking libacsccid1 (1.1.8-1~bpo10+1) ... Setting up libacsccid1 (1.1.8-1~bpo10+1) ... |
Install packages
pcscd: sudo apt-get install pcscd
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
Reading package lists... Done Building dependency tree Reading state information... Done The following package was automatically installed and is no longer required: rpi-eeprom-images Use 'sudo apt autoremove' to remove it. The following NEW packages will be installed: pcscd 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. Need to get 84.8 kB of archives. After this operation, 176 kB of additional disk space will be used. Get:1 http://mirror.transip.net/raspbian/raspbian buster/main armhf pcscd armhf 1.8.24-1 [84.8 kB] Fetched 84.8 kB in 0s (184 kB/s) Selecting previously unselected package pcscd. (Reading database ... 154384 files and directories currently installed.) Preparing to unpack .../pcscd_1.8.24-1_armhf.deb ... Unpacking pcscd (1.8.24-1) ... Setting up pcscd (1.8.24-1) ... Created symlink /etc/systemd/system/sockets.target.wants/pcscd.socket → /lib/systemd/system/pcscd.socket. Processing triggers for man-db (2.8.5-2) ... Processing triggers for systemd (241-7~deb10u4+rpi1) ... |
set as service: systemctl enable pcscd.service
1 2 3 4 5 6 7 8 9 10 |
Synchronizing state of pcscd.service with SysV service script with /lib/systemd/systemd-sysv-install. Executing: /lib/systemd/systemd-sysv-install enable pcscd ==== AUTHENTICATING FOR org.freedesktop.systemd1.reload-daemon === Authentication is required to reload the systemd state. Multiple identities can be used for authentication: 1. ,,, (pi) 2. root Choose identity to authenticate as (1-2): 1 Password: ==== AUTHENTICATION COMPLETE === |
libpcsclite-dev: sudo apt-get install libpcsclite-dev
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
Reading package lists... Done Building dependency tree Reading state information... Done The following package was automatically installed and is no longer required: rpi-eeprom-images Use 'sudo apt autoremove' to remove it. The following NEW packages will be installed: libpcsclite-dev 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. Need to get 74.1 kB of archives. After this operation, 200 kB of additional disk space will be used. Get:1 http://mirror.transip.net/raspbian/raspbian buster/main armhf libpcsclite-dev armhf 1.8.24-1 [74.1 kB] Fetched 74.1 kB in 0s (214 kB/s) Selecting previously unselected package libpcsclite-dev. (Reading database ... 154396 files and directories currently installed.) Preparing to unpack .../libpcsclite-dev_1.8.24-1_armhf.deb ... Unpacking libpcsclite-dev (1.8.24-1) ... Setting up libpcsclite-dev (1.8.24-1) ... Processing triggers for man-db (2.8.5-2) ... Processing triggers for libc-bin (2.28-10+rpi1) ... |
swig: sudo apt-get install swig
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
Reading package lists... Done Building dependency tree Reading state information... Done The following package was automatically installed and is no longer required: rpi-eeprom-images Use 'sudo apt autoremove' to remove it. The following additional packages will be installed: swig3.0 Suggested packages: swig-doc swig-examples swig3.0-examples swig3.0-doc The following NEW packages will be installed: swig swig3.0 0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded. Need to get 1,530 kB of archives. After this operation, 5,745 kB of additional disk space will be used. Do you want to continue? [Y/n] Y Get:1 http://mirror.transip.net/raspbian/raspbian buster/main armhf swig3.0 armhf 3.0.12-2 [1,221 kB] Get:2 http://mirror.transip.net/raspbian/raspbian buster/main armhf swig armhf 3.0.12-2 [310 kB] Fetched 1,530 kB in 1s (2,298 kB/s) Selecting previously unselected package swig3.0. (Reading database ... 154415 files and directories currently installed.) Preparing to unpack .../swig3.0_3.0.12-2_armhf.deb ... Unpacking swig3.0 (3.0.12-2) ... Selecting previously unselected package swig. Preparing to unpack .../swig_3.0.12-2_armhf.deb ... Unpacking swig (3.0.12-2) ... Setting up swig3.0 (3.0.12-2) ... Setting up swig (3.0.12-2) ... Processing triggers for man-db (2.8.5-2) ... |
Read NFC tags with python
library pyscard: sudo pip install pyscard
1 2 3 4 5 6 7 8 9 |
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple Collecting pyscard Using cached https://files.pythonhosted.org/packages/ed/dd/c575bb75122c250cbed3f70440cb8e25582bf991855bb4eb27371fb8d962/pyscard-1.9.9.tar.gz Building wheels for collected packages: pyscard Running setup.py bdist_wheel for pyscard ... done Stored in directory: /root/.cache/pip/wheels/87/7a/77/5823300c78a6745982cf0880e69ca878afba40d8b82c1136cf Successfully built pyscard Installing collected packages: pyscard Successfully installed pyscard-1.9.9 |
Script from rocky112358 @ github:
Enviroment
- pyscard 1.9.4
- python 2.7.10
Command List (Help Page)
$ python nfctool.py <command>
Before executing command, make sure that a card is being tagged on the reader.
- help: Show this command list
- mute: Disable beep sound when card is tagged. (This setting is volatile. Lasts till device off.)
- unmute: Enable beep sound when card is tagged.
- getuid: Print UID of the tagged card.
- info: Print card type and available protocols.
- loadkey <key>: Load key <key> (6byte hexstring) for auth. (The loaded key is volatile. Lasts till device off.)
- read <sector>: Read sector <sector> with loaded key.
- firmver: Print the firmware version of the reader.
How to read data
- Connect the reader to computer and put a card on the reader. Check connection with ‘getuid’ or ‘info’ command.
- Load key with ‘loadkey’ command (This procedure is not needed for MIFARE Ultralight)
12$ python nfctool.py loadkey FFFFFFFFFFFF - Read sector with ‘read’ command
1$ python nfctool.py read 4
source: https://github.com/rocky112358/ACS-ACR122U-Tool
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 |
from smartcard.System import readers from smartcard.util import toHexString from smartcard.ATR import ATR from smartcard.CardType import AnyCardType import sys if len(sys.argv) < 2: print "usage: nfcTool.py <command>\nList of available commands: help, mute, unmute, getuid, info, loadkey, read, firmver" sys.exit() r = readers() if len(r) < 1: print "error: No readers available!" sys.exit() print "Available readers: ", r reader = r[0] print "Using: ", reader connection = reader.createConnection() connection.connect() #detect command cmd = sys.argv[1] if cmd == "help": print "usage: python nfctool.py <command>\nList of available commands: help, mute, unmute, getuid" print "Before executing command, make sure that a card is being tagged on the reader." print "\thelp\tShow this help page" print "\tmute\tDisable beep sound when card is tagged." print "\tunmute\tEnable beep sound when card is tagged." print "\tgetuid\tPrint UID of the tagged card." print "\tinfo\tPrint card type and available protocols." print "\tloadkey <key>\tLoad key <key> (6byte hexstring) for auth." print "\tread <sector>\tRead sector <sector> with loaded key." #print "\tread [-s <sector>] [-h | -a] [-d | -t] \tRead sector <sector> (or all sectors) with loaded key. Print as [hex | ascii]. Print [data only | trailer only]" print "\tfirmver\tPrint the firmware version of the reader." sys.exit() cmdMap = { "mute":[0xFF, 0x00, 0x52, 0x00, 0x00], "unmute":[0xFF, 0x00, 0x52, 0xFF, 0x00], "getuid":[0xFF, 0xCA, 0x00, 0x00, 0x00], "firmver":[0xFF, 0x00, 0x48, 0x00, 0x00], } COMMAND = cmdMap.get(cmd, cmd) #send command if type(COMMAND) == list: data, sw1, sw2 = connection.transmit(COMMAND) if cmd == "firmver": print cmd +": "+ ''.join(chr(i) for i in data)+chr(sw1)+chr(sw2) else: print cmd + ": " + toHexString(data) print "Status words: %02X %02X" % (sw1, sw2) if (sw1, sw2) == (0x90, 0x0): print "Status: The operation completed successfully." elif (sw1, sw2) == (0x63, 0x0): print "Status: The operation failed." elif type(COMMAND) == str: if COMMAND == "info": print "###Tag Info###" atr = ATR(connection.getATR()) hb = toHexString(atr.getHistoricalBytes()) cardname = hb[-17:-12] cardnameMap = { "00 01": "MIFARE Classic 1K", "00 02": "MIFARE Classic 4K", "00 03": "MIFARE Ultralight", "00 26": "MIFARE Mini", "F0 04": "Topaz and Jewel", "F0 11": "FeliCa 212K", "F0 11": "FeliCa 424K" } name = cardnameMap.get(cardname, "unknown") print "Card Name: "+ name print "T0 supported: ", atr.isT0Supported() print "T1 supported: ", atr.isT1Supported() print "T15 suppoerted: ", atr.isT15Supported() elif COMMAND == "loadkey": if (len(sys.argv) < 3): print "usage: python nfctool.py loadkey <key>" print "ex) python nfctool.py loadkey FFFFFFFFFFFF" sys.exit() COMMAND = [0xFF, 0x82, 0x00, 0x00, 0x06] key = [sys.argv[2][0:2], sys.argv[2][2:4], sys.argv[2][4:6], sys.argv[2][6:8], sys.argv[2][8:10], sys.argv[2][10:12]] for i in range(6): key[i] = int(key[i], 16) COMMAND.extend(key) data, sw1, sw2 = connection.transmit(COMMAND) print "Status words: %02X %02X" % (sw1, sw2) if (sw1, sw2) == (0x90, 0x0): print "Status: Key is loaded successfully to key #0." elif (sw1, sw2) == (0x63, 0x0): print "Status: Failed to load key." elif COMMAND == "read": # decrypt first block of sector with key. if succeed, sector is unlocked # if other sector is unlocked, previous sector is locked COMMAND = [0xFF, 0x86, 0x00, 0x00, 0x05, 0x01, 0x00, int(sys.argv[2])*4, 0x60, 0x00] data, sw1, sw2 = connection.transmit(COMMAND) if (sw1, sw2) == (0x90, 0x0): print "Status: Decryption sector "+ sys.argv[2] +" using key #0 as Key A successful." elif (sw1, sw2) == (0x63, 0x0): print "Status: Decryption sector "+ sys.argv[2] +" failed. Trying as Key B" COMMAND = [0xFF, 0x86, 0x00, 0x00, 0x05, 0x01, 0x00, int(sys.argv[2])*4, 0x61, 0x00] data, sw1, sw2 = connection.transmit(COMMAND) if (sw1, sw2) == (0x90, 0x0): print "Status: Decryption sector "+ sys.argv[2] +" using key #0 as Key B successful." elif (sw1, sw2) == (0x63, 0x0): print "Status: Decryption sector "+ sys.argv[2] +" failed." sys.exit() # TODO -h -a for hex/ascii, -d -t for data/trailer, none for all, -s <sector> for certain sector print "---------------------------------Sector "+ sys.argv[2] +"---------------------------------" for block in range(int(sys.argv[2])*4, int(sys.argv[2])*4+4): COMMAND = [0xFF, 0xB0, 0x00] COMMAND.append(block) COMMAND.append(16) data, sw1, sw2 = connection.transmit(COMMAND) print "block "+ str(block) +":\t"+ toHexString(data) +" | "+''.join(chr(i) for i in data) print "Status words: %02X %02X" % (sw1, sw2) if (sw1, sw2) == (0x90, 0x0): print "Status: The operation completed successfully." elif (sw1, sw2) == (0x63, 0x0): print "Status: The operation failed. Maybe auth is needed." else: print "error: Undefined command: "+ cmd +"\nUse \"help\" command for command list." sys.exit() |
output:
1 2 3 4 5 |
Available readers: ['ACS ACR1252 CL Reader [ACR1252 Reader PICC] 00 00'] Using: ACS ACR1252 CL Reader [ACR1252 Reader PICC] 00 00 getuid: 04 B4 CB 09 F8 01 80 Status words: 90 00 Status: The operation completed successfully. |
Script to pull every second:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
from smartcard.System import readers from smartcard.util import toHexString from smartcard.ATR import ATR from smartcard.CardType import AnyCardType from time import sleep import sys r = readers() reader = r[0] print "Using: ", reader connection = reader.createConnection() while True: try: connection.connect() data = connection.transmit([0xFF, 0xCA, 0x00, 0x00, 0x00]) # Get UID if len(data) > 1: print data data = "" sleep(1) except: sleep(1) |
output:
1 2 3 4 5 6 |
Using: ACS ACR1252 CL Reader [ACR1252 Reader PICC] 00 00 ([4, 49, 95, 42, 116, 57, 128], 144, 0) ([4, 49, 95, 42, 116, 57, 128], 144, 0) ([4, 49, 95, 42, 116, 57, 128], 144, 0) ([4, 180, 203, 9, 248, 1, 128], 144, 0) ([4, 180, 203, 9, 248, 1, 128], 144, 0) |
Drivers
Schema
GEEN GEGEVENS
Teardown
GEEN GEGEVENS
Datasheet
Fritzing
GEEN GEGEVENS
Downloads
GEEN GEGEVENS