You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using python3 - a simple read works outside the thread but not inside. This is in a Flask script - I will try a simple thread example as well.
Update - this problem appears to be related to running in Flask
More Update - I got this to work by just adding the instantiation statement in the main thread. The when the rfid thread was setup, the code below worked. I have no idea why.
This is the cocde
` self.reader = SimpleMFRC522()
print(self.reader)
while True:
id, text = self.reader.read()
print("The ID for this card is:", id)
print(id)
sleep(1)
`
The text was updated successfully, but these errors were encountered:
I've run into this exact same issue but I've not found a reliable workaround
It seems this library just does not work in a thread which isn't ideal!?
If I instantiate the reader as per the above post, it does read 'sometimes' - it appears to read a card about once every few minutes (even if you leave the card on the reader) and it appears to slow-down the entire Pi whilst it's running in that way...
I'm going to have to switch to a proprietary reader - this just isn't fit-for-purpose - a warning on the Wiki page will save others wasting their time here...
p.s. There is a consolidated RC522 library which does seem to work in threads/on later PIs etc. here
Using python3 - a simple read works outside the thread but not inside. This is in a Flask script - I will try a simple thread example as well.
Update - this problem appears to be related to running in Flask
More Update - I got this to work by just adding the instantiation statement in the main thread. The when the rfid thread was setup, the code below worked. I have no idea why.
This is the cocde
` self.reader = SimpleMFRC522()
`
The text was updated successfully, but these errors were encountered: