Pebble Time Steel / Oneplus 5 - disconnects after phone sleeps for a while #1564

Closed
by admiralzeech opened 2 years ago · 7 comments
admiralzeech commented 2 years ago (Migrated from github.com)
Owner

Before reporting a bug, please confirm the following:

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

Your issue is:

Hi, I've noticed that my Pebble Time Steel disconnects if I leave my Oneplus 5 untouched for a while (haven't timed it, but it's in the ballpark of tens of minutes).

Looking at the logs, it seems bluetooth is being disabled when the connection is lost. GB does not reconnect, even though I have set reconnect attempts to 99. Waking the phone up by pressing the power button will turn BT back on and reconnect the watch automatically.

I'm guessing that the phone has some sort of powersaving functionality where BT gets turned off after the phone sleeps for a while. I realise this is not really GB's problem, but I wonder if you've heard of any solutions or workarounds.

I've included hopefully the relevant log file excerpt below.

Your wearable device is:

Pebble Time Steel, official firmware v4.3

Your android version is:

Android 9.0. Oneplus OxygenOS 9.0.6

Your Gadgetbridge version is:

0.34.1

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

Log excerpt:

03:01:16.743 [main] INFO n.f.g.e.NotificationListener - Ignoring notification, is a system event
03:01:16.743 [main] INFO n.f.g.e.NotificationListener - Ignore notification
03:01:17.682 [Thread-2] INFO n.f.g.s.d.p.PebbleIoThread - bt socket closed, read return: -1
03:01:17.683 [Thread-2] INFO n.f.g.s.d.p.PebbleIoThread - Trying to reconnect (attempts left 98)
03:01:17.698 [main] WARN n.f.g.u.GB - Bluetooth is disabled.
03:01:17.713 [main] INFO n.f.g.s.DeviceCommunicationService - Setting broadcast receivers to: true
03:01:17.719 [main] WARN n.f.g.u.GB - Bluetooth is disabled.
03:01:17.734 [main] INFO n.f.g.s.DeviceCommunicationService - Setting broadcast receivers to: true
03:01:17.742 [main] INFO n.f.g.e.BluetoothStateChangeReceiver - Bluetooth turned off => disconnecting...
03:01:17.763 [main] DEBUG n.f.g.s.DeviceCommunicationService - Service startcommand: nodomain.freeyourgadget.gadgetbridge.devices.action.disconnect
03:01:17.764 [main] INFO n.f.g.s.DeviceCommunicationService - Setting broadcast receivers to: false
03:01:17.764 [Thread-2] INFO n.f.g.s.d.p.PebbleIoThread - Bluetooth socket closed, will quit IO Thread
03:01:17.822 [main] WARN n.f.g.u.GB - Bluetooth is disabled.
03:01:17.828 [main] ERROR n.f.g.s.DeviceCommunicationService - Got ACTION_DEVICE_CHANGED from unexpected device: Device Pebble Time A16D, B0:B4:48:A6:A1:6D, Not connected
03:01:17.833 [main] WARN n.f.g.u.GB - Bluetooth is disabled.
03:01:17.839 [main] ERROR n.f.g.s.DeviceCommunicationService - Got ACTION_DEVICE_CHANGED from unexpected device: Device Pebble Time A16D, B0:B4:48:A6:A1:6D, Not connected
03:01:17.840 [main] INFO n.f.g.e.BluetoothStateChangeReceiver - Bluetooth turned off => disconnecting...
03:01:17.844 [main] INFO n.f.g.e.NotificationListener - Ignoring notification, application is blacklisted
03:01:17.845 [main] INFO n.f.g.e.NotificationListener - Ignore notification
03:01:17.860 [main] INFO n.f.g.e.NotificationListener - Ignoring notification, application is blacklisted
03:01:17.861 [main] INFO n.f.g.e.NotificationListener - Ignore notification
03:01:17.880 [main] DEBUG n.f.g.s.DeviceCommunicationService - Service startcommand: nodomain.freeyourgadget.gadgetbridge.devices.action.disconnect
03:01:17.954 [main] INFO n.f.g.e.NotificationListener - Ignoring notification, application is blacklisted
03:01:17.954 [main] INFO n.f.g.e.NotificationListener - Ignore notification
03:01:17.976 [main] INFO n.f.g.e.NotificationListener - Ignoring notification, application is blacklisted
03:01:17.976 [main] INFO n.f.g.e.NotificationListener - Ignore notification
03:01:18.262 [main] INFO n.f.g.e.NotificationListener - Notification removed: android: null
03:02:04.832 [main] INFO n.f.g.e.BluetoothStateChangeReceiver - Bluetooth turned on => connecting...
03:02:04.850 [main] DEBUG n.f.g.s.DeviceCommunicationService - Service startcommand: nodomain.freeyourgadget.gadgetbridge.devices.action.connect
03:02:04.916 [main] INFO n.f.g.s.d.p.PebbleProtocol - setting always ACK PebbleKit to false
03:02:04.917 [main] INFO n.f.g.s.d.p.PebbleProtocol - setting enable PebbleKit support to false
03:02:04.926 [main] INFO n.f.g.s.DeviceCommunicationService - Setting broadcast receivers to: true
03:02:04.930 [Thread-3] INFO n.f.g.s.d.p.PebbleIoThread - found service UUID 00001101-0000-1000-8000-00805f9b34fb
03:02:04.930 [Thread-3] INFO n.f.g.s.d.p.PebbleIoThread - found service UUID 00000000-0000-1000-8000-00805f9b34fb
03:02:04.930 [Thread-3] INFO n.f.g.s.d.p.PebbleIoThread - found service UUID 00000000-0000-1000-8000-00805f9b34fb
03:02:04.931 [Thread-3] INFO n.f.g.s.d.p.PebbleIoThread - found service UUID 00000000-deca-fade-deca-deafdecacaff
03:02:05.067 [main] INFO n.f.g.e.NotificationListener - Ignoring notification, application is blacklisted
03:02:05.068 [main] INFO n.f.g.e.NotificationListener - Ignore notification
03:02:05.110 [main] INFO n.f.g.e.BluetoothStateChangeReceiver - Bluetooth turned on => connecting...
03:02:05.115 [main] DEBUG n.f.g.s.DeviceCommunicationService - Service startcommand: nodomain.freeyourgadget.gadgetbridge.devices.action.connect
03:02:05.125 [main] INFO n.f.g.s.DeviceCommunicationService - Setting broadcast receivers to: true
03:02:05.227 [main] INFO n.f.g.e.NotificationListener - Ignoring notification, application is blacklisted
03:02:05.227 [main] INFO n.f.g.e.NotificationListener - Ignore notification
03:02:05.888 [main] INFO n.f.g.e.BluetoothConnectReceiver - connection attempt detected from or to B0:B4:48:A6:A1:6D(Pebble Time A16D)
03:02:06.762 [Thread-3] DEBUG n.f.g.s.d.p.PebbleIoThread - Not enabling background Webview, is disabled in preferences.
03:02:06.762 [Thread-3] INFO n.f.g.s.d.p.PebbleProtocol - setting force protocol to false
03:02:06.873 [Thread-3] INFO n.f.g.s.d.p.PebbleProtocol - Pebble asked for Phone/App Version - repLYING!
03:02:06.881 [main] INFO n.f.g.s.DeviceCommunicationService - Setting broadcast receivers to: true
03:02:06.985 [main] INFO n.f.g.e.NotificationListener - Ignoring notification, application is blacklisted
03:02:06.986 [main] INFO n.f.g.e.NotificationListener - Ignore notification
03:02:07.085 [Thread-3] INFO n.f.g.s.d.p.PebbleProtocol - got LAUNCHER PUSH from UUID : 47472043-7265-77a6-aa30-edbe01e38a02

#### 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) #### Your issue is: Hi, I've noticed that my Pebble Time Steel disconnects if I leave my Oneplus 5 untouched for a while (haven't timed it, but it's in the ballpark of tens of minutes). Looking at the logs, it seems bluetooth is being disabled when the connection is lost. GB does not reconnect, even though I have set reconnect attempts to 99. Waking the phone up by pressing the power button will turn BT back on and reconnect the watch automatically. I'm guessing that the phone has some sort of powersaving functionality where BT gets turned off after the phone sleeps for a while. I realise this is not really GB's problem, but I wonder if you've heard of any solutions or workarounds. I've included hopefully the relevant log file excerpt below. #### Your wearable device is: Pebble Time Steel, official firmware v4.3 #### Your android version is: Android 9.0. Oneplus OxygenOS 9.0.6 #### Your Gadgetbridge version is: 0.34.1 *New issues about already solved/documented topics could be closed without further comments. Same for too generic or incomplete reports.* Log excerpt: 03:01:16.743 [main] INFO n.f.g.e.NotificationListener - Ignoring notification, is a system event 03:01:16.743 [main] INFO n.f.g.e.NotificationListener - Ignore notification 03:01:17.682 [Thread-2] INFO n.f.g.s.d.p.PebbleIoThread - bt socket closed, read return: -1 03:01:17.683 [Thread-2] INFO n.f.g.s.d.p.PebbleIoThread - Trying to reconnect (attempts left 98) 03:01:17.698 [main] WARN n.f.g.u.GB - Bluetooth is disabled. 03:01:17.713 [main] INFO n.f.g.s.DeviceCommunicationService - Setting broadcast receivers to: true 03:01:17.719 [main] WARN n.f.g.u.GB - Bluetooth is disabled. 03:01:17.734 [main] INFO n.f.g.s.DeviceCommunicationService - Setting broadcast receivers to: true 03:01:17.742 [main] INFO n.f.g.e.BluetoothStateChangeReceiver - Bluetooth turned off => disconnecting... 03:01:17.763 [main] DEBUG n.f.g.s.DeviceCommunicationService - Service startcommand: nodomain.freeyourgadget.gadgetbridge.devices.action.disconnect 03:01:17.764 [main] INFO n.f.g.s.DeviceCommunicationService - Setting broadcast receivers to: false 03:01:17.764 [Thread-2] INFO n.f.g.s.d.p.PebbleIoThread - Bluetooth socket closed, will quit IO Thread 03:01:17.822 [main] WARN n.f.g.u.GB - Bluetooth is disabled. 03:01:17.828 [main] ERROR n.f.g.s.DeviceCommunicationService - Got ACTION_DEVICE_CHANGED from unexpected device: Device Pebble Time A16D, B0:B4:48:A6:A1:6D, Not connected 03:01:17.833 [main] WARN n.f.g.u.GB - Bluetooth is disabled. 03:01:17.839 [main] ERROR n.f.g.s.DeviceCommunicationService - Got ACTION_DEVICE_CHANGED from unexpected device: Device Pebble Time A16D, B0:B4:48:A6:A1:6D, Not connected 03:01:17.840 [main] INFO n.f.g.e.BluetoothStateChangeReceiver - Bluetooth turned off => disconnecting... 03:01:17.844 [main] INFO n.f.g.e.NotificationListener - Ignoring notification, application is blacklisted 03:01:17.845 [main] INFO n.f.g.e.NotificationListener - Ignore notification 03:01:17.860 [main] INFO n.f.g.e.NotificationListener - Ignoring notification, application is blacklisted 03:01:17.861 [main] INFO n.f.g.e.NotificationListener - Ignore notification 03:01:17.880 [main] DEBUG n.f.g.s.DeviceCommunicationService - Service startcommand: nodomain.freeyourgadget.gadgetbridge.devices.action.disconnect 03:01:17.954 [main] INFO n.f.g.e.NotificationListener - Ignoring notification, application is blacklisted 03:01:17.954 [main] INFO n.f.g.e.NotificationListener - Ignore notification 03:01:17.976 [main] INFO n.f.g.e.NotificationListener - Ignoring notification, application is blacklisted 03:01:17.976 [main] INFO n.f.g.e.NotificationListener - Ignore notification 03:01:18.262 [main] INFO n.f.g.e.NotificationListener - Notification removed: android: null 03:02:04.832 [main] INFO n.f.g.e.BluetoothStateChangeReceiver - Bluetooth turned on => connecting... 03:02:04.850 [main] DEBUG n.f.g.s.DeviceCommunicationService - Service startcommand: nodomain.freeyourgadget.gadgetbridge.devices.action.connect 03:02:04.916 [main] INFO n.f.g.s.d.p.PebbleProtocol - setting always ACK PebbleKit to false 03:02:04.917 [main] INFO n.f.g.s.d.p.PebbleProtocol - setting enable PebbleKit support to false 03:02:04.926 [main] INFO n.f.g.s.DeviceCommunicationService - Setting broadcast receivers to: true 03:02:04.930 [Thread-3] INFO n.f.g.s.d.p.PebbleIoThread - found service UUID 00001101-0000-1000-8000-00805f9b34fb 03:02:04.930 [Thread-3] INFO n.f.g.s.d.p.PebbleIoThread - found service UUID 00000000-0000-1000-8000-00805f9b34fb 03:02:04.930 [Thread-3] INFO n.f.g.s.d.p.PebbleIoThread - found service UUID 00000000-0000-1000-8000-00805f9b34fb 03:02:04.931 [Thread-3] INFO n.f.g.s.d.p.PebbleIoThread - found service UUID 00000000-deca-fade-deca-deafdecacaff 03:02:05.067 [main] INFO n.f.g.e.NotificationListener - Ignoring notification, application is blacklisted 03:02:05.068 [main] INFO n.f.g.e.NotificationListener - Ignore notification 03:02:05.110 [main] INFO n.f.g.e.BluetoothStateChangeReceiver - Bluetooth turned on => connecting... 03:02:05.115 [main] DEBUG n.f.g.s.DeviceCommunicationService - Service startcommand: nodomain.freeyourgadget.gadgetbridge.devices.action.connect 03:02:05.125 [main] INFO n.f.g.s.DeviceCommunicationService - Setting broadcast receivers to: true 03:02:05.227 [main] INFO n.f.g.e.NotificationListener - Ignoring notification, application is blacklisted 03:02:05.227 [main] INFO n.f.g.e.NotificationListener - Ignore notification 03:02:05.888 [main] INFO n.f.g.e.BluetoothConnectReceiver - connection attempt detected from or to B0:B4:48:A6:A1:6D(Pebble Time A16D) 03:02:06.762 [Thread-3] DEBUG n.f.g.s.d.p.PebbleIoThread - Not enabling background Webview, is disabled in preferences. 03:02:06.762 [Thread-3] INFO n.f.g.s.d.p.PebbleProtocol - setting force protocol to false 03:02:06.873 [Thread-3] INFO n.f.g.s.d.p.PebbleProtocol - Pebble asked for Phone/App Version - repLYING! 03:02:06.881 [main] INFO n.f.g.s.DeviceCommunicationService - Setting broadcast receivers to: true 03:02:06.985 [main] INFO n.f.g.e.NotificationListener - Ignoring notification, application is blacklisted 03:02:06.986 [main] INFO n.f.g.e.NotificationListener - Ignore notification 03:02:07.085 [Thread-3] INFO n.f.g.s.d.p.PebbleProtocol - got LAUNCHER PUSH from UUID : 47472043-7265-77a6-aa30-edbe01e38a02

Have you excluded Gadgetbridge from Doze/Battery-Optimization?

Besides: my PTS does that as well from time to time, but it usually reconnects automatically. But the device my PTS is bound to still runs Android 7, so this might be a bit different.

If excluding GB from Doze doesn't help, you could also try switching the PTS to BLE (keep the original BT as-is, just in GB preferences tell it to favor BLE – so if it doesn't work out and you don't like it, you can just uncheck that). Could be Pie treats BLE a bit different.

Have you excluded Gadgetbridge from Doze/Battery-Optimization? Besides: my PTS does that as well from time to time, but it usually reconnects automatically. But the device my PTS is bound to still runs Android 7, so this might be a bit different. If excluding GB from Doze doesn't help, you could also try switching the PTS to BLE (keep the original BT as-is, just in GB preferences tell it to favor BLE – so if it doesn't work out and you don't like it, you can just uncheck that). Could be Pie treats BLE a bit different.
admiralzeech commented 2 years ago (Migrated from github.com)
Poster
Owner

Thanks for your reply. GB was already excluded from battery optimisation when I raised the issue.

On your suggestion, I tried switching to BLE (I had to connect regular pebble to the bluetooth, and then the Pebble LE.) However, after the first time it went to sleep and disconnected, when I woke my phone up again it reconnected to regular Pebble and didn't reconnect to Pebble LE. And it wont reconnect to Pebble LE until I presumably forget the Pebble and re-pair. (Which I haven't bothered doing since it didnt solve my issue. What does BLE offer anyways?)

From my logs, it seems like GB is still active and trying to reconnect, but the phone's sleep mode has disabled BT. I wonder if I keep GB using the BT connection (by spamming myself with messages every minute, for example) whether it will keep the BT connection up. Or maybe it will just prevent the phone from going into deep sleep...

Thanks for your reply. GB was already excluded from battery optimisation when I raised the issue. On your suggestion, I tried switching to BLE (I had to connect regular pebble to the bluetooth, and then the Pebble LE.) However, after the first time it went to sleep and disconnected, when I woke my phone up again it reconnected to regular Pebble and didn't reconnect to Pebble LE. And it wont reconnect to Pebble LE until I presumably forget the Pebble and re-pair. (Which I haven't bothered doing since it didnt solve my issue. What does BLE offer anyways?) From my logs, it seems like GB is still active and trying to reconnect, but the phone's sleep mode has disabled BT. I wonder if I keep GB using the BT connection (by spamming myself with messages every minute, for example) whether it will keep the BT connection up. Or maybe it will just prevent the phone from going into deep sleep...

it reconnected to regular Pebble and didn't reconnect to Pebble LE

Have you set the "prefer LE" preference?

What does BLE offer anyways?

Lower battery consumption? I'm not sure. Tried it twice, didn't work out for me, kicked it out again.

the phone's sleep mode has disabled BT

Android 9 specific I guess. Maybe there's a system setting for that – like the WiFi policy? I cannot check, have no Android 9 device.

> it reconnected to regular Pebble and didn't reconnect to Pebble LE Have you set the "prefer LE" preference? > What does BLE offer anyways? Lower battery consumption? I'm not sure. Tried it twice, didn't work out for me, kicked it out again. > the phone's sleep mode has disabled BT Android 9 specific I guess. Maybe there's a system setting for that – like the WiFi policy? I cannot check, have no Android 9 device.
admiralzeech commented 2 years ago (Migrated from github.com)
Poster
Owner

Hmm, I got LE working, it required me to pair normal BT and then LE. But after the first time the phone went to sleep and disconnected, it lost both connections and it wasn't that easy to reconnect, so I gave up on that.

I also tried a "keep BT awake" app, which seemed to help a little bit, but sometimes the app would close anyways despite power settings. Out of ideas at this point. Is noone else getting this issue?

Hmm, I got LE working, it required me to pair normal BT and then LE. But after the first time the phone went to sleep and disconnected, it lost both connections and it wasn't that easy to reconnect, so I gave up on that. I also tried a "keep BT awake" app, which seemed to help a little bit, but sometimes the app would close anyways despite power settings. Out of ideas at this point. Is noone else getting this issue?

That matches my experiences (which is why I gave up on BLE for the PTS). Seems for some it works great, but we are the others… But my PTS works fine in "standard mode" (i.e. without BLE and BackgroundJS disabled).

That matches my experiences (which is why I gave up on BLE for the PTS). Seems for some it works great, but we are the others… But my PTS works fine in "standard mode" (i.e. without BLE and BackgroundJS disabled).
Collaborator

As said above, standard mode should work OK. I am not sure if the recently implemented auto-reconnection is applicable to Pebble, but if it does it works well, can this issue be closed now? Thank you.

As said above, standard mode should work OK. I am not sure if the recently implemented auto-reconnection is applicable to Pebble, but if it does it works well, can this issue be closed now? Thank you.

Hi, original creator of the issue here.

After the OxygenOS update to 10.0.0, all of my disconnection issues have disappeared completely. This was on the same version of GB that I was having problems with.

So I assume the problem was that a previous version of android on the Oneplus was too aggressive in shutting down BT or something, or that GB wasn't keeping the BT connection alive in a way that it liked. Either that or GB was getting power managed to death despite me setting the app to not be power managed.

The issue can be closed now, I guess? Thanks.

Hi, original creator of the issue here. After the OxygenOS update to 10.0.0, all of my disconnection issues have disappeared completely. This was on the same version of GB that I was having problems with. So I assume the problem was that a previous version of android on the Oneplus was too aggressive in shutting down BT or something, or that GB wasn't keeping the BT connection alive in a way that it liked. Either that or GB was getting power managed to death despite me setting the app to not be power managed. The issue can be closed now, I guess? Thanks.
vanous closed this issue 11 months ago
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.