Skip to content

Reader appears to not read in thread #50

@Grandpa-G

Description

@Grandpa-G

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)

`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions