Transmit 10kBytes data using BLE - SERIAL

gchini
Posts: 18
Joined: Wed Jun 08, 2022 1:41 pm

Transmit 10kBytes data using BLE - SERIAL

Postby gchini » Fri Oct 06, 2023 7:52 am

Hi at all,

I need to transfer max 10kBytes of data from / to (bidirectional way) an ESP-32 and another ESP-32 (or a phone if this is simpler) using BLE.

The idea si to have one ESP-32 as a peripheral and another ESP-32 as central (or a phone application) that transmit some data (max 10k) to another ESP-32.
  • The peripherals broadcast it's presence
  • The central connects to the peripherals
  • The central transmit some data to the peripherals
  • The central ends its stream
  • The peripheral takes data and do some computation locally based on it's local enviroment (sensors)
  • The peripherals return the computed data to the central
  • The central that reads the data
  • The peripherals ends its stream and force to close the connection and is ready for another cycle

There are no security issue, the data can be compleately readable but they need to be readed correctly. I want to avoid to use Arduino libraries or I can use if its intregrates with ESP-IDF.


Then, the condition are:
  • Using BLE
  • Transfer 10kBytes of data BIDIRECTIONALLY
  • Data transmission between peripheral and central (that could be also a phone)
  • No security issue
  • No Arduino enviroment, yes Arduino libraries if intregrated in ESP-IDF enviroment
  • No strict time constraints, the tranfer of 10kBytes can be done in seconds (around 5 sec)
Questions:
  • There are some examples/guides you can link me to realize what i want?
  • Is it possible implements some "serial transmitter" to transmit the data? There allredy is some library available and where?
  • Should I use GATT profiles to transmit data and reconstruct (sort and combile) it at the other side? Isn't too involved?
  • Can you have an idea of some strategy to solve the problem?
Many thanks for your reply and your time spent for me (and for who read this post).

MicroController
Posts: 1736
Joined: Mon Oct 17, 2022 7:38 pm
Location: Europe, Germany

Re: Transmit 10kBytes data using BLE - SERIAL

Postby MicroController » Fri Oct 06, 2023 12:50 pm

Is it possible implements some "serial transmitter" to transmit the data? There allredy is some library available and where?
You can look at the "BLE SPP" examples: https://github.com/espressif/esp-idf/tr ... spp_server

Alternatively, you can look into BLE "long reads" and "long writes".

gchini
Posts: 18
Joined: Wed Jun 08, 2022 1:41 pm

Re: Transmit 10kBytes data using BLE - SERIAL

Postby gchini » Fri Oct 06, 2023 3:02 pm

SSP is only for Bluetooth classic

I need Bluetooth BLE

I'll thake a look to BLE "long reads" and "long writes" but if someone can give me more ideas you are welcome!

MicroController
Posts: 1736
Joined: Mon Oct 17, 2022 7:38 pm
Location: Europe, Germany

Re: Transmit 10kBytes data using BLE - SERIAL

Postby MicroController » Fri Oct 06, 2023 4:24 pm

gchini wrote:
Fri Oct 06, 2023 3:02 pm
SSP is only for Bluetooth classic

I need Bluetooth BLE
Either or both may be true. But neither should keep you from looking at the BLE examples I linked to.

MicroController
Posts: 1736
Joined: Mon Oct 17, 2022 7:38 pm
Location: Europe, Germany

Re: Transmit 10kBytes data using BLE - SERIAL

Postby MicroController » Fri Oct 06, 2023 5:05 pm

Btw, if you don't like Bluedroid, you can use NimBLE instead, which has support for "Connection-oriented Channels" (CoC), see here.

Who is online

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