Large File Transfer via Bluetooth Classic to ESP32

electron
Posts: 1
Joined: Sun Aug 16, 2020 9:37 pm

Large File Transfer via Bluetooth Classic to ESP32

Postby electron » Sun Aug 16, 2020 9:55 pm

I hope someone can help.
I am trying to use an ESP32 module in Bluetooth Classic mode programmed in Arduino IDE to receive an image file from my Android device running a bluetooth terminal application "Serial Bluetooth Terminal" by Kai Morich.

I have successfully connected the Android to ESP32-WRover and can easily send a few bytes of data to control functions on the ESP32.
My goal is to send a 1 to 2 MB JPG to the ESP32 that is then (after transfer) analyzed.

My first take was to read the Bluetooth data, copy it to the on-board Flash (PSRAM) and post process the data.
The initial symptom was buffer overflows. So I slowed up the speed by slowing the comm rate and in an other test increased the delay between bytes (in the range of 1ms).
Constantly I am getting buffer overflow.

So I tightened up the data storage (in fact removed it and ran the bluetooth available loop without any processing). Still got the overflow.

Can someone tell me if Bluetooth Classic has any type of handshaking? Is there any flow control in the ESP32 development boards - my is a ESP32-WROVER built by TTGO.
Just seems like the ESP32 won't get the data from the bluetooth buffer fast enough.
Can I issue bluetooth RTS and CTS signals from the ESP32 to the Bluetooth Terminal?

Thanks,

rodmcm
Posts: 47
Joined: Sat Sep 02, 2017 3:31 am

Re: Large File Transfer via Bluetooth Classic to ESP32

Postby rodmcm » Tue Aug 25, 2020 5:18 am

Most of my BT classic is limited to low numbers of bytes so I thought that I would try larger transfers.

This is the result of Bytes sent from an APP to an ESP32 using classic bluetooth, no delays introduced

The bytes are send via an array which I populated with the same character. At the end of the send I sent a finish char

The ESP counted the received characters and when the finish character was send reset the counter and printed out the start, stop times and number of bytes received

The attached is a random selection for each byte array size. I only once counted the correct number of bytes received as sent!!!!

Hope this helps....
Attachments
BT Byte Send.xlsx
(10.8 KiB) Downloaded 26 times

rodmcm
Posts: 47
Joined: Sat Sep 02, 2017 3:31 am

Re: Large File Transfer via Bluetooth Classic to ESP32

Postby rodmcm » Tue Aug 25, 2020 5:25 am

Second version of spread sheet, shows about 100K bytes/second transfer
BT Byte Send.xlsx
(11.16 KiB) Downloaded 42 times

Who is online

Users browsing this forum: No registered users and 11 guests