This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

speeding up data transfer rate from ios app to arduino with ble shield

Hi all,

I'm building an application for IOS & Red bear lab BLE shield and Arduino. The phone acts as a remote control for a toy car that I built . It works decently, but I would like the response time to be faster. I want to make the data transfer rate faster between the phone and the arduino. Please let me know if there is any way I could speed up the data transfer rate. It takes around 1/4 a second to get the data from the phone to the arduino

This is How I am sending the data from the phone

UInt8 pktbuf[6];

    pktbuf[0] = SYNC_BYTE;
    pktbuf[1] = _direction;
    pktbuf[2] = _angle;
    pktbuf[3] = (int)(self.sldr.value * 255);
    pktbuf[4] = _lightValue;
    pktbuf[5] = _hornValue;
    
    
NSData *d = [[NSData alloc]initWithBytes:pktbuf length:6];
    
[ble write:d];

How i am recieving the data on arduino

*while(ble_available()){

if(0xa5 == ble_read()){
  angleDirection = ble_read();
  angle = ble_read();
  motorSpeed = ble_read();
  lightValue = ble_read();
  hornValue = ble_read();

} }*

Any ideas or different ways to send data to speed this up?

  • 1/4tth of a second i.e. 250ms is quite slow. The reason may be that you are using a Write Request when sending from the phone to the Arduino. Another reason may be that your connection interval is quite slow, can you print the connection interval that was used on the link and verify that you are using a write command when sending info from the phone to the Arduino.

    The iOS should easily be able to do a connection interval of about 30ms in most cases so I would expect that to be your delay with some additional overhead.

Related