Transfer big data via bluetooth/ble?

priema
Posts: 5
Joined: Sun Apr 05, 2020 5:27 pm

Transfer big data via bluetooth/ble?

Postby priema » Sun Apr 05, 2020 5:49 pm

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 ;)

chegewara
Posts: 2376
Joined: Wed Jun 14, 2017 9:00 pm

Re: Transfer big data via bluetooth/ble?

Postby chegewara » Tue Apr 07, 2020 1:58 am

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?

priema
Posts: 5
Joined: Sun Apr 05, 2020 5:27 pm

Re: Transfer big data via bluetooth/ble?

Postby priema » Tue Apr 07, 2020 6:11 am

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

chegewara
Posts: 2376
Joined: Wed Jun 14, 2017 9:00 pm

Re: Transfer big data via bluetooth/ble?

Postby chegewara » Tue Apr 07, 2020 12:08 pm

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.

priema
Posts: 5
Joined: Sun Apr 05, 2020 5:27 pm

Re: Transfer big data via bluetooth/ble?

Postby priema » Tue Apr 07, 2020 4:00 pm

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

chegewara
Posts: 2376
Joined: Wed Jun 14, 2017 9:00 pm

Re: Transfer big data via bluetooth/ble?

Postby chegewara » Wed Apr 08, 2020 7:35 am

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.

priema
Posts: 5
Joined: Sun Apr 05, 2020 5:27 pm

Re: Transfer big data via bluetooth/ble?

Postby priema » Fri Apr 10, 2020 9:09 pm

ok thank you for your reply.
I will try to shrink my data size and try classic bluetooth.

br
priema

Jaben23
Posts: 2
Joined: Sat May 22, 2021 11:54 pm

Re: Transfer big data via bluetooth/ble?

Postby Jaben23 » 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

priema
Posts: 5
Joined: Sun Apr 05, 2020 5:27 pm

Re: Transfer big data via bluetooth/ble?

Postby priema » Mon May 24, 2021 7:18 am

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

jimmywong2003
Posts: 5
Joined: Wed May 01, 2019 9:10 am
Location: Hong Kong
Contact:

Re: Transfer big data via bluetooth/ble?

Postby jimmywong2003 » Tue Sep 21, 2021 12:27 pm

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

Who is online

Users browsing this forum: No registered users and 74 guests