#1656 fetch activity data on connect

Open
opened 1 year ago by FransM · 11 comments
FransM commented 1 year ago

Before reporting a bug, please confirm the following:

  • [ x] I have read the wiki, and I didn't find a solution to my problem / an answer to my question.
  • [ x] I have searched the issues, and I didn't find a solution to my problem / an answer to my question.
  • [ x] If you upload an image or other content, please make sure you have read and understood the github policies and terms of services

I got Gadgetbridge from:

  • [ x] F-Droid

If you got it from Google Play, please note that version is unofficial and not supported here; it's also often quite outdated. Please switch to one of the above versions if you can.

Your issue is:

If BT on the phone is off and I switch it on the band connects but it does not refresh. It would be nice if a refresh would be done after a successful connect

Your wearable device is:

Mi band 4

Your android version is:

7.1.1

Your Gadgetbridge version is:

latest published

New issues about already solved/documented topics could be closed without further comments. Same for too generic or incomplete reports.

#### Before reporting a bug, please confirm the following: - [ x] I have read the [wiki](https://github.com/Freeyourgadget/Gadgetbridge/wiki), and I didn't find a solution to my problem / an answer to my question. - [ x] I have searched the [issues](https://github.com/Freeyourgadget/Gadgetbridge/issues), and I didn't find a solution to my problem / an answer to my question. - [ x] If you upload an image or other content, please make sure you have read and understood the [github policies and terms of services](https://help.github.com/articles/github-terms-of-service/#1-responsibility-for-user-generated-content) ### I got Gadgetbridge from: * [ x] F-Droid * [ ] I built it myself from source code (specify tag / commit) If you got it from Google Play, please note [that version](https://github.com/TaaviE/Gadgetbridge) is unofficial and not supported here; it's also often quite outdated. Please switch to one of the above versions if you can. #### Your issue is: If BT on the phone is off and I switch it on the band connects but it does not refresh. It would be nice if a refresh would be done after a successful connect #### Your wearable device is: Mi band 4 #### Your android version is: 7.1.1 #### Your Gadgetbridge version is: latest published *New issues about already solved/documented topics could be closed without further comments. Same for too generic or incomplete reports.*
Poster
Owner

@FransM
Ok what is a "refresh"?

@FransM Ok what is a "refresh"?
FransM commented 1 year ago
Poster

What I meant is that after switching BT on my mi band 4 connects, but it does not fetch the data from the band. I see in the graph that there is no data retrieved over the interval that the device was disconnected. If I then in the graph press the refresh button (or fetch data whatever the name is the one with the two halfcircle arrows at the right top side) new data is retrieved.
It would be nice to have GB retrieve the new data after connecting.
This might be a corner case and only be an issue if it connects after BT being switched on on the phone.

What I meant is that after switching BT on my mi band 4 connects, but it does not fetch the data from the band. I see in the graph that there is no data retrieved over the interval that the device was disconnected. If I then in the graph press the refresh button (or fetch data whatever the name is the one with the two halfcircle arrows at the right top side) new data is retrieved. It would be nice to have GB retrieve the new data after connecting. This might be a corner case and only be an issue if it connects after BT being switched on on the phone.
vanous commented 1 year ago
Poster
Collaborator

@FransM did you enable Auto fetch? Here is my settings:

  • Start automatically
  • Connect to Gb device when BT is turned on
  • Reconnect automatically
  • Auto fetch activity data
  • Minimum time between fetches: 20 (you can use less, but i has a feeling that the BT connection was not very stable)

Also, i use the Widget and clickting on the device name forces refresh.

Hope this helps

@FransM did you enable Auto fetch? Here is my settings: - Start automatically [x] - Connect to Gb device when BT is turned on [x] - Reconnect automatically [x] - Auto fetch activity data [x] - Minimum time between fetches: 20 (you can use less, but i has a feeling that the BT connection was not very stable) Also, i use the [Widget](https://codeberg.org/Freeyourgadget/Gadgetbridge/wiki/Widget) and clickting on the device name forces refresh. Hope this helps
FransM commented 1 year ago
Poster

I have the same settings with the exception that I have minimum time set to no limit.
Normally when I reconnect data is fetched but if I have a reconnect issue (see #1632) I reconnect by turning BT off, then wait a bit, then turn BT on. When I do that the band connects but no data is fetched. I have to fetch manually.

Probably a way to reproduce this is.
Turn BT on phone off, wait a few hours. Turn BT on. Open GB and notice that the last hours are not updated.
I'll try if this indeed reproduces the problem.

I have the same settings with the exception that I have minimum time set to no limit. Normally when I reconnect data is fetched but if I have a reconnect issue (see #1632) I reconnect by turning BT off, then wait a bit, then turn BT on. When I do that the band connects but no data is fetched. I have to fetch manually. Probably a way to reproduce this is. Turn BT on phone off, wait a few hours. Turn BT on. Open GB and notice that the last hours are not updated. I'll try if this indeed reproduces the problem.
vanous commented 1 year ago
Poster
Collaborator

I see. I think (i didn't look into the code now) that the fetching must be triggered by the unlock and the re-connection (BT off/on) does not trigger it.

I see. I *think* (i didn't look into the code now) that the fetching must be triggered by the unlock and the re-connection (BT off/on) does not trigger it.
FransM commented 1 year ago
Poster

@vanous I suspect the same

@vanous I suspect the same
mmikalsen commented 1 year ago (Migrated from github.com)
Owner

Auto Fetch only triggers upon screen unlock and you need a lock mechanism. So it seems like you would like a feature that would trigger a fetch upon reconnecting, it has been discussed before #1116

Auto Fetch only triggers upon screen unlock and you need a lock mechanism. So it seems like you would like a feature that would trigger a fetch upon reconnecting, it has been discussed before #1116
vanous commented 1 year ago
Poster
Collaborator

Thanks for confirming. Therefore a duplicate of #1116 . I would suggest closing this one then @FransM , do you agree?

Thanks for confirming. Therefore a duplicate of #1116 . I would suggest closing this one then @FransM , do you agree?
FransM commented 1 year ago
Poster

I just read #1116 and I feel that is a slightly different issue.
#1116 seems to ask to sync automatically (probably at regular intervals). (or I misunderstood #1116)

This one is not abut auto sync but about syncing when reconnecting (after adding the device with + or after the band reconnecting when BT is enabled. So this is triggered by an activity of the user on the phone.

I just read #1116 and I feel that is a slightly different issue. #1116 seems to ask to sync automatically (probably at regular intervals). (or I misunderstood #1116) This one is not abut auto sync but about syncing when reconnecting (after adding the device with + or after the band reconnecting when BT is enabled. So this is triggered by an activity of the user on the phone.
izzy commented 1 year ago
Poster

Though, if the other issue's solution were implemented: wouldn't that be an adequate solution for you as well? Do you really mind whether it syncs at the instant of reconnecting, and not just, say, 60s later with the "regular interval" being reached? Of course depending on whatever that interval is. And the additional sync at reconnect certainly wouldn't hurt.

Though, if the other issue's solution were implemented: wouldn't that be an adequate solution for you as well? Do you really mind whether it syncs *at the instant* of reconnecting, and not just, say, 60s later with the "regular interval" being reached? Of course depending on whatever that interval is. And the additional sync at reconnect certainly wouldn't hurt.
FransM commented 1 year ago
Poster

I'm not sure how often the automatic sync of #1116 would happen.
If this happens too often it drains too much energy from the band.
To me fetching data should be done whenever the app is brought to the foreground and after establishing a connection.
If #1116 is about only fetching after reconnecting it is the same thing but at least some of the comments talk about a time interval (hence timed fetching) and that is not what I propose.

Actually this is more of an issue to me because I have to reconnect often (due to #1632). If that issue was not there I would probably not even have noticed this issue.

I'm not sure how often the automatic sync of #1116 would happen. If this happens too often it drains too much energy from the band. To me fetching data should be done whenever the app is brought to the foreground and after establishing a connection. If #1116 is about only fetching after reconnecting it is the same thing but at least some of the comments talk about a time interval (hence timed fetching) and that is not what I propose. Actually this is more of an issue to me because I have to reconnect often (due to #1632). If that issue was not there I would probably not even have noticed this issue.
Sign in to join this conversation.
No Milestone
No Assignees
4 Participants
Notifications
Due Date

No due date set.

Dependencies

This issue currently doesn't have any dependencies.

Loading…
There is no content yet.