v0.3 ยท Android & iPhone ยท Open source

Messages that hop phone to phone. No internet needed.

LinkMesh connects nearby Android phones over Bluetooth Low Energy and relays messages through each other, for blackouts, festivals, hikes and emergencies.

AyeshaNot in direct range ยท relaying via mesh
Chat
Are you at the north gate? Phones are dead here.via 2 devices ยท 18:02
Yes, by the food stalls. Coming to you.via 2 devices ยท 18:03 โœ“โœ“
Great, see you in 5.via 1 device ยท 18:04
๐Ÿ‘18:04 โ‡„
๐Ÿ†˜ SOS

What it does

The MVP covers spec steps 1โ€“5: discovery, messaging, mesh relay, storage, chat UI and SOS.

๐Ÿ“ก

Auto-discovery

Finds nearby LinkMesh phones over BLE and connects to the strongest ones automatically.

๐Ÿ”

Mesh relay

Every phone is a node. Messages hop up to 5 devices to reach someone out of range.

โœ“โœ“

Delivery receipts

Shows โœ“ sent, โ‡„ relayed and โœ“โœ“ delivered, plus "via N devices" for each message.

๐Ÿ“ฆ

Store & forward

If a chain breaks, messages wait and continue when a path comes back.

๐Ÿ†˜

SOS broadcast

One tap repeats an alert with GPS coordinates to every phone in the mesh.

๐ŸŒ™

Works when closed

With Bluetooth on, phones keep receiving and relaying in the background, even after a reboot.

๐Ÿ””

Distinct sounds

A soft glass chime for messages, and an SOS alarm that sounds even on silent.

๐Ÿ”‹

Battery-aware

Uses a low-power hardware scan in the background and limits connections to 5.

Mesh simulator

The same flooding rules the app uses, run in your browser. Pick a sender, then a recipient, and press Send. Double-click (or long-press) a phone to switch it off and watch the route change.

Tap a phone to choose the sender.
Frames transmitted0 Duplicates dropped0 Delivered-
โ— new frame   โ— duplicate (ignored) โ— delivery receipt (ack) Number under a phone = hop count it received

Sounds

Two custom sounds, synthesized for LinkMesh at 48 kHz / 16-bit.

๐Ÿ’ฌ Message chime

A two-note glass chime rising a fifth (D6 โ†’ A6): short, warm and easy to recognize in a pocket.

๐Ÿ†˜ SOS alert

"ยทยทยท โ€“โ€“โ€“ ยทยทยท" in Morse with bright two-tone beeps. It plays on the alarm channel, so it is heard even on silent.

How it works

Every phone runs both BLE roles at once. As a peripheral it advertises the LinkMesh service and accepts frames. As a central it scans, connects and writes frames to peers. The routing layer only uses a transport interface, so WiFi Direct and LoRa can be added later.

On every received message

  1. Seen this id before? Ignore it.
  2. Addressed to me? Store it and send an ack back.
  3. An ack for me? Mark the message โœ“โœ“ delivered.
  4. Otherwise, if hop_count < max_hops, relay it with hop_count + 1.
  5. Keep it in the relay buffer for 15 min and replay it to new peers.
{
  "id": "uuid-v4",
  "type": "text | ack | sos",
  "sender_id": "node-uuid",
  "sender_name": "Ayesha",
  "receiver_id": "node-uuid or *",
  "timestamp": 1759500000000,
  "content": "text message",
  "hop_count": 0,
  "max_hops": 5
}
LayerCodeTech
UIlib/ui/Flutter ยท Riverpod
Mesh routinglib/mesh/mesh_router.dartFlooding + dedupe + store-and-forward
Link layerlib/ble/ble_transport.dartflutter_blue_plus (central) ยท ble_peripheral (GATT server)
Storagelib/data/SQLite (sqflite)

Install & test

You need two or more real devices: Android 8+ phones, iPhones (iOS 15+), or a Mac. Android and iPhone talk to each other. Emulators and the iOS Simulator have no Bluetooth radio, so they can't connect.

๐Ÿค– Android: install the APK

  1. Download LinkMesh.apk on each phone.
  2. Allow "Install unknown apps". If Play Protect warns about a test build, choose Install anyway.
  3. Open the app and allow Nearby devices and Location.
  4. Tap the profile icon and give each phone a name.

Test scenarios

  1. Direct: two phones side by side should go to โœ“โœ“.
  2. Relay: put A and C out of range with B in the middle. Expect "via 1 device".
  3. Drop: turn B off, send, then turn B back on. The message should still arrive.
  4. SOS: tap SOS. Every phone should get an alert with coordinates.

๐Ÿ“ฑ iPhone: install with Sideloadly (free)

Apple only lets signed apps onto an iPhone. Until LinkMesh is on TestFlight, you sign the test build yourself with your free Apple ID. It takes about 5 minutes and needs a Mac or Windows PC and a USB cable.

  1. On your computer, download LinkMesh-iOS.ipa (above) and install Sideloadly. On Windows, also install iTunes and iCloud from apple.com, not the Microsoft Store.
  2. Connect the iPhone with a cable, unlock it and tap Trust This Computer.
  3. Open Sideloadly, drag in LinkMesh-iOS.ipa, enter your Apple ID and press Start. A spare Apple ID works too: it's only used to sign the app.
  4. On the iPhone, go to Settings โ†’ Privacy & Security โ†’ Developer Mode and turn it on (it restarts once).
  5. Then go to Settings โ†’ General โ†’ VPN & Device Management, tap your Apple ID and choose Trust.
  6. Open LinkMesh and allow Bluetooth, Location and Notifications.

Apps signed with a free Apple ID stop opening after 7 days. Just repeat step 3 to refresh it. Messages and settings are kept. AltStore works too and can refresh automatically over Wi-Fi.

iPhone notes: keep LinkMesh open (or recently used) for the best results. iOS pauses background apps, so an iPhone in the background stays reachable through links made while it was open, but isn't discovered by new Android phones. SOS alarms can't override silent mode on iPhone.

Once set up, phones keep receiving with the app closed while Bluetooth is on. Want to build it yourself? See the README.