esprfid / esp-rfid

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

Cannot download user file with 129 users #448

Closed windy54 closed 2 years ago

windy54 commented 3 years ago

We have been using this project in our hackspace for the last two years, currently working off of the Dev branch with some local mods to fix the restart issue.

This release has been used for the last 3 months, apologies I can't give a link back to the actual version.

In the last two weeks when I come to add a new member the web interface sticks at "Please wait while fetching data .... Loading 1/9" It currently won't download any logs from SPIFFs as well.

A fortnight ago when it happened I "fixed" it by restarting several times and deleting the event and access log.

There is over 1 Meg of spare SPIFF storage.

Has anyone else had this issue?

I have scanned through all the open and closed issues and can't see it being raised before, apologies If I have missed it.

So this means I can't add any new users.

Steve

omersiar commented 3 years ago

Thank you for reporting this.

I personally did not test esp-rfid against longer period of usage. What you can do is basically troubleshoot the issue with debugging firmware, coding and luck.

I wanted to refactor log handling, rotation and sanity checks for a long time but could not find time to polish them.

windy54 commented 3 years ago

Just an update, I have enabled DEBUG and rebuilt the software. Captured the following output:

[ INFO ] received websocket command userlist [ INFO l208] WebSocket[/ws][1] error(22581): {"command":"userlist","page":8}@⸮{"command":"userlist","page":8} [ INFO ] received websocket command userlist [ WARN ] WebSocket[/ws][1] error(1002): Invalid UTF-8 in text frame8}@⸮⸮m⸮mmand":"userlist","page":8} l208 is the line number in the code where the error is reported, something I added. So there are 9 pages of users and it stopped on page 8 when the Invalid UTF-8 was reported. I think the earlier error 22581 can be ignored, I can't find it listed anywhere in websocket and also at this point everything is working. When the Invalid UTF error is reported there is a similar error on the webpage. I get the same problem when I use Chromium on my Raspberry PI, Chrome on my MAC and also Chrome in an icognito window. I am getting the same error if I try to download current users, or restore a file with just 8 users.

I have found this possible solution which I will look into https://blog.fgribreau.com/2012/05/how-to-fix-could-not-decode-text-frame.html but it means changing the encoding on the webpage and in the software.

Steve

matjack1 commented 2 years ago

Hey @windy54 I think I was consistently able to reproduce a bug like yours, and I think I have fixed it with https://github.com/esprfid/esp-rfid/pull/484

Maybe it's now too late, but would be nice if you wanted to have a go :)

I'm closing this for now as I think it's quite old and hopefully fixed, but if you have any feedback feel free to reopen!

windy54 commented 2 years ago

Hi Mateo, I am ready to try this, I have downloaded the source and built it, uploaded it and it does not work. Is there a pre-compiled binary I can use?

I have tried looking through GitHub but can’t find one.

Cheers Steve Gale

On 23 Feb 2022, at 17:37, Matteo Giaccone @.***> wrote:

 Hey @windy54 I think I was consistently able to reproduce a bug like yours, and I think I have fixed it with #484

Maybe it's now too late, but would be nice if you wanted to have a go :)

I'm closing this for now as I think it's quite old and hopefully fixed, but if you have any feedback feel free to reopen!

— Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android. You are receiving this because you were mentioned.

matjack1 commented 2 years ago

hey @windy54 you can find the latest dev binaries here: https://github.com/esprfid/esp-rfid/actions/runs/2543602273

Let me know if you can try again! Sorry for the delay :(

windy54 commented 2 years ago

I should have updated my message, I have downloaded the source and re-built it. Still had some issues which have solved, had to edit (from memory) rfid.esp to set rfidstate to cardswiped and mqtt.esp getUserList() to publish json not root. I have put the details in other posts. Had some other issues with SPIFFS being write protected so it would not save a new user, got round this by erasing the flash and starting again. It crashed though when I try and restore 120 users, I am just investigating that.

I was planning on doing a pull request when I am happy if that is the thing to do.

Steve