Conflicts resolved by keeping both sides:
docs/cli/README.md, docs/guide/features.md (parts/reactions + relay mark)
meshterm/core/preferences.py (reaction_emoji, message_parts_max + heard_wait_s)
meshterm/services/chat_service.py (reaction check + upstream mute/listed split)
meshterm/ui/chat.py (reaction count + relay mark in the render cache;
each sent part is tracked for the relay mark)
meshterm/ui/tui/session.py: upstream's "e": "reveal" is kept, and the
chat screen takes "reveal" as react, so ^E still reacts in the chat.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0174TBnQH8S3nYNaxo5zk9Yu
The page had drifted behind the firmware. Three statistics frames arrive
at each open and the panel drew nine rows from them, so the outbound
queue, the firmware error count, and the split of the packet counters
into flood and direct were read and thrown away. The device-query frame
carries the companion protocol version and the contact and channel
capacities, and nothing in MeshTerm had ever asked for them. The
default flood scope was one row named Flood scope, between the two
auto-add rows, with no key beside it. The key of the node itself was
nowhere on the page.
The panel now has four groups, in the order a user asks them in. What
the node is: role, public key with the routed bytes lit, model,
firmware with the protocol version, and place. What MeshTerm does with
it: the scope and the transport key of that scope, the active site with
the outbound paths and kept device routes that apply, and the name of
the radio preset. How it is doing: battery, storage, its own sensor
readings, the clock with its drift, uptime, contacts and channels
against the capacities, the queue, and the errors. What it heard and
sent: the noise floor, the airtime, and the packet counts, split.
A node with no scope says that its floods reach everyone, because an
empty value there is a statement and not an absence. A node whose
stored scope key is not the key of its own name says so in amber: a
flood under that key reaches no repeater that listens for the name, and
nothing else in MeshTerm could show it.
The rows sit in a two-column grid, so a value wider than the panel
wraps under its own column instead of going back to the left edge, and
a 64-digit key stays whole. The gallery draws the panel now, so both
platforms hold it to their readable width.
Two new device reads, both optional and both answered by any firmware:
the scope frame read for its key as well as its name, and the sensor
readings of the node itself, which MeshTerm had never asked any device
for. The device-query frame is no longer read twice at each open, since
the snapshot already merges it.
The scripted face answers with the same three parts: the status, the
readings, and every setting. The settings come from the one definition
that config show answers with, under the keys config get and config set
take, so the two faces cannot drift and no setting is spelled two ways.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
A mention in a DM plays the DM sound. The sound keys of this unpushed
work are not retired: they never left this machine.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The first switch (sounds on or off, off by default) becomes a mute,
off by default: "no sound" is a theme. The volume is now ten steps.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The first build counted only the relays past the first hops of the
outbound paths. On JP's Public channel, 23 of 23 sent messages came back
only through the two home repeaters: each repeater relays one time, and
the next hop (8 km away) is too far for the companion to hear. So every
message showed the warning mark, and nothing was ever confirmed.
Now each repeater that sends a copy back counts, the same as a DM ack:
spinner, then a check with the number of repeaters, or a cross. The
warning state, the near-relay snapshot of each send, the ^P atom, and
heard_via are removed. heard_relays keeps only the paths; a database with
the first build of the table gets it made again (derived data only).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A channel has no acknowledgement, but the radio hears each repeater that
relays our message, and each copy names the relays that it went through.
The end of our channel message now shows a spinner, then a check and the
number of relays past the near relays (the first hops of the outbound
paths that apply), a warning when only the near relays sent it back, or a
cross when no relay did. A near relay is near by identity, at any place
in a path. Managed nodes play no part: a remote managed repeater counts.
- services/heard_by.py: the verdict, and a tracker that fills in the
background and refreshes on each channel packet. Settled verdicts are
stored (schema 24, heard_relays), with the near relays of each send.
- The picked message names the relays and the near relay that carried it.
- ^P counts the relays past the near relays.
- chat history --channel: a HEARD lane; --json gives heard, heard_by,
heard_via.
- New preference heard_wait_s (Relay wait, 30 s).
- Fix: a copy of our own channel message must carry the time of that
send, so two messages with the same text no longer share copies.
Closes#38
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Enter on a received channel message whose sender has no known key opened
Trace path, out to the first relay and back. The sender is a companion
(only a companion sends channel text), so it is the target of the walk,
and the rules of a target that does not relay apply. The dialog now opens
Trace target under the name of the sender:
- The walk turns at the relay that heard the sender, and the line under
the route says so.
- The composer mirrors the route at its last hop. It has no Auto row,
because the session has no route to plan for a node with no key.
- The screen has no Explore row, because the evidence graph keeps nodes
by key.
- A sender with a key but no stored type is also a companion now.
A sender with no key and no name, and a direct message from a peer with no
key, offer no trace.
Refs: #34
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A companion, a room server, or a sensor does not relay a trace with the
firmware defaults (allowPacketForward in Mesh.cpp: client repeat is off,
and allowed only on 433.000, 869.495, and 918.000 MHz; disable_fwd is on).
A walk that turned at one of them never came home: the history held 36
companion traces and no reply from a real one.
The route to such a node is the same. Only the walk changes: it turns at
the last relay of the route, and the node is not in the spec. The route
out of a walk that comes home is still the full route to the node, so
the Device route row can offer it for DMs and admin.
- relays_traces() in models states the rule. render_forced_spec takes
relays=False, and forced_outbound reads the route back from a walk.
- services/trace_plan holds the route choice that the trace screen made
inline (radio route, outbound paths, best observed, last trace,
direct), so the CLI uses the same one.
- The trace screen names the relay where the walk turns, in a line under
the route. With no relay to turn at, Trace is dim. A neighbour that
does not relay gets "no relays" offered on the Device route row, with
the packets heard directly as its proof.
- The trace session turns a caller's spec (node page, Message paths) at
the last relay, so the callers do not need the rule. A sender that is
not a contact gets its type from its stored adverts.
- The composer and Explore paths turn the walk at the last hop.
- `meshterm trace -t NAME` with no --path walks the menu's route and says
on stderr where it turns. With no known relay, it is a usage error.
- The connection turns a device-routed trace at the last learned relay.
The simulator now stops a walk at a node that does not relay, as the
mesh does, and the tests that walked through Alice walk repeaters.
The picker keeps one list with no mark, sorted as before (JP's choice).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Enter on an arrival in the Message paths dialog (^P in a chat) opens a trace
of the route that the row draws, walked from our node:
- A received message is traced back to its sender: the relays in reverse,
out to the sender, and back on the mirror (Trace target).
- A sent direct message is traced out to its recipient on the relays in
order (Trace target).
- A sent channel message came back to our node, so its relays are the full
walk (Trace path).
- A sender with no key turns the trace at the first relay (Trace path).
- A direct-routed copy carries only the rest of its route, so it offers no
trace, and the hint does not show Enter there.
The trace screen opens idle and armed. Nothing transmits until the user
starts a trace. The dialog stays pushed under it as a hub, so Esc from the
trace comes back to the same dialog and highlight. In Trace target, a trace
that comes home lights the Device route row, so the route a message took can
become the radio's route to that contact.
A sender that is not a contact opens on its key, and open_trace takes a
label so that the screen shows its name instead of the hex.
Refs: #34
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The companion holds one device route per contact and replaces it with every
path return, good or bad. MeshTerm can now write that route, keep it, and
make the routes follow the user from site to site.
- Device.set_route reads the radio's own record and writes it back with only
the route changed, at the radio's hash width. Device.discover_route sends one
path discovery and returns the route each way. The radio's PATH_UPDATE is a
new hub event, EventKind.ROUTE.
- The outbound store keeps device routes per site and per fixed device (kept),
and the routes a site learned (saved). Keep needs a site or a fixed device.
- services/device_routes.RouteKeeper (ctx.routes): forget, set, keep, unkeep,
discover, and the status the pages show. At each connection and after each
site change it reconciles: routes that start on another site's first hop are
saved for that site and cleared, the new site's saved routes come back, and
kept routes are written back. A silent first hop is skipped. A route change
that the radio pushes gets the kept route written back.
- A site change on the Outbound paths page, its suggestion, and
`meshterm outbound use` go through the reconcile and say what changed.
- New preference auto_route (off): before a DM, set the suggested route when
the radio has none, or one from another site.
Refs: #34
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The companion keeps one route for each contact and never forgets a dead
one, so each retry on it was lost with no error. Now ^R on a direct
message that went along the learned route asks: Cancel, On route, or By
flood. By flood forgets the route (nothing is transmitted), flushes the
contact cache, and sends the one retry. A message that already went by
flood keeps the plain ^R. The admin login offers Try by flood the same
way after a silence from a node that has a route, one time for each
flow. Nothing floods unless the user chooses it.
Refs: #34
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The user names the ways out of their node, one or more hops long, in order.
Each site of this computer (Home, Foulab) has its own list, one site is
active, and a fixed device keeps its own list.
- Explore > Outbound paths: the sites with the active mark, the fixed
devices, and a staged editor for each list. Each path shows how well its
first hop hears us (out) and how well we hear it (in). Measure sends one
trace out along a path and back, after the cooldown.
- The path composer has an outbound mode, and puts the active paths first
while the insertion slot is at our node (trace target, trace path, the
TX sweep route).
- MeshTopology.outbound_scenarios: one route through each path. It scores
from the link after the path, lets the user's order win a near tie, and
skips a path whose first hop was silent for outbound_silent_hours. These
routes lead Explore paths, the node page's Routes tab, and the trace auto
route, ahead of a device route that starts on another hop.
- A first link out of our node is scored from what the far end measured,
when a trace gave such readings.
- The site suggestion: when the radio hears the first hop of another site
three times, the main menu asks to use that site and says what it heard.
"Never suggest" sets the new suggest_site preference off.
- CLI: meshterm outbound [show|sites|use|set|remove|fix|unfix], plain and
--json.
Refs: #35
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A link pooled the readings of its two directions, and received packets far
outnumber trace first hops. Link.heard_at now keeps each reading under the
node that measured it, and MeshTopology.readings(sender, receiver) gives one
direction. A neighbour report is the repeater's own reading, so it goes in
as the reverse pair. The pooled ranking does not change.
Refs: #35
Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
An archived contact is no longer on the device, so the job never saw its
location unless an advert was heard. The contact store keeps that location;
the scan now reads the archived contacts of the device from it. On JP's data,
290 of 422 archived contacts had a location and only 68 had a place.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Place mode changes a finished path line's hop labels to each node's place
(ui/placemode.py); a hop keeps its key and colour, a named hop with no place
reads (Name), an unnamed hop keeps its hash, our ★ stays. The node resolver
now also tells which node it named, so a shared one-byte hash finds the same
node's place. Message paths is the first screen: ^N, its hint, and a lane chip.
Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
A background job finds the place of each node that advertises a location
(Villeray, Montréal; a village; a peak near its summit). The map tiles give
the first answer offline; Nominatim corrects it when online (place_source,
default tiles then Nominatim; nominatim_url). Places are stored in the new
node_places table, a typed place in places.json wins over a found one.
Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
A room stamps posts with its own clock and sends only posts newer than
the companion's sync_since, so after its clock goes back (often a
reboot) it sends nothing new. When a room's newest stored post is later
than its clock now (from its clock offset), its node page shows
"posts blocked" and offers "Ask for all its posts again…". The repair
removes the room contact and adds the same raw record back, since the
firmware gives only a new contact a sync_since of zero, then logs in
with the stored password. Device.reset_room_sync tries the add twice and
says plainly if the room is left off the device.
Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
ADVERT packets now keep their own time (observations.sent_at, schema 22).
With the arrival times of messages, each advert, DM, and channel message
is a clock sample: the sender time minus ours. A channel sender counts
for the node its name resolves to, or under its name. A node's offset is
the median of its three newest samples. The node page's Info tab shows
"clock 3h 12m behind" in warn past the tolerance, or "in sync".
Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
Rows stored before the arrival time had only the sender time, so a
wrong clock still put them on the wrong day. A one-time background
backfill decrypts the stored GRP_TXT packets with the device's channel
keys; a packet with the same text and sender time is the message, and
its first copy is the arrival. On a real history it matched 12,071 of
14,197 old Public messages in 1.6 s. DMs cannot be decrypted and keep
their sender time.
Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
A received message now keeps its arrival time (received_at) beside the
sender time, and whether it waited in the companion's queue. Heard times,
the Messages list order, channel activity, and the packet-log search use
the arrival time, so a DM from a clock a year ahead no longer pins its
contact at "heard now". The transcript shows a corrected time as 12:31?,
and a picked message says what the sender's clock wrote. The CLI history
carries the same mark; its JSON gives both times. clock_tolerance_s
replaces ADVERT_FUTURE_SKEW_S as a preference.
Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
Bring in the 65 upstream commits since 0.11.1, with ^K lock and the self chip.
Both sides kept their features. React gives way to Lock in two places. On the
PicoCalc lane, Lock keeps the Shift half of F2 and React is ^E only. In the
hint, ^E react is the first atom to go when ^K lock has no room.
The long-message code now refills the compose line with MentionEditor, which
replaced LineEditor upstream.
Each section of the outbox now has column headers: TARGET and TRIGGER for
waiting entries, TARGET and OUTCOME for finished ones. The rows no longer
show the message. Enter on a waiting entry opens it to edit (the courier
holds the entry while the prompt is open, so the old text cannot go out
meanwhile), and Enter on a finished one shows it. Del deletes an entry
after a red confirm, and ^R sends a waiting entry now; on the PicoCalc
they ride F3 as Send, with Delete behind it. On a narrow screen a long
name gives cells to the trigger and breaks off on its crack.
The message field has the colours of the chat's compose line: a white
prompt mark and white text.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
On battery with the Cap on, 79% of the gauge reads failed, in groups of
up to 110 s. The poll read 3 times in 11 s and then waited 20 s, so it
missed the good periods, and after 7 failed polls the gauge went away.
- After a failed read, the next read comes after 5.5 s, not 20 s.
- The last good reading stays for 10 minutes instead of 7 polls.
- A change of the charging flag waits for a second read that agrees,
because a garbled read said Charging while the pack discharged.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Select a message in a channel or a DM and press ^E (Shift+F2 on the handhelds) to
react with an emoji. A reaction is a usual message on the wire: MeshTerm writes the
format of MeshCore One and reads it and the two formats of meshcore-open. The
transcript folds each reaction under the message that it names, with a count, or
the names of the nodes while that message is selected. A reaction does not raise
the unread badge, and the Messages list previews it as "reacted 👍".
A reaction names its target by the sender's timestamp. Thus MeshTerm now gives the
device the timestamp of each message it sends and stores exactly that second. A
retry of a DM keeps the timestamp and counts the try number, as the protocol
specifies. The emoji that ^E offers are the reaction_emoji preference. Rooms have
no reactions.
Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
The star of our node had the hue of our key, set from the self-info at run
time. It is now the white of "you" on each surface: the map, the routes,
the lists, the legends, and the chat. The run-time colour, the device-state
hook, and the style generation of the render cache are removed. A faded
star keeps its grey.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The star of our node was the yellow of the map. SELF_MARK now names a
theme style, you.mark, and the theme writes our key's hue into it when the
device-state cache reads the self-info. The context makes that connection,
so the services still do not import the UI. The map, the routes, the lists,
the legends, and the chat all draw it, and the render cache keys on a style
generation so no old bytes stay. A faded star keeps its grey.
In a chat, a sender or a mention with no key had the light blue keyless
chip. It is now quiet: the grey of plain text on that grey darkened by the
chip rule. Routes keep the keyless chip, arrow mode keeps node.unknown, and
the PicoCalc keeps the keyless pair.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Greying every name that two keys ever used was too strict: a reflash with an
erase makes a new key, and 34 names on this mesh have one, JP's own among
them. Smog went grey this morning because of two keys silent since September.
The newest key now gets the name, and the name is grey only when another key
used it within name_overlap_days (a new Display preference, "Shared names",
default 7) of it: two live claimants. A contact that was never heard never
wins. On this machine's real data, LOG.IC 3R goes to its active key 47368a7c,
Smog to fa331c83, and 8 of 883 names stay grey.
The stored names come with their times from the one scan node_names() already
ran (node_names_with_times), so opening a chat costs no second scan.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
A name is a label any key can claim, and a channel message carries only its
sender's name. When two nodes use one name, the resolver used to let the last
contact win, which handed one node's hue, map, and page to a message that
nothing tied to it: a second "LOG.IC 3R" with a new key took the first one's
green and location. Such a name now resolves to None, like any unplaced name.
A contact's full key and the stored id of the same node still count as one.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
A final pass over the docstrings and comments: "the own X of Y" is now
"Y's own X" (84 places), a navigation entry is a screen on the stack, our
node is our node, a paint is a paint, the quoted UX labels are in code
font, and a list of punctuation glyphs is in code font.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The same rewrite as for the core package. Three comments now agree with
the code: the activity bucket of the header is one minute
(ACTIVITY_BUCKET_S), the RX log holds packets, and a reference to a
module note that does not exist is gone.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Hold-to-quit was the Cardputer's alone. It is now MeshTerm's gesture
everywhere a key can be seen coming up, which a terminal never reports:
- The emulator's window, for either handheld, which reads its own keys
as the Cardputer's panel does.
- A terminal's Esc, where the keyboard can be asked whether it is still
down: GetAsyncKeyState on Windows, as the right-Ctrl rescue already
asks, and EVIOCGKEY on Linux wherever the keyboard's event device
opens (the PicoCalc, a uConsole, a user in `input`). It reads the key
state only, no events.
An Esc arriving while its key is still down is held back as a hold:
delivered as it comes up, a box after a second, gone at three. The
keyboard's repeats are part of the hold, a key typed during it goes in
behind the Esc, and on a VT stream the last repeat, which prompt_toolkit
can parse after the key is up, is dropped rather than going back a
screen behind a box the reader just let go of. On macOS and over SSH Esc
is unchanged.
SIGTERM is a quit for the interactive menu on every platform now, not
only under the Cardputer's launcher: a system shutting down gets the
same clean exit, terminal and console font restored.
EVIOCGKEY checked on the Cardputer's arm64 kernel; the Lyra was offline.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The Cardputer Zero's launcher ends any app whose Esc is held: SIGTERM to
its process group at three seconds, SIGKILL three seconds after that
(cp0_esc_exit_policy.hpp in CardputerZero/launcher; M5's packaging guide
still describes an older Home-for-five-seconds rule). Its own hint never
reaches the panel while an app owns it, and MeshTerm took 3.4 s to exit,
so a held Esc ended in SIGKILL.
Now a tap of Esc is typed on its release, and a hold of one second
floats a "Hold Esc to quit" box whose bar fills over the two seconds
left. While it is up the app holds the device's transmit lock: nothing
new goes on the air, and a scoped channel send under way closes its
window first. Letting go gives the lock back and types nothing. Held to
the end, MeshTerm leaves the way Quit does, and the launcher's SIGTERM
joins that exit instead of interrupting it wherever the main thread
happened to be.
The exit itself fits: openhop-core's cleanup joined the radio's IRQ
thread, parked in an uninterruptible 30 s poll, for its full 2 s
timeout. The node drops that daemon thread from the books first. On the
device, under the real launcher, the process group now drains 1.3 s
after the SIGTERM, with no SIGKILL.
The emulator's window does the same on a held Esc, debounced for an X
server's release-press repeats.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The Cardputer Zero's Cap carries a GPS on the header's UART, which the
device screen listed as "~ n/a" (pyserial's name for a port with no USB
identity): a companion to connect to, and with nothing remembered, the
lone port a command-line connect would pick. A wiring now names its
board's GPS (`gps_port`, `gps_baud`; the Cap's is /dev/serial0 at
115200), and wherever that radio is listed, its GPS port is not: the
device screen, `meshterm devices`, and autodetect.
The radio node reads it the way MeshCore companion firmware reads a
board's GPS: `gps` (off until switched on, remembered in prefs.json)
and `gps_interval` (0, every fix, once a second), reported and set as
custom variables, which is where Device config already shows them. A
valid RMC or GGA fix becomes the node's position, the one its
self-info reports and, with Share location on, its adverts carry. The
last fix is saved as the node shuts down. Standard library only, as
the node's contract asks; NMEA checksums are checked.
On MeshTerm's side, our own self-info is now refreshed behind the
answer after a minute, like the contacts, so screens opened after the
node moves show where it is; and the connect-time settings offer no
longer flags a position the running GPS moved.
Checked on the Cardputer: the ttyS0 row is gone from `meshterm
devices`; `config custom gps 1` opens the port, is saved, and reads
back on; the real-terminal test passes there.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
With the Cap powered, I2C bus 1 doesn't only fail reads: some come
back garbled (a capacity of 56414, clamped to a confident 100), and
the kernel's bq27xxx driver caches whatever it read, failure or
garbage, for five seconds. Retrying 0.1 s apart only re-read the
cache, so every retry missed.
Now an unreadable or out-of-range percent is asked again 5.5 s later,
past the cache; a step of more than 5 points between polls waits for
the next poll to confirm it, which catches garbage that lands inside
0-100; and the sysfs reads leave the event loop, since a failing
transfer on that bus takes its time. Measured on the device with the
Cap on: a steady 96%, where it showed nothing or 100 before.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Tried on a real Cardputer Zero for the first time. It draws on the
panel, takes the keyboard, and opens from M5's app launcher:
scripts/cardputer-zero/launcher-entry.sh puts a source checkout there
(and `remove` takes it off) until there is a store package.
Three things the hardware showed:
- The splash opened with the highlight on /dev/ttyS0, the Cap's GPS
UART, because serial is listed first as found. Below the companions
we've used, anything that looks like one now comes before a port
nothing vouches for, across transports.
- The title bar's battery is the handheld's own BQ27220, as the
PicoCalc's is. The host pack is now found by what it is (a Battery
supply that isn't a peripheral's), not by the PicoCalc's name.
- While the Cap is powered, I2C bus 1 turns noisy: a quarter to three
quarters of the gauge's reads fail with an I/O error (one in ten of
the clock's), none with the header off. A failed read is asked again,
a status that won't read keeps its last verdict, and a good reading
stands through six failed polls instead of blinking out.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Only 24 of 144 direct messages and posts in the history were ever marked
delivered. Three faults, each fixed:
- The wait was the radio's own estimate times 1.2: about 5.7 s for a
flood, while a flooded round trip from a few hops out takes ten (a
room's answer from five hops landed at 10.1 s on hardware). It is now
the login's patience, the estimate stretched a quarter plus a round
trip sized to the route, about 15 s for a flood.
- An ack that landed after the wait was dropped. The radio pushes one
whenever it arrives, for any of its last eight sends, but nothing was
listening, so a delivered message stayed failed for good. The history
shows ACK and PATH packets heard seconds after messages recorded as
failed. The send now returns a Delivery carrying the ack code, and the
chat service keeps the last sixteen messages still waiting. A late ack
flips one to delivered, in history and in the message the chat screen
holds, and every code a retried message went out under counts.
- The Courier trusted the failure and sent the message again: a
duplicate for the recipient whenever the ack was only late. A late ack
now marks the entry delivered.
The ack listener is also armed before the send rather than after it,
so a neighbour's ack quicker than the send's own return is not missed.
The debug log names how a message went out and the radio's own
round-trip time.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Joining a room moves out of Chat into a Rooms page beside Channels. It
lists every room server the radio knows, joined ones first, with each
room's access, unread count, last post and last-heard time. Each room
has a page: join, log in again, change password, open the board, forget
it, or delete its stored posts. Chat now lists only joined rooms, the way
it lists only channels on a slot, and only a joined room raises the
unread badge. chat join becomes rooms join, alongside rooms list and
rooms forget.
"No reply" told the reader nothing, because a room is just as silent for
a wrong password as for a login that never reached it. Testing on
hardware showed the commonest cause is neither: a login sent along the
route the radio had learned met silence, and the same login by flood was
accepted in eleven seconds. A silent login is now explained from what is
known: how it went out, when the room was last heard, and whether this
password has worked before. It offers the one next step that evidence
points at:
- Try by flood, after a learned route met silence. The radio forgets
the route (local, nothing transmitted), then sends the login once.
- Try again…, after a flood met silence. The prompt reopens with the
password filled in, so Enter resends it and typing replaces it.
- Add it & try again, when the radio doesn't hold the room as a contact.
Every retry is a button press, and none is ever sent on its own. A
password over 15 bytes is refused at the prompt, since MeshCore sends
only the first 15.
On the board, a failed or unfinished login used to leave the compose
line taking posts the room would drop. It now opens only while we are in
and may post, and otherwise says why and what to press. Opening a joined
room that has gone quiet logs in in the background. ^L runs the
explained flow.
Underneath, the login exchange listens for the radio's own confirmation,
matched to the login by its expected ack. It records whether the login
went by flood or along a route, or the radio's reason for not sending it
at all. This also corrects the debug log: "send unacknowledged" read the
library's wait for the *answer* as the send. On hardware the radio
confirms in under 0.1 s. Device.reset_route is new. The simulator learns
routes, can be given a stale one, and refloods.
Refs: #24
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
A review of the room work turned up ways the remembered passwords could
go wrong, and a doubled login:
- A room that lets readers in lets any password in, so a login that only
earned read-only proved nothing about the password. It replaced the
room password anyway, so one mistyped ^L left a member read-only for
good, with no prompt to fix it. It now never replaces a password that
is already kept, and ^L asks for one while you are read-only.
- A blank login only asks "do you know me?". Accepted, it overwrote the
remembered room password, and as an admin it emptied the admin
password Repeater admin shares. It now replaces neither.
- A room's login replaces a known member's role with the one the
password earns, so an owner who held both passwords was demoted to
member each time the room password was tried first. The admin password
now goes first.
- Closing a room view and opening it again mid-login sent a second
login. The room service now shares a login already in flight, and a
room with one under way is not due another.
- A refusal forgot the room password even when it refused a different
one. ^R is no longer offered to a read-only member, whose resend the
room would drop. Enter on a picked post opens its paths when there is
nowhere to put a reply, and a paste is refused there too.
Refs: #24
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
A room server is a message board on a radio: it keeps its members' last
posts and sends each member the ones they missed. MeshTerm could see rooms
and run your own, but not join one. Posts that reached the radio were filed
as direct messages from the room, with their authors thrown away.
Chat now has a Rooms section between Channels and Direct. Opening a room
shows its board at once, each post under the member who wrote it. A post
carries the first four bytes of its author's key, so it is named by any
contact or overheard advert with that key and coloured by the key itself.
An author nothing names stands as the hash, in the unknown-node grey. The
first visit asks for the room's password over the board. After that,
opening a room logs in again only once it has been quiet for
room_relogin_minutes (a new preference, 30 by default), and ^L (F6 on the
handhelds) logs in on demand. The title says what the room allowed:
member, admin or read-only. A read-only member gets a line saying the room
drops their posts, in place of a compose box. A post goes out once, never
soft-retried, since a duplicate would reach every member.
Underneath: messages carry an author (schema 18), a room's board leaves
out its command replies, and a re-sent post is recorded once. Room posts
raise the unread badge and a room's command replies don't. The device
gains room_login, sharing admin_login's exchange and reading the access
the room granted. Room passwords are remembered in rooms.json; an admin
login is kept in admin.json, shared with Repeater admin. The simulator
has a room, Lakeside BBS, to join with "hello".
Two fixes the research turned up. An admin command took the first direct
message from anyone as its reply, so a room post or a companion's message
landing mid-command was read as the node's answer. It now listens before
sending, and only for a reply from that node that is not a post. And
Repeater admin names a room server's guest password "Room password", the
password members join with.
Refs: #24
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Panning or zooming the map quickly on the PicoCalc could stop the whole app
for many seconds. A watchdog run on the device found two causes behind it,
plus the port walk fixed in the previous commit.
Memory. A decoded tile holds 1 to 4.6 MB of RAM on the device (65 bytes a
point), not the 0.9 MB the code assumed. The source kept up to 24 of them,
counted as tiles, and the map screen kept 8 or more of its own on top, so a
few pans and a zoom out filled a 104 MB device. Swap is on the SD card, so
the process then stopped while the kernel read its code back in: 16,000
major page faults and a 15 s freeze in one run. Now the source holds decoded
tiles to a byte budget, one eighth of the machine's RAM (12.8 MB on the
PicoCalc, at most 128 MB on a desktop), weighed by mvt.resident_bytes. That
estimate was fitted against tracemalloc on the device's 157 cached tiles: 1%
under to 9% over there, and 6% under to 21% over on a 64-bit desktop. The
screen keeps only the tiles in view, and takes any tile already in RAM
straight from the source on the paint (BasemapSource.resident), with no trip
through a thread. The prefetcher warms the disk cache (BasemapSource.warm)
instead of filling the RAM with guesses, and passes over any tile already
written down. Tile loads take turns, two at a time, and a tile the view has
left before its turn comes is dropped, not loaded.
CPU. fill_polygon asked every edge about every scanline, which at z7 means
coastlines with tens of thousands of edges: 6.8 s of a 7.6 s frame. Each
edge is now filed under only the rows it crosses, and draws the same dots
(checked against the old fill on 3,000 random polygons, and in a test).
_draw_tile also tests each ring's bounds before projecting it, and skips a
ring wholly outside the view. That changes no dot: 1,500 frames from the
device's tiles match rendering with no culling at all. The one frame that
differed from HEAD was HEAD's own building cull, which dropped a footprint
whose fill rounds onto the canvas edge.
Measured on the PicoCalc with the profile-picocalc map_burst tour (keys sent
at 10 a second, from a pinned z10 view, real radio and database). The new
code ran first, so the baseline had the warmer tile cache:
pans, catch-up after a burst HEAD 1.0-1.8 s now 0.4-0.6 s
longest silence, whole tour HEAD 11.6 s now 0.6 s
whole-process freezes HEAD 8.0, 3.1, 2.1, 11.6 s
now one, 1.6 s (idle pages swapped back in)
swap at its peak HEAD 25 MB now 7 MB
warm raster, z7 / z8 / z9 HEAD 7.6 / 1.9 / 1.8 s
now 0.57 / 0.29 / 0.81 s
warm raster, z10 / z13 HEAD 0.49 / 0.56 s now 0.26 / 0.26 s
Still open: z9 spends 0.23 s drawing lines; a prefetch decode of a heavy z7
tile is still 1.3 to 1.7 s on a worker thread; and pages swapped out while
the map sits idle can still cost a second or two to come back.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>