Skip to content

MeshCore Rooms (BBS)

Developer reference for MeshCore Rooms login/post, session RPCs, saved passwords, auto-sync scheduling, or room wire text. Repo-wide rules live in AGENTS.md.

  • UI split: Chat → Rooms (RoomsPanel.tsx) lists joined/engaged rooms only (saved guest credential, favorite, last-post sync watermark / last-read, auto-sync / auto-login, or an active BBS session). Membership helpers live in meshcoreRoomMembership.ts. Network → Room servers (RoomServersPanel.tsx) lists discovered hw_model === 'Room' contacts that are not joined — browse, favorite, Open → Chat Rooms (handleOpenRoom). Empty Chat Rooms points users at Network → Room servers. Remove from Rooms (More menu / Room details) logs out if needed, forgets saved password, unfavorites, clears last-read + last-post watermark, and returns the room to Network → Room servers (local post history is kept).
  • Chat Rooms chrome: shared chat/ConversationLayout (same as RRC): room list column (hidden with mesh-client:roomsListCollapsed; no initials rail; 288px wide, so its header keeps the title with the Order / Sync / collapse icons and puts Log in all and the Docs link on a second row), the open room with one header (Search, Starred, Mute, Room details, Leave, and a More menu with Jump to date, Export and Manage on Repeaters; before login only Room details), and a Room details side panel (auto-login / auto-sync switches, sync interval, forget password, Members + ACL refresh via get acl; opens before login too, ACL needs an admin session) docked at 1280px and up (mesh-client:rooms:detailsCollapsed) and a sheet below. Phones (under 768px) show the list or the room, with Back. Login card replaces the conversation body until logged in; post composer is ChatComposer. Room list markers are StatusDot tones from meshcoreRoomSidebarMarker.ts (green logged in, blue saved password, hollow ring none). Manage on Repeaters jumps to Repeaters & Rooms ops (CLI / setperm / infra). Rooms tab badge (summed into the Chat rail badge) via meshcoreRoomsUnread.ts counts joined rooms only (mesh-client:meshcoreRoomsUnread). Blank guest Login = read-only when allowed; "hello" is the default read/write guest password; Continue read-only also sends blank. Cancel login aborts the outer login op (path resolve + SendLogin) via meshcoreBeginRoomLoginOperation / meshcoreCancelRoomLogin; queue TX-spacing waits are interruptible so Cancel does not sit out the 60s mesh spacing.
  • Ops (not on Rooms / Room servers tabs): Ping / Status / Neighbors / Sensor / Configure / CLI / ACL setperm live on RepeatersPanel (mixed Repeater + Room table). Manage opens the shared configuration panel for that room, including guest access, ACL permissions, and Default flood scope; Advanced opens the existing CLI. Open room on a room row jumps to Chat → Rooms. Guest passwords stay in meshcoreRoomCredentialStorage; ops admin uses meshcoreInfraAdminSecrets (admin-only records allowed).
  • Server flood scope (firmware v1.15+): Configure → Default flood scope reads region default; Apply sends region default <name> (blank becomes <null>) and verifies another read before reporting success. The firmware persists the change and can create the region automatically. Public region names are limited to 30 UTF-8 bytes; unsupported firmware disables the field. This scopes the server’s flooded adverts and room delivery; known direct routes, subscriptions and guest/admin permissions remain separate. It uses the existing serialized admin CLI path, with the same connection/node guards as other configuration writes. Companion channel scopes are separate local preferences.
  • Room remote CLI: needs room admin password via SendLogin ACL (meshcoreCancelRoomLogin then admin login inside sendRepeaterCliCommand); guest BBS login is not enough (repeatersPanel.roomCliNeedsAdminPassword).
  • Post length (single-packet): room posts use the shared ChatComposer (variant="room") and are single-packet like MeshCore chat — over the room payload limit (getMeshcoreRoomPayloadLimit in chatComposerLimits.ts) the send is blocked with the same meshcoreSingleNotice callout rather than split into [i/N] parts, and the ~5s fast-send advisory applies. See chat.md (Composer limits / send cadence).
  • Session / RPC: meshcoreRoomSession.ts, meshcoreRoomLoginRpc.ts, meshcoreRoomPostRpc.ts, meshcoreRoomLogoutRpc.ts, meshcoreRoomLoginQueue.ts, meshcoreRoomLoginPathSync.ts, meshcoreRoomSentWait.ts; credentials in meshcoreRoomCredentialStorage.ts / meshcoreRoomSyncStorage.ts. LoginSuccess: prefer v7+ permissions (PERM_ACL_); reserved is the legacy admin/guest hint (0=RW, 1=admin, 2=guest) — do not treat it as ACL. Hops: resolveMeshcoreRoomLoginHopsAway uses route bytes when UI hops are 0, and treats sticky UI hops with an empty path as 0-hop so SendLogin is not blocked as noRoute. History catch-up:* resetMeshcoreRoomCompanionSyncSinceForCatchUp remove+re-adds the companion contact (firmware zeroes sync_since only on new contacts) when this device has no local last-post watermark; add is retried if remove already succeeded so the contact is not left deleted.
  • Saved passwords: meshcoreRoomSavedSecrets.ts — sidebar/overlay Forget / Stop auto-login / Enable auto-login (login card, when a saved password exists but auto-login is off). Connect auto-login skips rooms with no saved guest password (listMeshcoreRoomAutoLoginOnConnectNodeIds; admin-only records do not count), so turning the Room details switch on while logged in saves the session guest password first (saveMeshcoreRoomSessionPasswordIfUnsaved, including into an admin-only record); with no session and no saved guest password the switch stays off. forgetMeshcoreRoomSavedSecrets clears credential + disables auto-login and auto-sync; disableMeshcoreRoomLoginAfterAuthFailure disables both without clearing password or in-memory failure UI.
  • Scheduler: meshcoreRoomSyncScheduler.ts + useMeshcoreRuntime.ts — periodic re-login (Auto-sync, RF-only) goes through the same loginRoom path as the UI (path sync, catch-up, abort, waiting-message drain) with schedulerFastPath (skipTrace / MESHCORE_ROOM_SYNC_ROUTE_RESOLVE_FAST_MS). Single-flight ticks. Auth failure (LoginFail only, see below) disables auto-sync and auto-login via disableMeshcoreRoomLoginAfterAuthFailure. Timeouts in timeConstants.ts (shorter for TCP / 0-hop).
  • Connect auto-login: meshcoreRoomAutoLoginOnConnect.ts + useMeshcoreRuntime.ts — 500ms debounce (MESHCORE_ROOM_AUTO_LOGIN_DEBOUNCE_MS) when Room contacts appear (roomAutoLoginReadyKey, including pubkey-ready). Overlapping triggers share one pass (runMeshcoreRoomAutoLoginSingleFlight) and dirty-re-run so a second room hydrating mid-pathSync still logs in. Disconnect bumps a generation so a dying pass must not SendLogin on the new conn (also clears transient in-memory auto-login failures). Skips logged-in, queued (meshcoreIsRoomLoginQueued), sticky auth failures (shouldSkipMeshcoreRoomAutoLogin), and not-yet-hydrated contacts. Transient timeouts/path errors still set the sidebar failure banner but do not sticky-skip further connect auto-login; auth/LoginFail still disables auto-login+sync via disableMeshcoreRoomLoginAfterAuthFailure.
  • What counts as a wrong password: only a LoginFail push (MESHCORE_ROOM_LOGIN_REJECTED_MESSAGE from meshcoreRoomLoginRpc.ts, or the roomLogin.rejected* message meshcoreRoomLogin throws for it), checked by meshcoreRoomLoginErrorIsAuthFailure. A companion RESP_ERR to SendLogin is a MeshcoreRadioRejectedError with its firmware code (shown as radioContactMissing / radioContactTableFull / roomLogin.failed); like route-programming refusals ("radio rejected request"), it is transient and never turns auto-login or auto-sync off. Do not classify by the word "rejected": the companion protocol has no request ids, so an RESP_ERR for another command can land on a waiting SendLogin. meshcore.js 1.15.1 does not emit LoginFail (0x86); patches/README.md records that the handler was not carried because stock room firmware does not answer a bad password, so in practice a wrong password times out.
  • Room post authors: SignedPlain 4-byte pubkey prefix → contact/registry map at ingest. meshcore.js decodes contact message text as UTF-8, which loses prefix bytes from 0x80 up and cuts the post at a 0x00; the local patch (patches/@liamcottle__meshcore.js@1.15.1.patch) keeps the 4 prefix bytes as one char each for SignedPlain and decodes only the body (meshcoreRoomPostAuthorWire.test.ts). An author who is not a known contact still shows as Unknown. A room post's event has the room server as from, so when the same post arrives again (a drained waiting message is dispatched by both the protocol subscriber and meshcoreProcessWaitingMessageItem, and rooms resend history) PacketRouter keeps the author, name and body already stored for that id instead of writing the room's name over an Unknown author (meshcoreIngest.test.ts, "room posts dispatched through PacketRouter"). A room post id ends with the post's body as stored (meshcoreRoomMessageId, used for live posts, own posts and rows read back at launch), so a stored row under that id is this post, two different posts in the same second keep two rows, and a post the room resends after a restart lands on its reloaded row. Reload builds that id from the saved text and author (meshcoreHydratedMessageRecords with the saved rows), not from what the reload repairs show, because those repairs can rewrite a post (an unknown author's Name: text reloads as a post by "Name"). A raw author prefix is recognised outside SignedPlain only by characters a UTF-8 decoded key byte leaves behind: U+FFFD or a control character other than tab, line feed and carriage return (looksLikeSignedPlainWirePrefix). Text that starts with letters in any script, an emoji or a short first line keeps its first four characters, live, on display (App.tsx runs repairMeshcoreHydratedMessages over every MeshCore message) and after a restart. A non-SignedPlain line with no author prefix (for example "Bot Stats (24h):") is the room server's own line: meshcoreIngest stores and saves it with the room as author under the room's full name, and the live decoder puts the room in its id the same way (isMeshcoreRoomOwnLine in both), so its live id matches the one a reload builds. PacketRouter stores each event's raw copy before the ingest runs; the ingest drops that copy (a record with no status, which ingested, reloaded and own sending rows always have) before deduping, so a line whose raw text is already its body is not taken for a repeat of itself. Unknown/sender_id 0 twins of a named post (same room/body/time) collapse via meshcoreRoomPostMatch / hydrate meshcoreReconcileRoomSenderIds + repairMeshcoreHydratedRoomPostDuplicates.
  • Retention: pruneMeshcoreMessagesByCountOn in database.ts keeps the newest N room posts (rows whose MESHCORE_MESSAGE_CHANNEL_SQL is -2, the same rows hydration loads into the room window) apart from the newest N channel and DM rows, per identity_id, N being the MeshCore Cap stored messages count. Busy traffic on one mesh profile therefore cannot prune another profile's history. DM-shaped posts from older builds stay in the channel and DM pool. The contact prunes skip Room contacts that hold posts of either kind (NO_STORED_ROOM_POSTS_SQL).
  • Wire text: meshcoreChannelText.ts — channel/DM/room payloads, SignedPlain inbound strip, tapback/reply lines; meshcoreGifWire.ts — Open g:GIFID; meshcoreOpenReaction.ts — Open r:HASH:INDEX. Default companion keyless outbound; opt-in Open wire via Radio meshcoreOpenWireCompatEnabled (UI on RadioPanel).