Skip to content

Conversation

@aleksejspopovs
Copy link

@aleksejspopovs aleksejspopovs commented Jan 22, 2026

Summary

This PR adds support for a very simple custom BLE protocol for receiving files from a phone. It is intended to be used with an Android app I'm also working on called Longform that can send arbitrary files over to the X4 but can also use the Accessibility API to scrape text from any app on your phone, so that you can quickly send an article from any app to your reader.

Here's a 35s demo:

P1212004.MP4

I figure this is not quite ready to merge yet given that Longform is not yet available on the Play Store, but getting there might still take me a bit because there's still a bit of polishing to be done and probably some work to be compliant with the store's requirements for apps using Accessibility APIs. So I wanted to share this branch here and see if there's any interest in this in the first place, or any feedback (is there a more standard BLE protocol I should be using here? did I fundamentally misunderstand anything about the architecture of Crosspoint?).

Additional Context

  • the ESP32-C3 only supports BLE, not Bluetooth Classic, so we cannot implement the Object Push Profile, the usual Bluetooth file transfer protocol
  • framework-arduinoespressif32 comes with a Bluedroid-based BLE stack included, but it uses a lot of Flash/RAM and has a weird callback implementation that makes it impossible to actually use BLE Write With Response as intended. That's why I pull in the lighter (and supposedly more performant) h2zero/NimBLE-Arduino.

AI Usage

Did you use AI tools to help write this code? PARTIALLY

The code in this PR was written by hand with some AI autocomplete. (The Android app, which is not part of this PR, is 100% vibe-coded.)

@Uri-Tauber
Copy link
Contributor

What the transfer rate you were able to achieve? I think BLE is very slow - maybe 20kbps. is it worth it when we can use Wifi for much faster and stable communication?

@ngxson
Copy link
Contributor

ngxson commented Jan 22, 2026

I think another thing worth consider is that the BLE stack of Arduino / esp-idf is quite large and can take up a significant amount of flash, especially when allowing BLE+Wifi to coexist.

@aleksejspopovs
Copy link
Author

What the transfer rate you were able to achieve? I think BLE is very slow - maybe 20kbps.

I have not measured it, and the protocol I implemented is far from optimized for maximum transfer rate. Espressif quotes 700 Kbps in good conditions, fwiw. In the video you can see that transferring a short article took around 2s—far less time than it took Crosspoint to index the file.

is it worth it when we can use Wifi for much faster and stable communication?

My experience with WiFi on the X4 has been far from stable. But the main reason I reached for BLE here is the quick and hassle-free connection: the use case I have in mind is on-the-go transmission of short articles, not syncing an entire collection, so not messing with my phone's WiFi connection/not wasting time associating and re-associating with networks seemed more worthwhile to me than shaving some time off an already acceptably fast transfer.

I think another thing worth consider is that the BLE stack of Arduino / esp-idf is quite large

I did mention on the PR that this is why I am not using Espressif's stack, which indeed is prohibitively large. With NimBLE, this PR adds 6416 bytes to RAM use (+1.9%) and 202K to flash (+3.1%).

@aleksejspopovs
Copy link
Author

Setting this to "ready for review" as I haven't received any further feedback. I've been running this for the past few days and it's been working well. I'm now preparing a submission to the Play Store.

@aleksejspopovs aleksejspopovs marked this pull request as ready for review January 27, 2026 02:11
Copy link
Member

@daveallie daveallie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the submission @aleksejspopovs! In the interest of ensuring that future travelers can improve upon this (and so that Longform doesn't have to be the only implementation), can you please include some documentation about the protocol (a link back to https://github.com/aleksejspopovs/longform/blob/main/app/docs/BLE%20Protocol.md would be enough).

As you mention, Longform isn't available yet, and while I'll look over the rest of the code and am comfortable adding this functionality to CrossPoint, I'd like to wait until Longform (or another implementation) is available before this is merged.

@aleksejspopovs
Copy link
Author

Makes sense, and thanks for taking a look! I just finished the Play Store submission, Google says it will be reviewed "in under seven days, or longer" 🙃 I'll let you know when that's done.

In the next few days I'll add a link to the protocol docs and rebase&retest on top of 0.16.0.

@tweitzel
Copy link

tweitzel commented Feb 2, 2026

Is it feasible to make this use the standard bluetooth object exchange push which has been around since 1997?

@aleksejspopovs
Copy link
Author

@tweitzel from the PR description:

the ESP32-C3 only supports BLE, not Bluetooth Classic, so we cannot implement the Object Push Profile, the usual Bluetooth file transfer protocol

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

Successfully merging this pull request may close these issues.

5 participants