esprfid / esp-rfid

ESP8266 RFID (RC522, PN532, Wiegand, RDM6300) Access Control system featuring WebSocket, JSON, NTP Client, Javascript, SPIFFS

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

config.pinCoderequested set true when a 522 reader used in latest dev build?

windy54 opened this issue · comments

I downloaded the dev build last week (Jan 9th) to investigate a couple of issues.

With a 522 reader the cards were not being read and I tracked the issue to this test
void rfidProcess() { if (rfidState == waitingRfid || (config.pinCodeRequested && rfidState == cardSwiped)) { return; }

it kept returning because config.pinCodeRequested was true.

The option to change this is only available on the web page when using a wiegand reader.

I cant see where in config.esp it is set true when a 522 reader is used, but have solved the issue by editing config.esp and adding the following
else if (config.readertype == READER_MFRC522 || config.readertype == READER_MFRC522_RDM6300) { rfidss = 15; **config.pinCodeRequested = false;** if (hardware.containsKey("sspin")) { rfidss = hardware["sspin"]; } int rfidgain = hardware["rfidgain"]; setupMFRC522Reader(rfidss, rfidgain); }

with the above mod cards are read by my 522 reader

Steve

commented

I helped myself by setting the initialization of 'pinCodeRequested' to false in config.h:
bool pinCodeRequested = false;

@windy54 @bumaas you are right!

Please have a look at this PR: #578 if you can test it.

I don't have a PN522 set up at the moment, so I cannot really test it. Thank you!

I have merged the fix in the dev branch and I'm closing this, please reopen if necessary