Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there a way to use classic BT instead of BLE to receive the file? #22

Open
BrandonStudio opened this issue Oct 18, 2022 · 2 comments

Comments

@BrandonStudio
Copy link

I'm worrying about the file transfer speed of BLE, so I'd like to use classic BT to receive the file. But I've seen no reference about OBEX or OPP or FTP on classic BT. Right now I can only send files in stupid SPP way.

It is better for me to use the OS native way to send the file (e.g. Android blutooth sharing & Windows bluetooth transfer)
Could you please tell me what I can refer to, or this is totally impossible for now?

@Vincent-Stragier
Copy link
Contributor

Hi @BrandonStudio,

I understand you want to use the “old” Bluetooth, but I won't recommand it. First, iOS devices are not compatible with it any more, which can be an inconvenient for some people. Second, BLE is the evolution of the older version of Bluetooth, which means it is an improved version. Third, in the current implementation, the BLE is quite verbose, which slows down the transmission (see #19 (comment) about this issue).

BLE alone should be able to attaint speed of 2 Mbps (or at least 1 Mbps, like the previous generation). I'm not sure the ESP32 is able to attaint these speeds, since the BLE stack is quite huge (so maybe the classic Bluetooth could be faster).

The OTA update is indeed quite slow, but Bluetooth is not used for its speeds but for its simplicity and low energy consumption (it's also more cost-effective than adding a physical programming port and easier to use for IoT devices). If you really need a fast flashing speed, you should use a wired update technique and esptool (it takes under 20 s to upload the code). Using Wi-Fi is probably the middle ground (not faster than a wired connection, but faster than using BLE).

If you have ideas to improve the speed of the update, they are welcome. @vovagorodok has implemented some changes to create an Arduino library (#19 (comment)). I did not follow the project, so I don't know its current state.

For the pure technical question, yes, it is possible to use Bluetooth to transmit an update file over the air. You “just” need to cut it in chunks of bytes and write the complete file in memory chunk by chunk before performing your update.

Using the native transmission means is not recommanded either, because they are not meant to handle an update process. No return about the state of the update, no control over what file has been sent (you can send anything, which could corrupt your device easily), no return about the current firmware version, etc.

You can however explore the concept of DFU (https://infocenter.nordicsemi.com/index.jsp?topic=%2Fsdk_nrf5_v17.0.0%2Flib_dfu_transport_ble.html). That way, you could directly use the nrf tool to update your firmware.

Best,
Vincent Stragier

@vovagorodok
Copy link

@vovagorodok has implemented some changes to create an Arduino library (#19 (comment)). I did not follow the project, so I don't know its current state.

Library fully tested and deployed to projects. Currently uploading works using python script and I'm trying to find someone or time to implement mobile app. I think that 12kB/s is maximum for BLE stack of ESP32

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants