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.

Device disconnects automatically inmediately after connection

See original GitHub issue

Hi all,

I am facing some connection problems with the library. I downloaded it 4 days ago and yesterday I started calling the BLEManager connect(device) method. All devices are correctly scanned but when I start the connection, I can connect to the device but immediately it disconnects from the device. I have no clue about what can be causing this problem. Here is the trace I get from logcat:

D/TEST-LP: onDeviceConnecting: LUIS-05B6
D/BluetoothGatt: connect() - device: DB:AB:2A:56:B6:05, auto: false registerApp()
D/BluetoothGatt: registerApp() - UUID=282d31c8-d3d0-4969-88a7-b233d4c2babc
D/BluetoothGatt: onClientRegistered() - status=0 clientIf=6
D/BluetoothGatt: onClientConnectionState() - status=0 clientIf=6 device=DB:AB:2A:56:B6:05
D/TEST-LP: onDeviceConnected: LUIS-05B6
D/BluetoothGatt: discoverServices() - device: DB:AB:2A:56:B6:05
D/BluetoothGatt: onConnectionUpdated() - Device=DB:AB:2A:56:B6:05 interval=6 latency=0 Timeout=500 status=0
D/BluetoothGatt: onSearchComplete() = Device=DB:AB:2A:56:B6:05 Status=0
D/BluetoothGatt: cancelOpen() - device: DB:AB:2A:56:B6:05
D/BluetoothGatt: onClientConnectionState() - status=0 clientIf=6 device=DB:AB:2A:56:B6:05
D/TEST-LP: onDeviceDisconnected: LUIS-05B6

If you want to see some part of the code just let me know. Any help is apreciated!

*Edit: logcat formatted

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:12 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
AvantStudioSLcommented, Jul 5, 2018

Hi, thanks for the quick reply! I have been able to initialize the device now. What I was doing wrong was in the discover services. I have commented all the code inside “isRequiredServiceSupported” in the GattCallback and now it works, I have to rework this part of the code but at least I am not blocked.

Let you know if I have other issue with the library!

1reaction
philips77commented, Jul 5, 2018

Hi, could you try the alpha5 release? This is the one that will be maintained now. You still may have this issue, but if there’s anything we could do, I’d rather to it there. It’s on develop branch and on jcenter with 2.0-alpha5 version tag.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Solved: BLE disconnects immediately after connection
If you are not getting any kind of error, the most common reason for an immediate disconnect is a timing mismatch between the...
Read more >
Bluetooth keeps disconnecting [Solved] - Driver Easy
Your Bluetooth device keeps disconnecting? Don't worry. Here are 5 simple fixes and you can solve this problem easily and quickly.
Read more >
Connect WIFI disconnects automatically after few seconds.
Click Start, type ncpa.cpl, and then hit Enter. Right-click your wireless network connection, and then click Properties.
Read more >
Why Does my WiFi Keep Disconnecting? [Solved on Windows ...
If your WiFi keeps disconnecting and you're looking for a solution, ... Step 1: Right-click on Start and select "Device Manager".
Read more >
10 Ways To Fix Wifi Keeps Disconnecting On Android-Carlcare
As expected, your device tries to connect to the best WiFi network around if you've connected to them previously. Meaning, if you have...
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