Open ildar opened 6 years ago
ok then. The board is soldered to work through SPI. I cut the EA ←→VDD track and connected EA ←→ GND. Now the board works through UART... mostly :)
The chip appeared to be crippled:
debug libnfc.driver.rc522_uart Upgrading baud rate to user-specified 115200 bps.
debug libnfc.bus.uart Serial port speed requested to be set to 115200 baud.
debug libnfc.bus.uart TX: 1f
debug libnfc.bus.uart RX: 00
debug libnfc.driver.rc522_uart rc522_uart_write ack does not match (sent 1F, received 00)
error libnfc.chip.rc522 Unable to write register 1F!
ok, you don't wanna 115200 bod ? then let's talk 9600:
connstring = "rc522_uart:/dev/ttyUSB0:9600"
hah! stumbled again:
$ LIBNFC_LOG_LEVEL=3 ./nfc-anticol
info libnfc.config Unable to open file: /etc/nfc/libnfc.conf
debug libnfc.config key: [device.allow_autoscan], value: [false]
info libnfc.config Unknown key in config line: device.allow_autoscan = false
debug libnfc.config key: [device.log_level], value: [3]
info libnfc.config Unknown key in config line: device.log_level = 3
debug libnfc.config key: [device.name], value: [MFRC522]
debug libnfc.config key: [device.connstring], value: [rc522_uart:/dev/ttyUSB0:9600]
debug libnfc.general log_level is set to 3
debug libnfc.general allow_autoscan is set to true
debug libnfc.general allow_intrusive_scan is set to false
debug libnfc.general 1 device(s) defined by user
debug libnfc.general #0 name: "MFRC522", connstring: "rc522_uart:/dev/ttyUSB0:9600"
debug libnfc.driver.rc522_uart Attempt to open: /dev/ttyUSB0.
debug libnfc.driver.rc522_uart Attempting to establish a connection at 9600 bps.
debug libnfc.bus.uart Serial port speed requested to be set to 9600 baud.
debug libnfc.bus.uart TX: b7
debug libnfc.bus.uart RX: 12
debug libnfc.chip.rc522 RD 37: 12
debug libnfc.chip.rc522 Aborting self test for unknown version 12.
debug libnfc.bus.uart TX: 01
debug libnfc.bus.uart RX: 01
debug libnfc.bus.uart TX: 2f
debug libnfc.chip.rc522 WR 01: 2f
debug libnfc.driver.rc522_uart Restoring baud rate to default of 9600 bps.
debug libnfc.bus.uart Serial port speed requested to be set to 9600 baud.
debug libnfc.bus.uart TX: 81
debug libnfc.bus.uart RX: 20
debug libnfc.chip.rc522 RD 01: 20
debug libnfc.driver.rc522_uart Connection with a RC522 at 9600 bps established successfully.
debug libnfc.general "�|a" (rc522_uart:/dev/ttyUSB0:9600) has been claimed.
debug libnfc.bus.uart TX: 94
debug libnfc.bus.uart RX: 80
debug libnfc.chip.rc522 RD 14: 80
debug libnfc.bus.uart TX: 14
debug libnfc.bus.uart RX: 14
debug libnfc.bus.uart TX: 80
debug libnfc.chip.rc522 WR 14: 80
debug libnfc.bus.uart TX: 94
debug libnfc.bus.uart RX: 80
debug libnfc.chip.rc522 RD 14: 80
debug libnfc.bus.uart TX: 14
debug libnfc.bus.uart RX: 14
debug libnfc.bus.uart TX: 83
debug libnfc.chip.rc522 WR 14: 83
debug libnfc.chip.rc522 Updating RF baud rate to 106kbps.
debug libnfc.bus.uart TX: 92
debug libnfc.bus.uart RX: 00
debug libnfc.chip.rc522 RD 12: 00
debug libnfc.bus.uart TX: 12
debug libnfc.bus.uart Timeout!
error libnfc.chip.rc522 Unable to write register 12!
nfc_initiator_init: Timeout
debug libnfc.bus.uart TX: 01
debug libnfc.bus.uart RX: 00
debug libnfc.driver.rc522_uart rc522_uart_write ack does not match (sent 01, received 00)
error libnfc.chip.rc522 Unable to write register 01!
The code is actually by @socram8888 (https://github.com/ildar/libnfc/tree/socram8888-pull-300)
I'll try to recompile and test it again this evening. But I am 99% sure the code did work for me with the FM17522.
I think the problem is in the chip. The command flow is quite straightforward and corresponds to datasheet. I probably have to connect it through SPI back again and test.
The self-test returns ZEROes. That's really weird. Log attached. nfc.log.txt
started documenting in wiki: https://github.com/miguelbalboa/rfid/wiki/Chinese_RFID-RC522
Could you try reading any crypto-heavy card, such as Ultralight C or DESFire? The shitty Chinese board I have seems not to send enough power to them to work, and I'm not sure if it's just my board or something that affects all Chinese fake readers.
having lettering:
Looks so: https://mysku.ru/blog/aliexpress/23114.html Not successful yet.