tim-hellhake / mi-flora-adapter

Mozilla Public License 2.0
1 stars 3 forks source link

Time between read requests is acting strange #7

Closed flatsiedatsie closed 5 years ago

flatsiedatsie commented 5 years ago

In the past days I've had to reset the time between reads twice. The first time it had reverted to 30, and now it was actually at 0.

I noticed because this was causing a lot of messages in the log.

2019-06-20 04:44:37.783 INFO   : mi-flora: Discovered characteristics
2019-06-20 04:44:37.798 INFO   : mi-flora: Enabled sensor mode
2019-06-20 04:44:37.813 INFO   : mi-flora: Read data characteristic
2019-06-20 04:44:37.817 INFO   : mi-flora: Saving new values to config
2019-06-20 04:44:38.310 INFO   : mi-flora: Connecting to MiFlora-------------
2019-06-20 04:44:38.711 INFO   : mi-flora: Connected to MiFlora-------------
2019-06-20 04:44:38.905 INFO   : mi-flora: Discovered services
2019-06-20 04:44:39.040 INFO   : mi-flora: Discovered characteristics
2019-06-20 04:44:39.085 INFO   : mi-flora: Enabled sensor mode
2019-06-20 04:44:39.116 INFO   : mi-flora: Read data characteristic
2019-06-20 04:44:39.120 INFO   : mi-flora: Saving new values to config
2019-06-20 04:44:40.890 INFO   : mi-flora: Connecting to MiFlora--------------
2019-06-20 04:44:41.283 INFO   : mi-flora: Connected to MiFlora--------------
2019-06-20 04:44:41.501 INFO   : mi-flora: Discovered services
2019-06-20 04:44:41.584 INFO   : mi-flora: Discovered characteristics
2019-06-20 04:44:41.607 INFO   : mi-flora: Enabled sensor mode
2019-06-20 04:44:41.622 INFO   : mi-flora: Read data characteristic
2019-06-20 04:44:41.626 INFO   : mi-flora: Saving new values to config
2019-06-20 05:14:37.063 INFO   : mi-flora: Connecting to MiFlora-------------
2019-06-20 05:14:38.311 INFO   : mi-flora: Connecting to MiFlora-------------
2019-06-20 05:14:39.824 INFO   : mi-flora: Connected to MiFlora-------------
2019-06-20 05:14:39.997 INFO   : mi-flora: Discovered services
2019-06-20 05:14:40.064 INFO   : mi-flora: Discovered characteristics
2019-06-20 05:14:40.079 INFO   : mi-flora: Enabled sensor mode
2019-06-20 05:14:40.095 INFO   : mi-flora: Read data characteristic
2019-06-20 05:14:40.098 INFO   : mi-flora: Saving new values to config
2019-06-20 05:14:40.691 INFO   : mi-flora: Connected to MiFlora-------------
2019-06-20 05:14:40.870 INFO   : mi-flora: Discovered services
2019-06-20 05:14:40.891 INFO   : mi-flora: Connecting to MiFlora--------------
2019-06-20 05:14:40.990 INFO   : mi-flora: Discovered characteristics
2019-06-20 05:14:41.035 INFO   : mi-flora: Enabled sensor mode
2019-06-20 05:14:41.065 INFO   : mi-flora: Read data characteristic
2019-06-20 05:14:41.068 INFO   : mi-flora: Saving new values to config
2019-06-20 05:14:41.630 INFO   : mi-flora: Connected to MiFlora--------------
2019-06-20 05:14:41.782 INFO   : mi-flora: Discovered services
2019-06-20 05:14:41.842 INFO   : mi-flora: Discovered characteristics
2019-06-20 05:14:41.857 INFO   : mi-flora: Enabled sensor mode
2019-06-20 05:14:41.872 INFO   : mi-flora: Read data characteristic
2019-06-20 05:14:41.882 INFO   : mi-flora: Saving new values to config

(mac addresses removed).

tim-hellhake commented 5 years ago

Just to be sure: is it always the same mac address?

flatsiedatsie commented 5 years ago

No, there are 3 devices.

tim-hellhake commented 5 years ago

The timer starts when a device is discovered. Two different devices may be read at the same time. Could you please check if there are less than the configured amount of minutes between two connection attempts of the same device?

flatsiedatsie commented 5 years ago

The problem is not that it connects more often than what is set in settings, the problem is that the settings value gets reset.

Just now it happened again.

I had a look at the logs page and noticed that the plant sensors all had WAY to high resolution:

miflora

Then I checked the settings page of the MiFlora add-in. There the value had been reset to 0.

I've set it back to 1440 again, but at this point I don't know when it will mysteriously be set back to 0 again. It's causing a lot of wasted battery power.

tim-hellhake commented 5 years ago

https://github.com/mozilla-iot/addon-list/issues/351

tim-hellhake commented 5 years ago

Release 0.1.8 is online now. Could you please check if it works?

tim-hellhake commented 5 years ago

@flatsiedatsie I'll close this now. Please raise an issue if there are still any problems.