Gadgetbridge: Pebble: Better automatic reconnect

Created on 29 Jul 2015  路  15Comments  路  Source: Freeyourgadget/Gadgetbridge

Official pebble app seeks for bt device connections and re-establishes a connecting to watch once it's connected.

This functionality is missed in gadgetbridge, which forces users to reconnect manually.

device pebble

Most helpful comment

Just to throw some more weight on this issue, I have to manually reconnect the app several times a day. There are plenty of times when I will get far away from the phone, and it automatically reconnects when I get within range again, but sometimes it'll disconnect when I'm just a few feet away and never reconnect.

All 15 comments

@derlaft
Gadgetbridge tries to reconnect but only for a limited amount of time.
I don't know how the official App behaves, but I noticed that the Pebble itself tries to connect to the Phone which we currently do not support. Maybe Pebble uses that passive re-connection approach in their App?

I could add that feature and make it an option. Something like "listen to incoming connections from the Pebble". I have no idea however under which conditions and when the pebble connects and to which Phone if multiple Phones are paired.

I would also like an 'agressive reconnects' option. gadgetbridge would never stop trying reconnecting to the watch when enabled.

Just to throw some more weight on this issue, I have to manually reconnect the app several times a day. There are plenty of times when I will get far away from the phone, and it automatically reconnects when I get within range again, but sometimes it'll disconnect when I'm just a few feet away and never reconnect.

I will add either an option or raise the number of reconnect attempts.
@glitchphan
Your issue with the disconnects withing a few feets range is strange. The only thing I could think of is that the service got killed and restarted (out of memory). In any case we need a solution for that scenario.

This likely had nothing to do with BT range, and I'm betting I need to turn on some kind of logging to really know what's going on. I was in the next room over from the phone and the Pebble Time vibrated like it does when it disconnects. When I came into the room with the phone, I waited a little bit but it never connected. Turning on the screen and pulling down the notification drawer showed Gadgetbridge, but underneath that it just said "Gadgetbridge is running" rather than "... is initialized" or "... is not connected", the way it usually does. I have not noticed this behavior before when it doesn't reconnect on its own, but this is the new version. As for memory, I have 2gb, and a cat /proc/meminfo shows 500mb cached, 30mb in buffers, and 70mb free. Never really paid attention to these numbers before so I don't know how normal it is, but there is obviously more running/active at the moment as I type this than there was while it was sitting on my nightstand.

You can turn on logging in Gadgetbridge's settings. Maybe then we get an idea of what happens.
I don't think this has been introduced lately.

@glitchphan
If it says "Gadgetbridge is running" it means that the service had been restarted. That's clear.
If you did not get an error dialog from Android, that it should have been killed on purpose which is strange with 2GB RAM.
Anyway we could work around it by reconnecting when that happens.

Maybe it would be an good option to allow setting the Time between reconnects. I use 240 reconnects at time this mostly works but takes a lot of battery when iam not near my phone. Would be nice when i could set only to try to reconnect all 30 secs at example. I think the original app uses longer intervals between the reconnect attemts. Automatic reconnect with "Waiting for incomming connection" seems never to work

That is a good idea. I use 1200 currently.

Automatic reconnect with "Waiting for incomming connection" seems never to work here also (snowy/basalt).

"Waiting for incoming connection" works, but unfortunately the pebble does not connect when we expect.
Some working examples:

  • Turn BT off on the pebble for more than X minutes. X seems to be >5, the pebble will reconnect if you turn BT on again.
  • Use standby mode, put your pebble somewhere where it wont be moved over night. Pick it up the next morning. Will connect. If you pick it up too soon after it turned BT off, it won't connect.
  • Go far away from your phone, until "waiting for incoming connection". Come back in range, you pebble wont connect. BUT if you turn off BT on the Pebble and then QUICKLY turn it on again, it will reconnect. If you wait more than a second it wont reconnect.

Strange, I know, but at least the feature is not useless.

But on original Pebble App this didnt work eigther. When i go out of range and come back, the original app needs more than an minute to reconnect. That says to me that the incomming reconnect dont work there too. The original app seems to try to connect all 1 or 2 minutes.

Anyway sleeping 15/30 seconds between attemps is a good idea

We'll have a look at getting automatic connect on notification to work for the pebble.

This seems to be much better with recent versions. Granted, I have switched devices a couple of times, but I'm confident even switching back would show the same results.

I'm new to GB. I soon found my pebble beeing diconnected from the phone and did some testing:

  1. option "reconnect automatically" must be enabled because the pebble 2 hr will very rarely try to connect actively.
  2. opton "connect to device when bluetooth turned on" must be set for the same reason.
  3. 12 is the default value in GB for the number of "reconnection attempts". There are some issues with this approach:
    3.1 between each attempt there seem to be a pause which is getting longer with each attempt - why? This causes huge reconnection delays if pebble was disconneted for a longer time. Because of 1) pebble will not search for the phone actively but just wait for GB for the next connection attempt.
    3.2 is there a limit on how big the pause can get? If not I would like to suggest to set it to a minute or so. * update: found out that it maxes out at 64 seconds. *
    3.3 while my pebble was charging it was disconnected from the phone for an hour. GB was not able to reconnect withing the given number of attempts so it was sitting in "waiting for connection" status. As I mentioned in 1) pebble 2 hr will not try to reconnect actively. Even after 2 hours of wearing my pebble and my phone with me it did not reconnect. Consequently I would like to suggest a new option for pebble users: "unlimited number of reconnection attempts" because a fixed number of attempts will not do it as its unclear for a normal user how the number of attempts translates into numbers of hours the pebble can stay disconnected because of 3.1). As a workaround I have set the number of reconnecton attempts to the max possible value = "9999"
Was this page helpful?
0 / 5 - 0 ratings

Related issues

ShapeShifter499 picture ShapeShifter499  路  3Comments

cpfeiffer picture cpfeiffer  路  4Comments

leonardomaccari picture leonardomaccari  路  5Comments

bigretromike picture bigretromike  路  8Comments

gamedeff picture gamedeff  路  3Comments