Android Bluetooth Serial RFCOMM low baud rate / slow transmission

12,324

Firstly changing the baud rate on the Bluetooth RFCOMM / Serial Port protocol should not make a difference, since it is not a real serial port but just an emulation. (Specific manufacturers could so something special with it but Bluetooth in general or Android does not use the parameter to control over the air bit rates)

The factors that effect the data rate over SPP will be the size of the packets, the practical max data rate you can get over Bluetooth and how fast the receiver is reading / and how frequently the sender is sending. For the packet size you could look at internal documentations or try different sizes to reach an optimal number for your application. Also I would suggest sending multiple packets (or all) until the stream can send data continuously, similarly read continuously.

The main issue here for you seems to be the practical throuput you can achieve over Bluetooth. If you are using the non-EDR versions as you have mentioned in your question the theoretical speed at the very low level is 720Kbps , and adding protocol and application over heads as well as RFCOMM protocol overhead you could get max around 450-500 Kbps.

If you have access to both devices that are +EDR I.e Bluetooth version 2.0 or more + EDR then you can expect application throuput in the order of 1.2 to 1.5 Mbps ( theoretical over the air bit rate being 2.0 or 3.0 Mbps)

Share:
12,324
Saro Taşciyan
Author by

Saro Taşciyan

I'm a software developer started as a self taught amateur programmer when I was fourteen years old. At university I worked on various game projects. Beginning in third year I focused on .NET technologies. After graduation I started working on ASP.NET Web Applications and Win CE as .NET Developer. Although I want to expertise in .NET technologies, I have been developing Android applications using Java for nearly two years and I'm always interested in learning new technologies.

Updated on August 23, 2022

Comments

  • Saro Taşciyan
    Saro Taşciyan over 1 year

    I'm working on an Android Bluetooth project to send and receive data from a custom made hardware. I used Bluetooth Chat Sample in SDK as basis.

    I realized that there is no way to change baud rate on Client (Android phone) and baud rate will depend on hardware. I tried setting different baud rates on hardware and none met our expectations;

    Fastest i can get is 91Kbps (when baud rate is set to 2.7Mbps ~ 910Kbps). Using minimum baud rate (115Kbps) i get 43Kbps. I tried using different phones and it's the same. I need to transfer 170KB data per second to hardware.


    Specifications
    Protocol: Synchronized or generated data is sent to hardware using packages of maximum 520 bytes size. Hardware sends verify command after each package recieved and approved then phone sends next data package.
    Client: Android 2.3.3, Samsung galaxy w i8150, Bluetooth v3.0, RFCOMM
    Hardware: Custom, Bluetooth v2.1 BlueGiga WT11i


    I'm totally confused.. Can it possibly be a problem caused by Android or Bluetooth device on the phone? I wonder what the maximum baud rate is? Is there a way to speed up the transmission (like increasing maximum package size, or sending all packages without waiting for hardware verify commands).


    Edit
    After changing the package size to 4160 Bytes, Throughput has increased to 254Kbps. I'm trying to figure out the optimum package size to reach 1.5Mbps. I appreciate any suggestions