Transfer big data via bluetooth/ble?

priema
Posts: 4
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: 1067
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: 4
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: 1067
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: 4
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: 1067
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: 4
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

Who is online

Users browsing this forum: Google [Bot] and 50 guests