M6e Nano reading temperature during a sync tag read

Hi. Putting final touch to a very interesting project, using a Raspberry PI to interface with a M6e Nano reader (using the Mercury API library). We’re using a PIR to trigger sync tag reads on the M6e Nano and setting PowerMode=MAXSAVE to reduce power consumption and heat generation when idle.

We are now adding a fan control thread to our Python script to start a cooling fan whenever the temperature of the M6e Nano or Raspberry PI exceeds 70 degrees, and turn it off when the temperature of both is below 65 degrees.

Could there be a conflict if the fan control thread tries to read the M6e temperature at the exact same time that a sync tag read is running in the main loop? And also the other way: is we try to start a sync tag read while the M6e is responding to a temperature read request?

In the main endless loop, triggered by the PIR when movement is detected in front of the antenna:

tags_list = reader.read(timeout=5000) #read tags during 5 seconds

In the fan control thread (checking every 5 minutes):

m6e_start = str(reader.get_temperature())

Thanks in advance

Two programs trying to access the same peripheral never sounds like a good idea.

I would have a single program access M6E and read what it needs to read including temperature. Now you can go different ways :

  1. At startup create a child process with a (named) pipe to the main program. The main program will read the temperature along with other information and send the temperature data to the child program on the pipe. The child program reads the pipe and determines whether or not to turn on the fan.

  2. Store the temperature in a temporary file and let another program read that file and determine whether or not to turn on the fan.

I would also advise using a lower temperature range. The operating range for M6E according to the datasheet is set for -20C to 60C. At 85C it will stop sending and then waits until it cools down.

Thanks Paul. We are already working on queuing the M6e access as per your suggestion. Testing looks very good so far.