Coder Social home page Coder Social logo

Comments (2)

barbibulle avatar barbibulle commented on September 20, 2024

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.

nilstk avatar nilstk commented on September 20, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.