jrl290 wrote:
I've seen a few people mulling around this idea, where BLE is itself an interface. I don't especially love RNode. And I think that a "just works" bluetooth interface is feasible for building into RTNode
(Torlando if you're around and want to chime in)
This is what I'm imagining:
- BLE 4 GATT advertisement of service and data available (so no BLE 5 extended advertisement)
- BLE 4.3 Encrypted bonding negotiation with a 4-byte data available ID
- Short lived Encrypted GATT connections for data transfer
5 "data available" IDs could be advertised simultaneously
Now, the idea of this is not to have peer meshing of battery devices. I think that's untenable. The idea is to have the same functionality as RNode without having to pair one-to-one to a device. Both for convenience and for serving multiple devices
What do you guys have out there, or if not published, are already working on? Maybe we can converge on a protocol
Super glad you're bringing this up. I feel the same way, and am right at the cusp of releasing my RNS port (about 1 week away now), which includes exactly this "BLE Auto-interface". You can see the sneak peek of it working cross-platform (desktop, mobile, and embedded) here: https://rns.recipes/forum/showcase/sneak-peek-your-personal-reticulum-hopspot
I'm also super with you on the stewardship of device battery, but I came to somewhat opposite conclusions on the approach. Scanning duty is the biggest lever to pull. Keeping an idle connection open is pretty cheap. I tried taking the angle you did at first too, but you end up (a) paying a lot of setup tax repeatedly, and (b) actually have a worse scanning obligation.
Any delay in picking up an advertisement is a data delay, so you have continual pressures on you to keep increasing the scan duty to properly handle that. And as soon as you start increasing that, you're hurting the battery the most. Now you might say (liek I did at first), "well the RNS network is meant to be latency-tolerant so that's fine", but it's trickier than that!
When you advertise that you have data, how far back does that go? Do we risk nodes constantly losing a bunch of data because the scan duty leaves gaps based on how long your peer retains data for? The obvious solution of "retain more data" is hostile to embedded sadly (who'd have to constrain themselves, again possibly bumping into the loss from your scan window).
On top of that, consider: links are time-sensitive, and large data can be moved over resources. Latency and history-storage costs surfacing again. ANd remember this would be at each and every hop including pure transport relaying, propagating that latency and storage pressure.
So my toiling led to the opposite conclusion, which is to intentionally look for those you can connect to eagerly and stay connected. Then, scan duty can stay lighter beacuse it's just delay to first contact, instead of the above thorny thicket of latency and storage concerns.
This is of course extremely early and open to refinement (the point of this thread), but the general approach I'm using is based on the learnings of tackling this problem so far, and is as follows:
Every platform implementation has a limit on total # of settled peers. While at least one of those slots is open:
- Every node scans and advertises (legacy-connectable) a protocol-known service UUID
- Every node eagerly dials to peers advertising
- In the initial handshake there's a BLE identity (specifically nothing to do with any RNS identity on the node), but that allows for correlating after reconnects and also:
- It's expected both sides will often dial each other. The BLE identity tells when there's a duplicate, and duplicates are resolved with a determinsitic keeper duel using info from the handshake.
- From there, it will continue to use the GATT as control plane, and will also use it for data plane as a fallback, but when possible an L2CAP CoC upgrade is attempted for the data plane and used when available instead of GATT.