Comments (12)
Here is a first analysis:
- The class
NimbleController
should be refactored and improved (better state machine for service and characteristic discovery, handle the return codes of all functions from NimBLE, correctly de-init() all objects when disconnecting,...). - Some connection issue might be caused by handles that are not cleared on disconnection. We it reconnects to another device/app, it still use old handles values that are not valid anymore.
- If NRFConnect and Gadgetbridge are installed on the smartphone, it seems that the CTS from NRFConnect confuses InfiniTime when connecting to gadgetbridge : InfiniTime/NimBLE find a reference to the CTS service during discovery, and fails when reading the time characteristic -> the error triggers a disconnection.
- sometimes, NimBLE looks totally dead, advertising does not start anymore, only a system reset solves the issue
I still have to analyze this a bit deeper. In the mean time, I've observed that disabling the CTS service from NRFConnect improved the connection and reconnection stability for Gadgetbridge.
from infinitime.
Here is a first fix : the services are reset on disconnect, and advertising is not started if a connection is already established : https://github.com/JF002/Pinetime/tree/improve-ble-connection
With this fix, and if the CTS service of NRFConnect , connection and reconnection worked every time I tried.
from infinitime.
Yep, after a while it just seems to disconnect. For some reason the PineTime itself thinks the connection is alive, might need a bit better status polling/handling. Needs to be investigated more.
from infinitime.
I've just pushed a new commit. I refactored the service discovery procedure. It' now much cleaner and it does not try to get the time from CTS when it has not been discovered correctly.
There is still one issue, but I don't think it comes from InfiniTime : if the CTS service is enabled in NRFConnect when connecting using Gadgetbridge, CTS is discovered but does not respond to a read command, a timeout occurs which trigger the disconnection of the BLE connection...
@Avamander Can you try this branch and see if it improves the situation on your side?
from infinitime.
Can you try this branch and see if it improves the situation on your side?
Can it wait until the middle of next week?
from infinitime.
Also, just wondering, did you test Out Of Range behavior?
from infinitime.
Can it wait until the middle of next week?
We are not in a hurry. I would like to merge this in InfiniTime 0.9 is it works correctly.
Also, just wondering, did you test Out Of Range behavior?
Yes, I did many tests, going out of range with my phone, disconnect the bluetooth adapter from my computer while it's connected, connect from NRFConnect, Gadgetbridge and my computer,...
As long as the CTS is disabled on NRFConnect, it works fine.
from infinitime.
I've just created the PR (#118). I'll merge it in develop and create a release candidate release for people to test it
from infinitime.
i'm having this problem on the latest release 0.9.0 with a sealed pinetime. after a while (some hours, it seems), it disconnects but still thinks it's connected (so can't reestablish connection) until a reboot.
from infinitime.
https://github.com/JF002/Pinetime/releases/tag/0.13.0 was just released, but it will take some time to monitor this
from infinitime.
I think we can say this bug was fixed in 0.12/0.13, what do you think @Avamander ?
from infinitime.
@JF002 Probably.
from infinitime.
Related Issues (20)
- Turn off accelerometer in night mode HOT 3
- Can't connect to Gadgetbridge after Firmware 1.14 update. HOT 5
- Screen shifting upwards HOT 8
- Assert call being removed during compilation, causing NULL pointer dereference in ble_ll_task HOT 6
- Using GDB debugger in devcontainer does not load source map
- Stopwatch lap counter only goes up to 20 laps HOT 1
- Unable to update InfiniTime successfully
- Add unit testing framework and skeleton test project HOT 4
- looping recovery mode,.... infinite loop. ITime. HOT 2
- Not reconnecting to Gadgetbridge HOT 7
- What watch faces currently support weather? HOT 9
- Whats the best way to track what and when the next release HOT 2
- Add active alarm indicator to watch face HOT 4
- Fix Stopwatch Side Button Behavior HOT 1
- Use separate screens for switching off ringing alarm and for alarm configuration
- Firmware update with pinetime-mcuboot-app-dfu-1.14.0.zip and GadgetBridge fails HOT 2
- Wake-up Alarm does not sound in Sleep mode HOT 4
- Text disappears from watchface on chimes HOT 1
- BLE bond deleted after 2 reboots without connectivity to central HOT 3
- PineStore announcement : the current flash chip is EoL, a new one will be used for future PineTime batches
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 infinitime.