Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 | RFID Reader Service dead after a while #912

Closed
jo-me opened this issue Apr 20, 2020 · 6 comments
Closed

🐛 | RFID Reader Service dead after a while #912

jo-me opened this issue Apr 20, 2020 · 6 comments
Labels
Milestone

Comments

@jo-me
Copy link

jo-me commented Apr 20, 2020

Bug

What I did

Left the working box on over the night doing nothing.

What happened

On the next morning, the box did not respond to any of the RFID tags.
Enabling "DEBUG_rfid_trigger_play_sh" did not produce any logs, so it seems like the service crashed or stopped working for some reason.
Syslog also did not show any logs when scanning.

I restarted the "RFID Reader" service via web ui and then it worked again.
Also logs came from the rfid trigger script.

I expected this to happen

working rfid

Further information that might help

.

Software

Base image and version

latest buster

Branch / Release

master

Installscript

buster

Hardware

RaspberryPi version

2

RFID Reader

RC522

Soundcard

Hifiberry Miniamp

Other notable hardware

OnoffShim

@jo-me jo-me added the bug label Apr 20, 2020
@jo-me
Copy link
Author

jo-me commented Apr 20, 2020

I can reproduce this by setting the second swipe action to "only system commands" and putting a card on the reader without removing it.

The debug.log will show the "Do nothing" logs freuqently but sometimes it hangs for a short time and continues and sometimes the log output just stops without recovering from it. I then have to go and restart the rfid service. through the UI or systemctl command.

In the situation where the log output stops, the systemd service seems to be still running (checked via sudo systemctl status phoniebox-rfid-reader)

I'm using the Reader.py.experimental version for the RC522.

@jo-me
Copy link
Author

jo-me commented Apr 20, 2020

So, after debugging around for a bit, I found that the rfid scanning did not hang due to the service or script execution but due to an upstream problem with the pi-rc522 library that is used for the RC522 scanners. In the Reader.py it was stuck in the self.device.wait_for_tag() call which caused the hangups.

There is an issue over in the pi-rc522 project that is pretty much identical to mine: ondryaso/pi-rc522#48
The proposed fix is a change in that same function and has already been merged to master.

The issue is that the library version installed by the installer script is not identical to the master branch of the pi-rc522 project.

I copied the code of the function over from the other project and let the card sit on the reader for over an hour without hangups. They usually occurred within the first minute or so.

Not sure why other people don't seem to have the same issues with the rc522 reader...

@s-martin
Copy link
Collaborator

On develop branch this is already fixed, please see PR #840.

So there the local copy is dropped and the most recent version of pi-rc522 is used.

We should release version 2.0 (#890) "soon", nevertheless I can't give you a time of arrival.

In the meantime you could either install from develop (which could have other issue) or manually port the changes of #840 to your installation.

@s-martin
Copy link
Collaborator

Ok, just checked and I'm not sure, if packed version on pypi (which we use) is incorporating the latest updates from the GitHub repo.

@s-martin
Copy link
Collaborator

We should check, if we should install from the GitHub repo directly.

@MiczFlor
Copy link
Owner

MiczFlor commented May 2, 2020

I close this, because the changes were merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants