Improve recovery after NFC comms failure
This commit is contained in:
parent
44ece0b3b0
commit
743ac56d3a
6
main.py
6
main.py
|
@ -124,13 +124,19 @@ def reader_thread(card_data_queue):
|
||||||
with open(TEST_PIPE, 'r') as pipe:
|
with open(TEST_PIPE, 'r') as pipe:
|
||||||
success, card = (True, pipe.readline())
|
success, card = (True, pipe.readline())
|
||||||
else:
|
else:
|
||||||
|
nfc.SAMConfig()
|
||||||
success, card = nfc.readPassiveTargetID(pn532.PN532_MIFARE_ISO14443A_106KBPS)
|
success, card = nfc.readPassiveTargetID(pn532.PN532_MIFARE_ISO14443A_106KBPS)
|
||||||
|
|
||||||
|
if not TEST:
|
||||||
try:
|
try:
|
||||||
# ensure we have communication with the reader
|
# ensure we have communication with the reader
|
||||||
if nfc.getFirmwareVersion():
|
if nfc.getFirmwareVersion():
|
||||||
feed_watchdog()
|
feed_watchdog()
|
||||||
|
else:
|
||||||
|
raise
|
||||||
except:
|
except:
|
||||||
|
logging.error('Problem communicating with NFC reader!')
|
||||||
|
time.sleep(1)
|
||||||
continue
|
continue
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user