kormax / apple-home-key-reader

Apple Home Key Reader Implementation
Apache License 2.0
557 stars 45 forks source link

Nothing happens when putting my phone next to the NFC reader #26

Closed adisharabani closed 5 months ago

adisharabani commented 5 months ago

Hi, First of all - kudos for a great project! I managed to install and run the project on my raspberry zero, and add the "lock" device to my homekit. I can see the home key in my wallet, but nothing happens when I put my phone next to the NFC reader. I'm using "HiLetgo PN532 NFC NXP RFID Module V3 Kit" ( https://www.amazon.com/dp/B01I1J17LC ).

Would appriciate your help in debugging this issue and attaching the logs from the first run (in which I added the accessory using my phone). At the end, the program doesn't print any output even if I place my phone next to the NFC reader. I've also attached the logs of the second run (which behaves the same - but doesn't go through all the NFC handshake as the key was already set up):

adi@raspberrypi:~/apple-home-key-reader $ python main.py [ 20:48:30,684] [ ERROR] repository :42 Could not load Home Key configuration. Assuming that device is not yet configured... Traceback (most recent call last): File "/", line 30, in _load_state_from_file configuration = json.load(open(self.storage_file_path, "r+")) FileNotFoundError: [Errno 2] No such file or directory: 'homekey.json' [ 20:48:30,715] [ INFO] accessory_driver :483 Loading Accessory state from hap.state [ 20:48:30,719] [ INFO] accessory_driver :320 Starting the event loop [ 20:48:30,719] [ ERROR] service :175 Connecting to the NFC reader... NoneType: None [ 20:48:30,722] [ INFO] init :148 searching for reader on path tty:AMA0:pn532 [ 20:48:30,725] [ INFO] accessory_driver :372 Starting accessory NFC Lock on addresses ['192.168.1.106'], port 51926. To use the QR Code feature, use 'pip install HAP-python[QRCode]' Enter this code in your HomeKit app on your iOS device: [ 20:48:56,842] [ INFO] hap_protocol :82 ('192.168.1.35', 52665): Connection made to NFC Lock [ 20:49:19,030] [ INFO] accessory_driver :694 Paired with b'' with permissions b'\x01'. [ 20:49:19,097] [ INFO] hap_protocol :82 ('192.168.1.35', 52668): Connection made to NFC Lock [ 20:49:19,175] [ INFO] service :105 Adding issuer Issuer(public_key=, endpoints=[]) based on paired clients [ 20:49:19,178] [ INFO] accessory :138 get_hardware_finish [ 20:49:19,178] [ INFO] service :281 get_hardware_finish= [ 20:49:19,179] [ INFO] accessory :115 get_lock_current_state [ 20:49:19,179] [ INFO] accessory :119 get_lock_target_state [ 20:49:19,180] [ INFO] accessory :129 get_lock_version [ 20:49:19,180] [ INFO] accessory :158 get_configuration_state [ 20:49:19,180] [ INFO] service :336 get_configuration_state [ 20:49:19,181] [ INFO] accessory :148 get_nfc_access_control_point [ 20:49:19,181] [ INFO] service :294 get_nfc_access_control_point [ 20:49:19,181] [ INFO] accessory :143 get_nfc_access_supported_configuration [ 20:49:19,182] [ INFO] service :290 TODO get_nfc_access_supported_configuration= [ 20:49:19,519] [ INFO] hap_protocol :82 ('192.168.1.144', 63762): Connection made to NFC Lock [ 20:49:19,584] [ ERROR] hap_handler :581 NFC Lock: Client ('192.168.1.144', 63762) with uuid attempted pair verify without being paired first (public_key=, paired clients={UUID(''): ''}). [ 20:49:19,684] [ INFO] hap_protocol :82 ('192.168.1.144', 63763): Connection made to NFC Lock [ 20:49:20,036] [ INFO] accessory :138 get_hardware_finish [ 20:49:20,036] [ INFO] service :281 get_hardware_finish= [ 20:49:20,037] [ INFO] accessory :115 get_lock_current_state [ 20:49:20,038] [ INFO] accessory :119 get_lock_target_state [ 20:49:20,038] [ INFO] accessory :129 get_lock_version [ 20:49:20,039] [ INFO] accessory :158 get_configuration_state [ 20:49:20,039] [ INFO] service :336 get_configuration_state [ 20:49:20,040] [ INFO] accessory :148 get_nfc_access_control_point [ 20:49:20,040] [ INFO] service :294 get_nfc_access_control_point [ 20:49:20,041] [ INFO] accessory :143 get_nfc_access_supported_configuration [ 20:49:20,041] [ INFO] service :290 TODO get_nfc_access_supported_configuration= [ 20:49:20,125] [ INFO] accessory :153 set_nfc_access_control_point = [ 20:49:20,125] [ INFO] service :298 <-- (B64) = [ 20:49:20,126] [ INFO] service :300 <-- (TLV) [ 20:49:20,128] [ INFO] service :302 <-- (OBJ) ControlPointRequest(operation=GET(0x01), reader_key_request=ReaderKeyRequest()) [ 20:49:20,128] [ INFO] service :328 --> (OBJ) ControlPointResponse(reader_key_response=ReaderKeyResponse(key_identifier=)) [ 20:49:20,129] [ INFO] service :330 --> (TLV) [ 20:49:20,129] [ INFO] service :332 --> (B64) [ 20:49:20,145] [ INFO] accessory :153 set_nfc_access_control_point = [ 20:49:20,145] [ INFO] service :298 <-- (B64) = [ 20:49:20,146] [ INFO] service :300 <-- (TLV) [ 20:49:20,147] [ INFO] service :302 <-- (OBJ) ControlPointRequest(operation=GET(0x01), reader_key_request=ReaderKeyRequest()) [ 20:49:20,147] [ INFO] service :328 --> (OBJ) ControlPointResponse(reader_key_response=ReaderKeyResponse(key_identifier=)) [ 20:49:20,148] [ INFO] service :330 --> (TLV) [ 20:49:20,148] [ INFO] service :332 --> (B64) [ 20:49:20,188] [ INFO] accessory :138 get_hardware_finish [ 20:49:20,189] [ INFO] service :281 get_hardware_finish= [ 20:49:20,208] [ INFO] accessory :153 set_nfc_access_control_point = [ 20:49:20,208] [ INFO] service :298 <-- (B64) = [ 20:49:20,209] [ INFO] service :300 <-- (TLV) [ 20:49:20,210] [ INFO] service :302 <-- (OBJ) ControlPointRequest(operation=GET(0x01), reader_key_request=ReaderKeyRequest()) [ 20:49:20,211] [ INFO] service :328 --> (OBJ) ControlPointResponse(reader_key_response=ReaderKeyResponse(key_identifier=)) [ 20:49:20,211] [ INFO] service :330 --> (TLV) [ 20:49:20,212] [ INFO] service :332 --> (B64) [ 20:49:20,234] [ INFO] accessory :153 set_nfc_access_control_point = [ 20:49:20,235] [ INFO] service :298 <-- (B64) = [ 20:49:20,235] [ INFO] service :300 <-- (TLV) [ 20:49:20,236] [ INFO] service :302 <-- (OBJ) ControlPointRequest(operation=GET(0x01), reader_key_request=ReaderKeyRequest()) [ 20:49:20,237] [ INFO] service :328 --> (OBJ) ControlPointResponse(reader_key_response=ReaderKeyResponse(key_identifier=)) [ 20:49:20,237] [ INFO] service :330 --> (TLV) [ 20:49:20,238] [ INFO] service :332 --> (B64) [ 20:49:20,247] [ INFO] accessory :153 set_nfc_access_control_point [ 20:49:20,248] [ INFO] service :298 <-- (B64) [ 20:49:20,248] [ INFO] service :300 <-- (TLV) [ 20:49:20,250] [ INFO] service :302 <-- (OBJ) ControlPointRequest(operation=REMOVE(0x03), reader_key_request=ReaderKeyRequest(key_identifier=)) [ 20:49:20,253] [ INFO] service :328 --> (OBJ) ControlPointResponse(reader_key_response=ReaderKeyResponse(status=SUCCESS(0x00))) [ 20:49:20,254] [ INFO] service :330 --> (TLV) [ 20:49:20,254] [ INFO] service :332 --> (B64) = [ 20:49:20,340] [ INFO] accessory :153 set_nfc_access_control_point [ 20:49:20,340] [ INFO] service :298 <-- (B64) [ 20:49:20,341] [ INFO] service :300 <-- (TLV) [ 20:49:20,342] [ INFO] service :302 <-- (OBJ) ControlPointRequest(operation=REMOVE(0x03), reader_key_request=ReaderKeyRequest(key_identifier=)) [ 20:49:20,345] [ INFO] service :328 --> (OBJ) ControlPointResponse(reader_key_response=ReaderKeyResponse(status=SUCCESS(0x00))) [ 20:49:20,346] [ INFO] service :330 --> (TLV) [ 20:49:20,347] [ INFO] service :332 --> (B64) = [ 20:49:20,369] [ INFO] accessory :153 set_nfc_access_control_point [ 20:49:20,370] [ INFO] service :298 <-- (B64) [ 20:49:20,370] [ INFO] service :300 <-- (TLV) [ 20:49:20,372] [ INFO] service :302 <-- (OBJ) ControlPointRequest(operation=REMOVE(0x03), reader_key_request=ReaderKeyRequest(key_identifier=)) [ 20:49:20,375] [ INFO] service :328 --> (OBJ) ControlPointResponse(reader_key_response=ReaderKeyResponse(status=SUCCESS(0x00))) [ 20:49:20,375] [ INFO] service :330 --> (TLV) [ 20:49:20,376] [ INFO] service :332 --> (B64) = [ 20:49:20,403] [ INFO] accessory :153 set_nfc_access_control_point == [ 20:49:20,403] [ INFO] service :298 <-- (B64) == [ 20:49:20,404] [ INFO] service :300 <-- (TLV) [ 20:49:20,406] [ INFO] service :302 <-- (OBJ) ControlPointRequest(operation=ADD(0x02), reader_key_request=ReaderKeyRequest(key_type=SECP256R1(0x02), reader_private_key=, unique_reader_identifier=)) [ 20:49:20,412] [ INFO] service :328 --> (OBJ) ControlPointResponse(reader_key_response=ReaderKeyResponse(status=SUCCESS(0x00))) [ 20:49:20,412] [ INFO] service :330 --> (TLV) [ 20:49:20,413] [ INFO] service :332 --> (B64) = [ 20:49:20,444] [ INFO] accessory :153 set_nfc_access_control_point == [ 20:49:20,444] [ INFO] service :298 <-- (B64) == [ 20:49:20,445] [ INFO] service :300 <-- (TLV) [ 20:49:20,446] [ INFO] service :302 <-- (OBJ) ControlPointRequest(operation=ADD(0x02), reader_key_request=ReaderKeyRequest(key_type=SECP256R1(0x02), reader_private_key=, unique_reader_identifier=)) [ 20:49:20,447] [ INFO] service :328 --> (OBJ) ControlPointResponse(reader_key_response=ReaderKeyResponse(status=DUPLICATE(0x02))) [ 20:49:20,448] [ INFO] service :330 --> (TLV) [ 20:49:20,448] [ INFO] service :332 --> (B64) = [ 20:49:20,476] [ INFO] accessory :153 set_nfc_access_control_point == [ 20:49:20,477] [ INFO] service :298 <-- (B64) == [ 20:49:20,477] [ INFO] service :300 <-- (TLV) [ 20:49:20,478] [ INFO] service :302 <-- (OBJ) ControlPointRequest(operation=ADD(0x02), reader_key_request=ReaderKeyRequest(key_type=SECP256R1(0x02), reader_private_key=, unique_reader_identifier=)) [ 20:49:20,479] [ INFO] service :328 --> (OBJ) ControlPointResponse(reader_key_response=ReaderKeyResponse(status=DUPLICATE(0x02))) [ 20:49:20,480] [ INFO] service :330 --> (TLV) [ 20:49:20,480] [ INFO] service :332 --> (B64) = [ 20:49:20,520] [ INFO] accessory :153 set_nfc_access_control_point [ 20:49:20,520] [ INFO] service :298 <-- (B64) [ 20:49:20,521] [ INFO] service :300 <-- (TLV) [ 20:49:20,522] [ INFO] service :302 <-- (OBJ) ControlPointRequest(operation=REMOVE(0x03), reader_key_request=ReaderKeyRequest(key_identifier=)) [ 20:49:20,523] [ INFO] service :328 --> (OBJ) ControlPointResponse(reader_key_response=ReaderKeyResponse(status=DOES_NOT_EXIST(0x03))) [ 20:49:20,523] [ INFO] service :330 --> (TLV) [ 20:49:20,524] [ INFO] service :332 --> (B64) = [ 20:49:20,536] [ INFO] accessory :153 set_nfc_access_control_point = [ 20:49:20,536] [ INFO] service :298 <-- (B64) = [ 20:49:20,537] [ INFO] service :300 <-- (TLV) [ 20:49:20,538] [ INFO] service :302 <-- (OBJ) ControlPointRequest(operation=GET(0x01), reader_key_request=ReaderKeyRequest()) [ 20:49:20,539] [ INFO] service :328 --> (OBJ) ControlPointResponse(reader_key_response=ReaderKeyResponse(key_identifier=)) [ 20:49:20,539] [ INFO] service :330 --> (TLV) [ 20:49:20,540] [ INFO] service :332 --> (B64) + [ 20:49:20,710] [ INFO] accessory :153 set_nfc_access_control_point = [ 20:49:20,710] [ INFO] service :298 <-- (B64) = [ 20:49:20,711] [ INFO] service :300 <-- (TLV) [ 20:49:20,712] [ INFO] service :302 <-- (OBJ) ControlPointRequest(operation=GET(0x01), reader_key_request=ReaderKeyRequest()) [ 20:49:20,713] [ INFO] service :328 --> (OBJ) ControlPointResponse(reader_key_response=ReaderKeyResponse(key_identifier=)) [ 20:49:20,714] [ INFO] service :330 --> (TLV) [ 20:49:20,714] [ INFO] service :332 --> (B64) + [ 20:49:23,358] [ INFO] accessory_driver :694 Paired with b'' with permissions b'\x01'. [ 20:49:24,948] [ INFO] accessory :153 set_nfc_access_control_point = [ 20:49:24,949] [ INFO] service :298 <-- (B64) = [ 20:49:24,950] [ INFO] service :300 <-- (TLV) [ 20:49:24,951] [ INFO] service :302 <-- (OBJ) ControlPointRequest(operation=GET(0x01), reader_key_request=ReaderKeyRequest()) [ 20:49:24,952] [ INFO] service :328 --> (OBJ) ControlPointResponse(reader_key_response=ReaderKeyResponse(key_identifier=)) [ 20:49:24,952] [ INFO] service :330 --> (TLV) [ 20:49:24,953] [ INFO] service :332 --> (B64) + [ 20:49:24,961] [ INFO] accessory :153 set_nfc_access_control_point = [ 20:49:24,962] [ INFO] service :298 <-- (B64) = [ 20:49:24,962] [ INFO] service :300 <-- (TLV) [ 20:49:24,963] [ INFO] service :302 <-- (OBJ) ControlPointRequest(operation=GET(0x01), reader_key_request=ReaderKeyRequest()) [ 20:49:24,964] [ INFO] service :328 --> (OBJ) ControlPointResponse(reader_key_response=ReaderKeyResponse(key_identifier=)) [ 20:49:24,965] [ INFO] service :330 --> (TLV) [ 20:49:24,965] [ INFO] service :332 --> (B64) + [ 20:49:25,040] [ INFO] accessory_driver :694 Paired with b'' with permissions b'\x01'. [ 20:49:26,745] [ INFO] accessory_driver :694 Paired with b'' with permissions b'\x01'. [ 20:49:26,872] [ INFO] accessory :119 get_lock_target_state [ 20:49:26,873] [ INFO] accessory :115 get_lock_current_state [ 20:49:28,699] [ INFO] accessory_driver :694 Paired with b'' with permissions b'\x01'. [ 20:49:30,673] [ INFO] accessory_driver :694 Paired with b'' with permissions b'\x01'. [ 20:49:32,219] [ INFO] accessory_driver :694 Paired with b'' with permissions b'\x01'. [ 20:49:40,715] [ INFO] hap_protocol :82 ('192.168.1.35', 52673): Connection made to NFC Lock [ 20:49:40,834] [ INFO] service :105 Adding issuer Issuer(public_key=, endpoints=[]) based on paired clients [ 20:49:40,838] [ INFO] service :105 Adding issuer Issuer(public_key=, endpoints=[]) based on paired clients [ 20:49:40,842] [ INFO] service :105 Adding issuer Issuer(public_key=, endpoints=[]) based on paired clients [ 20:49:40,846] [ INFO] service :105 Adding issuer Issuer(public_key=, endpoints=[]) based on paired clients [ 20:49:40,850] [ INFO] service :105 Adding issuer Issuer(public_key=, endpoints=[]) based on paired clients [ 20:49:40,855] [ INFO] accessory :138 get_hardware_finish [ 20:49:40,856] [ INFO] service :281 get_hardware_finish= [ 20:49:40,857] [ INFO] accessory :115 get_lock_current_state [ 20:49:40,857] [ INFO] accessory :119 get_lock_target_state [ 20:49:40,858] [ INFO] accessory :129 get_lock_version [ 20:49:40,858] [ INFO] accessory :158 get_configuration_state [ 20:49:40,859] [ INFO] service :336 get_configuration_state [ 20:49:40,859] [ INFO] accessory :148 get_nfc_access_control_point [ 20:49:40,860] [ INFO] service :294 get_nfc_access_control_point [ 20:49:40,860] [ INFO] accessory :143 get_nfc_access_supported_configuration [ 20:49:40,861] [ INFO] service :290 TODO get_nfc_access_supported_configuration= [ 20:49:43,275] [ INFO] accessory :119 get_lock_target_state [ 20:49:43,275] [ INFO] accessory :115 get_lock_current_state [ 20:49:44,565] [ INFO] accessory :115 get_lock_current_state [ 20:49:44,566] [ INFO] accessory :119 get_lock_target_state [ 20:49:56,250] [ INFO] accessory :153 set_nfc_access_control_point [ 20:49:56,251] [ INFO] service :298 <-- (B64) [ 20:49:56,251] [ INFO] service :300 <-- (TLV) [ 20:49:56,254] [ INFO] service :302 <-- (OBJ) ControlPointRequest(operation=ADD(0x02), device_credential_request=DeviceCredentialRequest(key_type=SECP256R1(0x02), credential_public_key=, issuer_key_identifier=, key_state=ACTIVE(0x01))) [ 20:49:56,255] [ INFO] service :227 add_device_credential endpoint=None [ 20:49:56,257] [ INFO] service :243 add_device_credential issuer=Issuer(public_key=, endpoints=[]) [ 20:49:56,265] [ INFO] service :328 --> (OBJ) ControlPointResponse(device_credential_response=DeviceCredentialResponse(issuer_key_identifier=, status=DUPLICATE(0x02))) [ 20:49:56,266] [ INFO] service :330 --> (TLV) [ 20:49:56,267] [ INFO] service :332 --> (B64) [ 20:50:00,968] [ INFO] accessory :138 get_hardware_finish [ 20:50:00,969] [ INFO] service :281 get_hardware_finish= [ 20:50:03,275] [ INFO] accessory :138 get_hardware_finish [ 20:50:03,276] [ INFO] service :281 get_hardware_finish= [ 20:50:04,940] [ INFO] accessory :138 get_hardware_finish [ 20:50:04,941] [ INFO] service :281 get_hardware_finish= [ 20:50:06,247] [ INFO] accessory :153 set_nfc_access_control_point [ 20:50:06,247] [ INFO] service :298 <-- (B64) [ 20:50:06,248] [ INFO] service :300 <-- (TLV) [ 20:50:06,250] [ INFO] service :302 <-- (OBJ) ControlPointRequest(operation=ADD(0x02), device_credential_request=DeviceCredentialRequest(key_type=SECP256R1(0x02), credential_public_key=, issuer_key_identifier=, key_state=ACTIVE(0x01))) [ 20:50:06,252] [ INFO] service :227 add_device_credential endpoint=None [ 20:50:06,254] [ INFO] service :243 add_device_credential issuer=Issuer(public_key=, endpoints=[]) [ 20:50:06,261] [ INFO] service :328 --> (OBJ) ControlPointResponse(device_credential_response=DeviceCredentialResponse(issuer_key_identifier=, status=DUPLICATE(0x02))) [ 20:50:06,262] [ INFO] service :330 --> (TLV) [ 20:50:06,262] [ INFO] service :332 --> (B64) [ 20:50:08,189] [ INFO] accessory :138 get_hardware_finish [ 20:50:08,190] [ INFO] service :281 get_hardware_finish= [ 20:50:09,153] [ INFO] accessory :138 get_hardware_finish [ 20:50:09,154] [ INFO] service :281 get_hardware_finish= [ 20:50:09,387] [ INFO] accessory :153 set_nfc_access_control_point [ 20:50:09,388] [ INFO] service :298 <-- (B64) [ 20:50:09,388] [ INFO] service :300 <-- (TLV) [ 20:50:09,390] [ INFO] service :302 <-- (OBJ) ControlPointRequest(operation=ADD(0x02), device_credential_request=DeviceCredentialRequest(key_type=SECP256R1(0x02), credential_public_key=, issuer_key_identifier=, key_state=ACTIVE(0x01))) [ 20:50:09,393] [ INFO] service :227 add_device_credential endpoint=None [ 20:50:09,396] [ INFO] service :243 add_device_credential issuer=Issuer(public_key=, endpoints=[]) [ 20:50:09,403] [ INFO] service :328 --> (OBJ) ControlPointResponse(device_credential_response=DeviceCredentialResponse(issuer_key_identifier=, status=DUPLICATE(0x02))) [ 20:50:09,404] [ INFO] service :330 --> (TLV) [ 20:50:09,405] [ INFO] service :332 --> (B64)

^\Quit adi@raspberrypi:~/apple-home-key-reader $ python main.py [ 20:51:26,921] [ INFO] accessory_driver :483 Loading Accessory state from hap.state [ 20:51:26,925] [ INFO] accessory_driver :320 Starting the event loop [ 20:51:26,926] [ ERROR] service :175 Connecting to the NFC reader... NoneType: None [ 20:51:26,929] [ INFO] init :148 searching for reader on path tty:AMA0:pn532 [ 20:51:26,929] [ INFO] accessory_driver :372 Starting accessory NFC Lock on addresses ['192.168.1.106'], port 51926. [ 20:51:39,051] [ INFO] hap_protocol :82 ('192.168.1.144', 63805): Connection made to NFC Lock [ 20:51:39,130] [ INFO] accessory :138 get_hardware_finish [ 20:51:39,131] [ INFO] service :281 get_hardware_finish= [ 20:51:39,132] [ INFO] accessory :115 get_lock_current_state [ 20:51:39,133] [ INFO] accessory :119 get_lock_target_state [ 20:51:39,133] [ INFO] accessory :129 get_lock_version [ 20:51:39,134] [ INFO] accessory :158 get_configuration_state [ 20:51:39,134] [ INFO] service :336 get_configuration_state [ 20:51:39,135] [ INFO] accessory :148 get_nfc_access_control_point [ 20:51:39,135] [ INFO] service :294 get_nfc_access_control_point [ 20:51:39,135] [ INFO] accessory :143 get_nfc_access_supported_configuration [ 20:51:39,137] [ INFO] service :290 TODO get_nfc_access_supported_configuration=

^\Quit

adisharabani commented 5 months ago

This is my configuration file (in case its relevant): { "logging": { "level": 20 },

"nfc": {
    "port": "AMA0", 
    "driver": "pn532",
    "broadcast": true
},

"hap": {
    "port": 51926,
    "persist": "hap.state",
    "default": "locked"
},

"homekey": {
    "persist": "homekey.json",
    "express": true,
    "finish": "silver",
    "flow": "fast"
}

}

kormax commented 5 months ago

Did you try authenticating the card on the device manually and bringing it to the reader?

Interesting to see if it's going to communicate or display any activity in logs at all.

adisharabani commented 5 months ago

If you mean opening the wallet app and selecting the card. Yes I did :(

kormax commented 5 months ago

By selecting, you mean that you've double clicked the power button and authenticated with FaceID too?

So that it says "Hold Near Lock"?

JanL111 commented 5 months ago

Do you use the GPIO pins to connect the reader?

kormax commented 5 months ago

I assume the reader is connected properly as there are no communication errors (with the reader) in logs.

JanL111 commented 5 months ago

Hmm... are you sure? I've tried a similar setup with a Raspberry PI Zero 2 and I miss one line in the log which should look similar to this:

[2024-04-06 10:08:09,289] [ INFO] init :151 using PN532v1.6 at /dev/ttyAMA0

btw. it's such a great project!

adisharabani commented 5 months ago

@kormax yes I used the wallet authentication properly. I believe there might be something with the communication as I do not see the line @JanL111 mentioned seen in their environment. My pins are connected as follows: Pn532 GND <=> RPZero Ground (pin 6) Pn532 VCC <=> RPZero 5V (pin 4) Pn532 TXD <=> RPZero RXD (pin 10) Pn532 RXD <=> RPZero TXD (pin 8)

I wonder if there is a way just to check/test the reader to eliminate other possible problems

adisharabani commented 5 months ago

Also, in my configuration I set the port to AMA0 (without the tty - making sure that is correct)

JanL111 commented 5 months ago

I'm using the same ports. The problem is that you have to configure two things before the reader can use the port.

  1. disable the login shell for the serial port and activate the serial port
  2. disable bluetooth

use "sudo raspi-config" --> "3 Interface Options" --> "I6 Serial Port" --> No --> Yes use "sudo nano /boot/config.txt" and add this line to the end of the file "dtoverlay=disable-bt"

The end of the config file should look like this:

[all] enable_uart=1 dtoverlay=disable-bt

adisharabani commented 5 months ago

@JanL111 thank you so much - these two configuration items fixed my problem

adisharabani commented 5 months ago

Closing this issue and thank you @JanL111 and @kormax for the immediate responses!

kormax commented 5 months ago

@JanL111 many thanks for helping to diagnose this issue.