Hi,
In ESP32-WROOM32, We are trying to send large image file (1MB+) through Bluetooth and the same will be send to UART 0. But we are not getting full data. Many data missing found. Is there any limitation ? . We also tried to save the data from Bluetooth to internal file system then later trying to send to UART 0. But the issue remains same. So what could be the reason.
Is ESP32-WROOM32 capable of doing this ?. Is there any source code or library available if possible?
So kindly help us on this .
ESP32 Bluetooth large data transfer issue
-
- Posts: 9711
- Joined: Thu Nov 26, 2015 4:08 am
Re: ESP32 Bluetooth large data transfer issue
Hard to say, you could be losing data anywhere in the chain. Suggest you try to figure out where the problem is first: BT sender, BT receiver, UART sender, UART receiver.
-
- Posts: 3
- Joined: Tue Jun 15, 2021 5:49 am
Re: ESP32 Bluetooth large data transfer issue
In fact the problem is in Bluetooth receive section, When sending 1KB of .txt file to ESP32 using a mobile application (Serial Bluetooth terminal) the complete 1KB data is not receive.
The received data from ESP32 is 800bytes. Which will vary when multiple time data is sent through Bluetooth.
The received data from ESP32 is 800bytes. Which will vary when multiple time data is sent through Bluetooth.
-
- Posts: 9711
- Joined: Thu Nov 26, 2015 4:08 am
Re: ESP32 Bluetooth large data transfer issue
Well, then, how are you receiving the data over BT?
-
- Posts: 3
- Joined: Tue Jun 15, 2021 5:49 am
Re: ESP32 Bluetooth large data transfer issue
The data is received in ESP32 by using Bluetooth serial library (BluetoothSerial.cpp and BluetoothSerial.h). The core version using is Ver.1.0.4. Each byte is received by using SerialBT.read().
- Attachments
-
- sample_code_17062021.rar
- (654 Bytes) Downloaded 546 times
-
- Posts: 9711
- Joined: Thu Nov 26, 2015 4:08 am
Re: ESP32 Bluetooth large data transfer issue
Hm, no clue, sorry.
Re: ESP32 Bluetooth large data transfer issue
Do you still need help on this? The RAR file is corrupted and cannot be opened.
Thanks and regards,
Tharanga
Tharanga
-
- Posts: 9711
- Joined: Thu Nov 26, 2015 4:08 am
Re: ESP32 Bluetooth large data transfer issue
FWIW, that rar file opens perfectly fine here.
Re: ESP32 Bluetooth large data transfer issue
I had a similar problem. My ESP32 locked up after receiving 512 bytes. See my post https://www.esp32.com/viewtopic.php?f=19&t=22132. I could fix it by increasing the RX buffer size in BluetoothSerial.cpp to 2K. If you want to receive large files (like 1MB or more) I don't think that you can use this work-around. ESP32 may have enough memory on-board, but it also needs RAM for stack and heap in addition to whatever you assign for the BT RX buffer in BluetoothSerial.cpp.
It appears that the BTserial locks up when the RX buffer is full. It does not signal to the BT sender to suspend transmission and to resume when the RX buffer has been read by the application. The BT sender appears to be unaware of this limitation and just keeps sending until all data are gone, which means that all data beyond the 512 byte limit are sent into space.
It appears that the BTserial locks up when the RX buffer is full. It does not signal to the BT sender to suspend transmission and to resume when the RX buffer has been read by the application. The BT sender appears to be unaware of this limitation and just keeps sending until all data are gone, which means that all data beyond the 512 byte limit are sent into space.
Who is online
Users browsing this forum: No registered users and 25 guests