Comments (2)
Hi. The GATT MTU doesn't play such a large role in the overall throughput you can achieve. Very small values (like the default value of 23) are a problem, but at the MTU gets larger, the overhead starts being negligible. 185 is a "common" value that used to be the default for iOS devices for a while.
What affects throughput the most is:
1/ whether or not both devices support the "Data Length Extension" feature of Bluetooth (introduced in 4.2 I believe). That can make a significant difference. Most recent phones support that, but a number of embedded devices still don't
2/ the limit on the number of Bluetooth packets that can be send/received per connection event. Most phones do have an (undocumented) limit, depending on the phone model and OS version. For example, older iPhones tend to limit the number of low level packets per connection event to 6 (it is higher on more recent phones). This is all the most impactful when there's no Data Length Extension support (the packets are smaller). The duration of a connection event depends on the negotiated connection interval between the two peers, so exactly how many low level packets per second can be sent/received will vary based on those two factors
What we observe in practice is that without Data Length Extension, with a 150 to 512 GATT MTU, you should see on the order of 10,000 bytes/s of reliable throughput, with a connection interval of 15 to 30ms. You can get much better if you're able to negotiate a short (say <= 15ms) connection event, and Data Length Extension is supported, and the limit on the number of packets per connection event isn't severely limited.
In your case, what's the device on the other side of the connection? Another Android phone, or an embedded device, or something else? Are you able to check the values of the negotiated connection interval?
The best way to analyze this is with a BT sniffer (you can get one for ~$20).
Please note that the Link Controller feature, while in code base, isn't really enabled. We have currently left it mostly de-activated, because is requires some additional logic that we haven't had the time to integrate into the Github project yet. But it really shouldn't be needed here, at least not for speed. The main role of the link controller is to allow dynamic changes in the connection parameters, which can currently only really be done when you have full control over an embedded device with a customized BT stack.
from golden-gate.
Thanks for your reply.
We used two Android devices (Samsung S7 [Android 8] and a S88 Pro [Android 10]) and the included GoldenGate example Android app without modifications so far.
The app indicates an RX/TX length of 23 in the Link Controller setup. I don't know if these values are correct with respect to your last paragraph? That said the connection is very slow with just 2000 Bytes at maximum.
I tried already to update the MTU settings (GATTLINK_FRAGMENT_SIZE and IP_MTU), but it didn't not really increased the throughput. Nevertheless, on other devices (Pixel 3 and Lenova Tablet) we see a throughput of around 5000 Bytes/s using the original app. Maybe, it is caused by one of the devices.
Nevertheless, even 5000 Bytes per second wouldn't be that fast. Am I correct that I can set the GATT MTU using GG_STACK_BUILDER_DEFAULT_GATTLINK_FRAGMENT_SIZE (gg_stack_builder_base.h) and just increase its value?
from golden-gate.
Related Issues (16)
- Golden Gate & Project Connected Home over IP HOT 4
- Zephyr and WebAssembly roadmap HOT 5
- Feasibility to use it in long-lived connections HOT 2
- What is the expected code size for a full featured GG Stack? HOT 2
- Permissioning of NSBluetoothAlwaysUsageDescription for Stack Tool HOT 3
- Support for HTTP/TLS/TCP HOT 4
- Golden gate socket and MTU questions HOT 2
- Windows and Android Studio - issue with libgg.so and libxp.so HOT 4
- CoAP/DTLS and X.509? HOT 1
- Exception when using example Android App HOT 8
- Zephyr RTOS - Documentation HOT 2
- Th
- Cortex-M4 Code Migrating HOT 2
- Problem building the project - CMAKE HOT 2
- Program to sync Fitbit device on Windows PC
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 golden-gate.