question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

autoConnect() takes too long to connect with device

See original GitHub issue

Hi, so I’m using your library and what I do is I create connections with BLE peripheral periodically.

For first implementation I used connect() and it worked very well. Connection was made very fast. Then bug was found - if user toogled bluetooth on/off, bluetooth cache stack was cleared and then connect() did not work anymore. I went through your documentation and found that autoConnect() can be used and with this implementation toogling bluetooth on/off still worked, which was a blast. But then reports came in that sometimes autoConnect() takes up to 10 minutes, which is big delay for our logic.

Question is, is there something that we can do? Is there a possibility to fix bluetooth toogle on/off cache clearing for manualConnection()? Or is there a way to reduce autoConnect() delay to minimum?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:16 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
weliemcommented, Jul 15, 2020

You can call autoConnect for several peripherals, but there can be only 1 outstanding connectPeripheral call. The library doesnt prevent you from doing it. It only prevents multiple connects to the same peripheral…

0reactions
weliemcommented, Aug 17, 2020

Any news on this issue?

Read more comments on GitHub >

github_iconTop Results From Across the Web

android ble connect slowly - Stack Overflow
I have an LED on the device to indicate connection state. The issue is the duration from connectGatt() call to the point of...
Read more >
Too slow Bluetooth Auto Connect : r/tasker - Reddit
Hi all! Have you noticed that disconnecting devices with Bluetooth Auto Connect us sometimes very very slow? I have just tested it a...
Read more >
Making Android BLE work — part 2 - Medium
However, the big downside of autoconnect is that is takes a bit longer to connect compared to scanning aggressively first and then connecting...
Read more >
Force a paired BlueTooth device to reconnect - Apple Developer
Our iOS app uses a specific Bluetooth device from a hardware partner. The user can pair the device with a PIN and then...
Read more >
Autoconnecting Bluetooth Devices - Ask Ubuntu
Pulseaudio >= 1.0. By editing the /etc/pulse/default.pa we can load the pulseaudio module module-switch-on-connect to autoconnect to an audio sink as soon ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found