Comments (10)
This is a different issue. You get 133 after a timeout, so your device with this address is not reachable:
- can be out of range,
- can be non-connectable
- can be bonded to another phone, or this phone may think it's bonded to it (i.e. you had a previous app on this DK, bonded it to your phone and then flagged the dfu, boy phone still tries security)
- is advertising but you didn't scan for it since Bluetooth was enabled on the phone, so the connect request is sent to the same address, but with type 'public'
- something else.
from android-dfu-library.
Thanks for the bug report! I'm really sorry for the enormous delay, but this issue got lost somewhere in my head.
I finally understand now where the "Device got disconnected before service discovery finished" #35 may come from. Those ACTION_ACL_ events are very unreliable. They are called in random order, sometimes before gatt callback, sometimes much after. You are correct that receiving this event in wrong time may do much more bad than good. It was added there long time ago as some devices failed to deliver onConnectionStateChanged with state 0 (disconnected).
Ill look into this deeply now.
from android-dfu-library.
OK, few observations:
- With handling this ACL_DISCONNECTED event I was calling
gatt.close()
on an object that didn't yet getonConnectionStateChanged(DISCONNECTED)
. That might have caused some troubles. After cleaning up the oldgatt
object and trying to connect again to the device we get those weird status 8, newState 0 followed by status 0, newState 2. A closed gatt should not get any callbacks, but it appears as there are some race conditions there, or something not correctly handled.
I'll check with removing setting state to disconnected in ACL receiver for the next release. The app should base on gatt callbacks after all. ACL receiver was a hack.
from android-dfu-library.
I'll leave it open so that you could verify if the next release has fixed/improved stability.
from android-dfu-library.
Please check version 1.4.0.
from android-dfu-library.
I'm still seeing this issue with v2.5.1
from android-dfu-library.
Could you paste logcat here?
from android-dfu-library.
I've fixed the reason why it was failing because of the race conditions, but perhaps there is something else causing it.
from android-dfu-library.
Hi,
This is the logcat:
11-13 09:31:42.136 3001-3001/com.example.nikitha.run_2 D/ContentValues: onStop
11-13 09:31:42.137 3001-3001/com.example.nikitha.run_2 D/BluetoothAdapter: stopLeScan()
11-13 09:31:42.138 3001-3001/com.example.nikitha.run_2 D/BluetoothAdapter: scan not started yet
11-13 09:31:42.139 3001-3001/com.example.nikitha.run_2 D/BluetoothAdapter: stopLeScan()
11-13 09:31:42.140 3001-3001/com.example.nikitha.run_2 D/BluetoothAdapter: scan not started yet
11-13 09:31:44.191 3001-3612/com.example.nikitha.run_2 I/DfuBaseService: Connecting to the device...
11-13 09:31:44.192 3001-3612/com.example.nikitha.run_2 D/BluetoothGatt: connect() - device: EA:D0:81:80:D9:E0, auto: false
11-13 09:31:44.192 3001-3612/com.example.nikitha.run_2 D/BluetoothGatt: registerApp()
11-13 09:31:44.192 3001-3612/com.example.nikitha.run_2 D/BluetoothGatt: registerApp() - UUID=e66a3079-6b62-4657-ad09-87cf3c81b786
11-13 09:31:44.194 3001-3014/com.example.nikitha.run_2 D/BluetoothGatt: onClientRegistered() - status=0 clientIf=5
11-13 09:31:46.955 3001-3001/com.example.nikitha.run_2 D/BluetoothAdapter: stopLeScan()
11-13 09:31:46.956 3001-3001/com.example.nikitha.run_2 D/BluetoothAdapter: scan not started yet
11-13 09:32:14.197 3001-3014/com.example.nikitha.run_2 D/BluetoothGatt: onClientConnectionState() - status=133 clientIf=5 device=EA:D0:81:80:D9:E0
11-13 09:32:14.197 3001-3014/com.example.nikitha.run_2 E/DfuBaseService: Connection state change error: 133 newState: 0
11-13 09:32:14.197 3001-3612/com.example.nikitha.run_2 E/DfuBaseService: Device got disconnected before service discovery finished
11-13 09:32:14.199 3001-3612/com.example.nikitha.run_2 D/BluetoothGatt: refresh() - device: EA:D0:81:80:D9:E0
11-13 09:32:14.200 3001-3612/com.example.nikitha.run_2 I/DfuBaseService: Refreshing result: true
11-13 09:32:14.200 3001-3612/com.example.nikitha.run_2 I/DfuBaseService: Cleaning up...
11-13 09:32:14.201 3001-3612/com.example.nikitha.run_2 D/BluetoothGatt: close()
11-13 09:32:14.201 3001-3612/com.example.nikitha.run_2 D/BluetoothGatt: unregisterApp() - mClientIf=5
from android-dfu-library.
This was fixed! Thank you so much! @philips77
from android-dfu-library.
Related Issues (20)
- Batch/Automatic DFU update mode?
- DFU upload stops at 29% on version 2.3.1 HOT 1
- Hello! HOT 1
- Unable to use version 2.3.1 with Unity due to Java 17 not being supported. HOT 2
- [Version Android - 14] - java.lang.SecurityException: One of RECEIVER_EXPORTED or RECEIVER_NOT_EXPORTED should be specified when a receiver isn't being registered exclusively for system broadcasts HOT 10
- Crash on Android 14 because of no type on startForeground HOT 5
- Android 14 requires starting FGS with service type specified HOT 2
- Android 14 - Permission FOREGROUND_SERVICE_CONNECTED_DEVICE requires video for play store HOT 1
- Problems with binding for xamarin/maui: string with multiple placeholders HOT 6
- Application stuck after Discovering services. HOT 2
- DFU Service Not Disconnecting and Restarting After Unplanned Disconnections
- `startForeground` doesn't specify a `foregroundServiceType` HOT 2
- nRF connect crashes when device reports 0 bytes for DFU partition HOT 2
- Causing MissingForegroundServiceTypeException on android 14 HOT 1
- Dfu Failing HOT 5
- Fatal Exception: android.app.ForegroundServiceStartNotAllowedException on Android 13 / 14 HOT 6
- What are the Vendor commands used by DFU? HOT 1
- Automatic Reconnection not available on Android 14 HOT 2
- Android 14 GATT 133 1 HOT 3
- Error 8(0x8): GATT CONN TIMEOUT HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from android-dfu-library.