Skip to content

[Feature request] MeshCore app: let other apps on the phone share the radio (Local API) #3893

Open

Description

@jooray

A companion radio has one BLE connection, and the MeshCore app holds it. Another app that wants to use the mesh (a tracker, a road-event beacon, a bridge to the internet, a bot) has to take the radio away from the chat app, or ask the user to disconnect. In practice MeshCore on a phone serves one app at a time.

Reticulum solves this with a local daemon. One app holds the interface, and other apps on the same device talk to it. I'd like the MeshCore app to offer the same thing, with a protocol that other MeshCore apps implement too. Then a client app doesn't care which MeshCore app the user runs.

There is a written specification, test vectors and client libraries (Kotlin, Python, JS):
https://github.com/jooray/meshcore-local-api

In short:

  • A WebSocket on 127.0.0.1 only. It is off by default and refused to browsers (any request with an Origin header).
  • Each app pairs once with a P-256 key. The user approves it in a dialog that shows the app's name and the key's fingerprint, and can revoke it later.
  • Apps subscribe to channel data by channel and dataType (for example 0x0150 Road Events), and send channel data and text. Sends go through the app's normal send path, flood scope and rate limits. The API can't change radio settings, contacts or keys. The only change it can ask for is adding a hashtag channel, and the user confirms that in a dialog.
  • Optional features are announced as capabilities, so an app can start with the core only. Examples: regions, zero-hop or direct paths, replay of data received while the client wasn't running, contacts and direct messages.

Where it runs today:

Appendix B of the spec is a short checklist for adding it to an app. I'd be glad to help, or to change the spec where it doesn't fit the MeshCore app.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions