msupply-foundation / msupply-cold-chain

Android application for viewing and monitoring temperatures of fridges
GNU General Public License v3.0
3 stars 3 forks source link

Missing temperature data when the sensor log interval is too small (1, 2 or 3 minutes) #289

Open marthakeezy opened 5 months ago

marthakeezy commented 5 months ago

Describe the bug

When changing the default log interval for a sensor to 1, 2 or 3 minutes, and leaving it running for a bit, some logs will be missing. I have tested 1 type of interval a day, and the shorter the interval is, the more logs are missing. 4 and 5 minutes do not have any issues.

To Reproduce Steps to reproduce the behavior:

  1. Connect your sensors to the CCA and leave it running for a night. Make sure to change the default interval to 1 or 2 or 3 minutes.
  2. Once some time has passed, open your omSupply and go under Cold Chain -> Monitoring -> Log
  3. Depending on the interval you set, you will see some records are missing
  4. For example, if you are testing with 2 sensors, there should be 2 entires per interval - Sensor one at 01:01:01; Sensor 2 01:01:01, Sensor 1 02:01:01; Sensor 2 02:01:01 etc

Expected behavior

No logs should be missing even when the intervals are close to each other, e.g. 1 minute

Smartphone (please complete the following information):

Additional context I noticed, that when testing with 2 or 3 minutes, usually only one log is missing. For example, if the last log was at 23:45:01, and there is one missing at 23:48:01, then the next displayed will be 23:51:01. When testing with a 1 minute interval, more than 1 entry at a time can be missing. For example, if the last entry was at 15:01:00, then the missing ones can be 15:02:00, 15:03:00 and 15:04:00. The most I noticed was 4 entries missing at a time, which means the sensor was logging information every 4 minutes instead of 1 minute (sorry, many letters here!).

Also, because there is no way to export omSupply log records, I went through the data manually and compiled it all in a spreadsheet here: https://docs.google.com/spreadsheets/d/10oj-YuxQUUXJkZvTMpSQ9megC66YlUt59ZHEl2Z5NFE/edit#gid=1418206080

adamdewey commented 5 months ago

Nice spot @marthakeezy !

adamdewey commented 5 months ago

Possibly related to https://github.com/msupply-foundation/msupply-cold-chain/issues/270 ?

AnushaUp commented 4 months ago

@adamdewey @marthakeezy I've seen this and too frequently for 1 minute interval.

Image

marthakeezy commented 4 months ago

@AnushaUp nice one! Yes, for 1 minute interval I got the results of 142 records missing in 4 hours. Sometimes the sensor would miss 4 records before logging in next one.

mark-prins commented 4 months ago

To look at after advertising packets is done. Export on omSupply?