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

Investigate sensor connection state #233

Open andreievg opened 1 year ago

andreievg commented 1 year ago

A few questions to be answered.

Does the app try to maintain connection with sensor between sensor operations ? Does sensor consume more battery when connection is maintain or when it's dropped (i.e. the overhead of acquiring connection vs maintaining connection) ?

It maybe hard to test above, perhaps this was already answered, we just have to find the resource. My gut feeling is that it's best to close the connection and only have it opening during ble operation.

This issue was triggered by this PR: https://github.com/openmsupply/msupply-cold-chain/pull/231:

As mentioned, the sensors are disconnected and then reconnected before downloading data. This means the sensor remains connected between downloads.
Perhaps after the data is read, the connection could be closed. This may improve the battery life as the sensor is then only connected when downloading data, rather than say waiting for 5 minutes for the next download. This would also reduce the comms overhead associated with maintaining the connection.
mark-prins commented 4 months ago

review after advertising packet change?