Page 1 of 1

Transfer big data via bluetooth/ble?

Posted: Sun Apr 05, 2020 5:49 pm
by priema
I am currently building a project with following vision:
- buffers motion data on the ESP32 in a file -> send this data after a while (once per hour) to an app (iOS/Android)
-> working approach:
--> App connect to ESP32 via BLE -> WORKING
--> App sends data to ESP (trigger for ESP to send saved motion data back) -> WORKING
--> ESP sends all the saved motion data to the App -> PROBLEM

I tried to send data via BLE (BLECharacteristic) and this works with small data (~50byte).
Currently I'm saving the motion data as a String -> final I wanna save it binary (todo for later)

Current Chip: esp32-wrover-b
Library: https://github.com/nkolban/ESP32_BLE_Arduino

Questions:
- How can I send large data via Bluetooth/BLE?
- Is there a difference between BLE and Bluetooth on the ESP32?
- Is my described approach above best practice or is there potential for optimization?

I think/hope that this is not to difficult - there are so many smart-trackers on the market which save and send data in a similar way

I have some experience with arduinos and esps but not so much with Bluetooth.
Thank you for your support ;)

Re: Transfer big data via bluetooth/ble?

Posted: Tue Apr 07, 2020 1:58 am
by chegewara
There is few aspects you have take for consideration:
1) file size - what means big file, (for example i am sending 1,3MB+ file over BLE in OTA over BLE),
2) what speed you are expecting,
3) what framework you want to use for android/iOS, for example i found that ionic cordova and flutter does not support classic bluetooth or support is bad, most likely it wont be problem with native code,
4) other aspects?

Re: Transfer big data via bluetooth/ble?

Posted: Tue Apr 07, 2020 6:11 am
by priema
Thanks for your replay chegewara :)

1) file size about 2.8 MB
2) 2.8 MB within 30-60 sec - the faster the better
3) for the app I'm using Ionic with the plugin (cordova-plugin-ble-central and @ionic-native/ble)

Is this filesize and transfer speed possible?
Which methodology and process can I use to build this?

br,
priema

Re: Transfer big data via bluetooth/ble?

Posted: Tue Apr 07, 2020 12:08 pm
by chegewara
1) its a big file,
2) not possible with BLE, with this size it will take 5+ minutes,
3) i am using this plugin https://ionicframework.com/docs/native/bluetooth-le,
If you want to have better throughput its advised to use classic bluetooth, maybe this plugin:
https://ionicframework.com/docs/native/bluetooth-serial
but i didnt try it yet. Im not even sure it is bluetooth classic plugin.

Re: Transfer big data via bluetooth/ble?

Posted: Tue Apr 07, 2020 4:00 pm
by priema
how long does it take for your 1.3 MB file to transfer?

so one other possibility would be to use classic bluetooh on the ESP32-WROVER-B, right?

br
priema

Re: Transfer big data via bluetooth/ble?

Posted: Wed Apr 08, 2020 7:35 am
by chegewara
I dont remember correct numbers now, but its similar speed to UART flash with 115200.
so one other possibility would be to use classic bluetooh on the ESP32-WROVER-B, right?
You can use wrover or wroom module. All but ESP32S2 modules have bluetooth classic and BLE.

Re: Transfer big data via bluetooth/ble?

Posted: Fri Apr 10, 2020 9:09 pm
by priema
ok thank you for your reply.
I will try to shrink my data size and try classic bluetooth.

br
priema

Re: Transfer big data via bluetooth/ble?

Posted: Sun May 23, 2021 12:50 am
by Jaben23
Hello! Did you already solve it? Can you share your´e code and app you are using? I just want to send data.txt file that is in the SD by bluetooth to the phone

Re: Transfer big data via bluetooth/ble?

Posted: Mon May 24, 2021 7:18 am
by priema
Hi,

i didn’t try it with the classic Bluetooth connection.
If you have a library which only gets the file as parameter and does everything else (classic Bluetooth or BLE - depending in file size) you can share it here :)
Jaben23 wrote:
Sun May 23, 2021 12:50 am
Hello! Did you already solve it? Can you share your´e code and app you are using? I just want to send data.txt file that is in the SD by bluetooth to the phone

Re: Transfer big data via bluetooth/ble?

Posted: Tue Sep 21, 2021 12:27 pm
by jimmywong2003
if you would like to send the data from the device to IOS, the idea is to keep to send data through the notification and configure the connection interval to 15ms (min and max).

I did the example on the nordic nRF52.

https://jimmywongiot.com/2021/05/28/vid ... 52-series/

I think it should be very similar to use the ESP32 case.

Jimmy