esprfid / esp-rfid

ESP8266 RFID (RC522, PN532, Wiegand, RDM6300) Access Control system featuring WebSocket, JSON, NTP Client, Javascript, SPIFFS
MIT License
1.37k stars 424 forks source link

Opening hours not working #631

Open neel8440924 opened 7 months ago

neel8440924 commented 7 months ago

I am using build 173 with rc522 reader. Opening hours setting not working, non admin tag can activate relay and open door in non working hours(unticked hours) and log also shows access granted?

matjack1 commented 7 months ago

hey @neel8440924 if you could please try this new PR here: https://github.com/esprfid/esp-rfid/pull/632 it might have fixed the problem.

Also, can you please check in the Settings -> NTP settings if the hour displayed is correct?

MaximeSharp commented 7 months ago

I can also confirm issue #631, it still trigger the relay even if I disable the access on Tuesday : 2024-04-23_18-30-55 2024-04-23_18-36-36

[ INFO ] PICC's UID: 90535856 MIFARE 1KB = known PICC
[ INFO ] User Name: '3' has access relay
[ INFO ] Read timeout or clean after read
mili : 1006493
activating relay 0 now
1006893
1006493
400
0
deactivate relay after this
mili : 1006893

PR #632 seems to fix this issue :

[ INFO ] PICC's UID: 90535856 MIFARE 1KB = known PICC
[ INFO ] User Name: '3' does not have access
[ INFO ] Mqtt Publish:{"cmd":"log","uid":"90535856","username":"3","access":"Disabled","time":1713892463,"doorName":""}
[ INFO ] Read timeout or clean after read
neel8440924 commented 6 months ago

I have tested this PR #632 for some time, but I don't know I think the problem is still there, I have noticed sometimes it deny access even in opening hours also, I was not able to test it fully as it was causing problem for the users so I am not using this feature for now, maybe others can test it more and report back.

matjack1 commented 6 months ago

@neel8440924 we are using this feature daily with hundreds of people and it works. The only issue that I had was with losing connection with the NTP server. If you lose that connection, then the esp can drift quite quickly and have a time very far from reality.

So if you (or someone else) want to try this feature more and if you have problems, please also attach the logs of the accesses, so that we can see at what time the access has been denied and we can check if the reason is the time drift.

Thanks!

neel8440924 commented 6 months ago

@matjack1 I have created a test setup to check it in a more controlled way and mess with settings without affecting other people. Herein this example , it denies access even in opening hours. I have attached screenshot of general setting, NTP setting, user setting as well as access logs IMG_1203 IMG_1204 IMG_1205 IMG_1206

matjack1 commented 5 months ago

hey @neel8440924 I'm very sorry for the delay here, I've just merged in the dev branch some fixes to the logs that I had made. If you want to test the latest dev build maybe it can give you better results. Let me know if you can. Thank you very much!