31 Commits
Author SHA1 Message Date
rich 4b05bf25d5 palm-client: Add Channel's New Key (private channels) fills in a random key from a pool fed by what can't be predicted: the exact tick and position of every pen and key event, and the signal readings of every packet the radio reports. Samples are folded into a SHA-256 pool, a key is a hash of it, and the pool moves on after each; it's kept between launches in an unsaved preference (never in a backup). Until 256 samples have come in, New Key asks for a few seconds of stylus movement. Host-tested in tests/test_entropy.c 2026-11-08 19:38:55 -05:00
rich 6c17e25a76 palm-client: the request retry rules are in request.c (session.c supplies the link), host-tested with a scripted link in tests/test_request.c: a frame that went out is sent again only while tries allows, one that didn't go is resent up to 4 times without using up tries, one cut off part way never is. check_source.py checks that the functions that send over the air or take a queued message (messages, reactions, adverts, syncs, logins, traces) only ever use tries 1 2026-11-08 19:34:16 -05:00
rich 359908e927 palm-client: make replay runs the bridge's frame capture through the app's parsers and fails on any frame of a code the app parses that doesn't parse, to catch a firmware layout change before it reaches the Visor. The bridge captures every frame in full with --capture (bridge.sh writes $TMPDIR/visor_frames.txt); captures hold real messages and stay local 2026-11-08 19:32:00 -05:00
rich bb2fc014ab palm-client: the module can't keep waking a Visor on failing batteries. A slot power handler (SbPwr, in the copied block) stops the chip interrupting on a low-voltage shutdown, as the Springboard guide asks of modules without LOWBAT*; since the Neo's OS never reports that reason, the wake's card event handler and BgArmWake also check the battery and turn the wake off at the OS's warning level. Host-tested; untested on hardware 2026-11-08 19:27:39 -05:00
rich f53f851b0e palm-client: with the Slot link, the radio's 'message waiting' push wakes the Visor. The slot interrupt handler (SbIrq) spots the frame as it drains the FIFO and, as the Springboard guide describes, holds IRQ* (THR empty) to have the system woken, then keeps it awake 10 s for the app to sync. With Check when closed on, the app leaves a copy of the handler in system-owned memory as it closes (SbWakeArm), with the module asleep between frames; it posts a card event whose handler sets the app's alarm for now, so the closed-app check runs at once. check_sections.py checks that the copied block (SbCoreStart..SbCoreEnd) is whole and refers only to itself. The Slot link no longer reconnects after sleep. Host-tested on the simulated module; untested on hardware 2026-11-08 19:17:30 -05:00
rich 19ba4b1cb2 palm-client: the screens' run-time lines are built in screen_fmt.c, and tests/test_screens.c checks them with their longest values in the large font. That found the Node clock lines running off the edge even in the small font (now 'Visor 11/8 14:02 (UTC-5:00)' and 'Radio 11/8 19:02 UTC, sys 300', a font row apart), Radio Stats lines too long for big counts (they wrap now, and the test checks they still fit above Done; errors get their own line, in hex that shows), and the contact summary and a Trace message too wide ('Room server' is 'Room'). Rows that could still be long are cut instead of running off 2026-11-08 18:53:49 -05:00
rich bd9d9ce951 palm-client: SB-LoRa Test (Options menu) for board bring-up: the slot's chip selects, which address mapping reaches the SC16IS740 (connector A0 = CPU A1 or A0, with what each read back), its registers after a reset, a 64-byte internal UART loopback, the slot interrupt (the same loopback through the handler) and a DEVICE_QUERY to the radio. Nothing goes over the air; the bus is only touched once the OS reports a module. Host tests cover the mapping and loopback 2026-11-08 18:18:54 -05:00
rich 80f2d2781b palm-client: a repeater's "neighbors" reply in its admin console also goes on the Map for 30 minutes: a line from it to each neighbour with a position, solid for SNR 0 dB or better, grey below. Cmds lists the region commands (region, get, allowf, denyf, save) 2026-11-05 15:02:22 -05:00
rich 50a5a486db palm-client: a fifth code segment, and Node, Settings, Font Preview and Add Channel move from vmcode2 (31.1 KB) to vmcode4, leaving vmcode2 room for the hooks the next features need. protocol2.c (vmcode5, host-tested) has the newer companion commands: trace path, stats, battery, a contact's route, plus meshcore:// share links and #hashtags in text 2026-11-05 14:43:50 -05:00
rich ee6e4d7a7b palm-client: tap and hold a message for React, Reply, Send DM and Path Details (also Options > Message Actions for the newest). Reactions use MeshCore One's format (@[Name]<emoji>\n<hash>, hash = Base32 of SHA-256(text || LE timestamp)), so MC1 and MeshMonitor show ours and we show theirs: kept in their own store, shown under the message, never chat or unread. Received messages keep their hash and, matched from the RX log push, the repeaters they came through. The emoji glyphs now go out as the emoji they show, not cp1252 quotes 2026-11-05 09:11:29 -05:00
rich 2643a2b40e palm-client: wrapping doesn't split a @[Name] mention across lines (it stays one chip) unless the mention alone is longer than the line 2026-11-04 07:39:45 -05:00
rich 6dd623f778 palm-client: glyphs for 12 common emoji, tap an emoji to see it enlarged 2026-11-02 13:07:01 -05:00
rich ae4d8453d8 palm-client: contact keys and unknown-sender prefixes in hex without StrPrintF (showed zeros) 2026-11-02 12:39:35 -05:00
rich deec3112d4 palm-client: Map screen with an OSM basemap (tools/make_map.py) and positioned nodes 2026-11-02 12:33:52 -05:00
rich 7c4473bcb5 palm-client: flood scopes (list, radio default, per-channel scope, discover from neighbouring repeaters) 2026-11-02 11:17:44 -05:00
rich 04dc47664b palm-client: interrupt-driven SB-LoRa receive (slot IRQ handler drains the SC16IS740 into a ring) 2026-11-02 10:44:19 -05:00
rich ab583ff4dc palm-client: SB-LoRa transport (bus SPI, SC16IS740 driver, Slot link) with simulated-carrier tests 2026-11-02 10:03:51 -05:00
rich 4068473ad1 palm-client: admin console for repeaters and rooms (CLI, status, telemetry)
Login on a repeater opens the console (rooms: More > Admin Console). A
command line sends CLI commands (SEND_TXT_MSG with txt_type CLI); replies,
which the radio delivers as CLI-type DMs, go to the console instead of the
conversation. Status (SEND_STATUS_REQ -> 0x87) shows the repeater's
RepeaterStats: battery, uptime, queue, noise, last RSSI/SNR, packet counts,
airtime, dups and errors. Telem (SEND_TELEMETRY_REQ -> 0x8B) decodes the
Cayenne LPP readings. Cmds lists common commands and Read settings (ten
gets); items ending in ... go into the command line to finish. One request
at a time, the rest queued; no answer is reported after the radio's
estimate plus 8 s.

remote_fmt.c (builders, parsers, text) is pure C and host-tested; the
console and screen are in segment 3 (12.4 KB).
2026-11-02 07:17:03 -05:00
rich fe5064cdab palm-client: contact detail with signal history, room login, add contact by key
Contact detail (new screen, segment 3): type, route, last advert, the full
key, and every time the radio heard the node directly with SNR/RSSI.
Message, Login (rooms and repeaters, password prompt), More: Reset Path,
Remove.

Signal history comes from the radio's RX log pushes (0x88), which it
already sends for every packet: a zero-hop advert names its sender; a
flooded packet's last path hash names the repeater we heard it from.
Hearings of the same node within a minute merge. 48 entries, kept in an
unsaved preference across launches. Parser host-tested, including
transport codes and direct routes (no 'from').

Rooms: Message logs in first if needed (SEND_LOGIN, then the
LOGIN_SUCCESS/FAIL push, waiting as long as the radio estimates). Room
posts are signed messages: the author's 4-byte prefix is now parsed and
the transcript shows the author's name instead of the room's.

Add Contact (Contacts > Add): name, type and 64-hex-digit key, sent with
ADD_UPDATE_CONTACT with an unknown path, for messaging a node whose advert
hasn't been heard.
2026-11-01 21:55:52 -05:00
rich 5d0bda5b31 palm-client: line breaks in messages, alerts for DMs/mentions, a 'new' divider
Line breaks: TxtWrap only broke at spaces and the width, so a \n in a
message was drawn as a character and the text ran on. It now ends the line
at \n, \r or \r\n (host-tested), and the Home preview shows breaks as
spaces.

Alerts: a new DM, or a channel message containing @[our name], plays the
system 'confirmation' sound (it follows the Visor's sound settings), unless
that conversation is on screen. Plain channel traffic stays quiet.

Opening a conversation with unread messages draws a '-- new --' divider
before the first of them and scrolls to it instead of to the end.
2026-11-01 17:30:56 -05:00
rich c713d8ba34 palm-client: modules into segment 2 with a build check; better Unicode display
Segment 1 was back at 27 KB. Settings, Contacts, Channel, Home, Node,
convos, messages, contacts, channels, rowlist and draw move to vmcode2:
segment 1 is now 10.3 KB, segment 2 23.4 KB. tools/sect2.py adds the
VM_SECT2 static declarations.

Checked in the compiled code, the rules in sections.h were too cautious:
literals in a vmcode2 function are emitted into vmcode2, a file's static
const data and calls to unannotated functions go through the __text__
base, and taking a vmcode2 function's address (event handlers, callbacks)
gives its real address. The real traps are shared extern const tables and
-fwritable-strings (PC-relative into .data). tools/check_sections.py runs
after every link and fails the build on any PC-relative reference from
vmcode2 to outside it; python3 added to the toolchain image for it.

Unicode: characters past Latin-1 all became '?', and Windows-1252 quotes
and dashes had no glyph in the small font. Now arrows, check marks, stars,
bullets and node-type marks map to the font's UI symbols, typographic
quotes and dashes to ASCII, any emoji to a new smiley glyph, and
variation selectors / zero-width joiners are dropped.
2026-11-01 17:29:20 -05:00
rich 9d868898ac palm-client: add and leave channels (#hashtag and private by key)
Options > Add Channel: a #hashtag channel's key is the first 16 bytes of
SHA-256 of its UTF-8 name, '#' included (companion_protocol.md: #test ->
9cd8fcf2...); a private channel is joined with its 32-hex-digit key. It
goes in the first free slot via CMD_SET_CHANNEL and opens the new
conversation. Options > Leave Channel empties the open channel's slot
(empty name, zero secret) after asking. Creating a private channel isn't
offered: the Visor has no good randomness for a key.

SHA-256 is plain C in the second segment, host-tested against 'abc', the
documented #test key and every padding boundary. Adds VmParseHex and
VmBuildSetChannel with tests. sections.h leaves the attribute off under
clang so the editor's checker stops flagging it.
2026-11-01 16:15:57 -05:00
rich 0189a23267 palm-client: messaging protocol (send DM/channel, SENT, acks, channels, clock, advert)
Builders for SEND_TXT_MSG, SEND_CHANNEL_TXT_MSG (with MeshTerm's 150/130
byte limits), GET_CHANNEL, GET/SET_DEVICE_TIME and SEND_SELF_ADVERT; parsers
for CHANNEL_INFO, SENT (expected ack + timeout), PUSH_SEND_CONFIRMED and
CURR_TIME. All per MyMesh.cpp, checked byte for byte in host tests.
TxtPalmToUtf8 converts outgoing text from the Visor's Windows-1252 to UTF-8
and never cuts a character; it round-trips with TxtUtf8ToPalm.
2026-11-01 15:21:17 -05:00
rich 99978b3bc9 palm-client: text layout module (wrap, cut, age, SNR, UTF-8) and roomier chips
src/ui/text.c is plain C, tested on the host with the generated small-font
width table: word wrap (breaks long words), fit, MeshTerm-style ages, SNR
rounding, the channel 'Name: ' sender split, and UTF-8 to Latin-1/
Windows-1252 with '?' for what the Visor can't show. Name chips get 2px
side and 1px top/bottom padding; the inverted text was smeared on the Neo.
2026-11-01 15:19:04 -05:00
rich 7d1c84f35d palm-client: offer a radio reboot after changing radio settings
Reception stayed dead after switching to PhillyMesh until the XIAO was
rebooted: SET_RADIO_PARAMS saves and reports the new values, but the
receiver only retunes on a restart. After a radio change, Settings asks
to reboot the radio (CMD_REBOOT + "reboot"; no reply), waits for it and
reconnects.
2026-11-01 15:10:07 -05:00
rich d00d7fab26 palm-client: contacts (database + screen), command retry, PhillyMesh preset
Contacts: Refresh downloads GET_CONTACTS into a backed-up Palm database
(VisorMeshContacts), keeping the previous list if the download fails, and
sorts by name. The screen lists name with type and route, taps show
details (key prefix, last advert). Path lengths are decoded as hash size
(bits 7-6) + hop count (bits 5-0), since PhillyMesh uses 2-byte hashes.

session.c keeps unread received bytes across waits; before, bytes after a
completed frame in the same read were dropped, which would lose
back-to-back frames like the contact list. Settings commands get two tries
(the Visor's USB link can drop while idle). Ports moves to an Options menu.
Local presets (tools/local-presets.json, PhillyMesh) are listed before
MeshCore's and survive gen_presets.py --fetch.
2026-11-01 14:54:53 -05:00
rich 5a347be52d palm-client: Node Settings screen (name, radio preset/params, TX power, path hash)
Settings validates against the firmware's limits before sending anything,
then sends only what changed (SET_ADVERT_NAME, SET_RADIO_PARAMS with the
client-repeat byte passed through from DEVICE_INFO, SET_RADIO_TX_POWER,
SET_PATH_HASH_MODE), requires RESP_OK for each and names the step that
failed, then re-reads DEVICE_INFO/SELF_INFO.

The preset pop-up uses a snapshot of MeshCore's suggested presets
(api.meshcore.nz, 27 entries) in tools/meshcore-presets.json; src/presets.c
is generated from it by tools/gen_presets.py with exact decimal conversion.
Radio state moves into session.c; TX power is now signed; adds
fixed-point decimal parse/format helpers with host tests.
2026-11-01 12:03:48 -05:00
rich c9183dc591 palm-client: connect screen (DEVICE_QUERY + APP_START) and session layer
session.c does request/reply over the transport: waits for the wanted
reply code, skips pushes (remembering PUSH_MSG_WAITING), maps RESP_ERR,
and retries sends while the USB bridge attaches. Connect keeps the link
open and the main form shows node name, frequency, BW/SF/CR, TX power
and firmware. Adds a DEVICE_INFO parser.

Fixes the DEVICE_INFO test fixture: it was hand-typed with two bytes
shifted, and an earlier test had been adjusted to match the typo (version
at offset 62). It's now generated from the capture file; the version is
at 60, as in MeshCore's layout.
2026-11-01 11:53:30 -05:00
rich 9fba1903af palm-client: protocol builders and parsers for the read-only commands
APP_START/SELF_INFO, GET_CONTACTS/CONTACT/END_OF_CONTACTS and
SYNC_NEXT_MESSAGE with v3 contact and channel message frames, laid out
per MeshCore MyMesh.cpp. Little-endian fields are assembled byte by byte
so they decode correctly on the big-endian 68k. Builders are checked
byte-for-byte against frames the real radio accepted; SELF_INFO and the
empty contact list are real captures (key and name redacted), contact
and message frames are synthetic. companion_query.py gains --text.
2026-11-01 11:20:35 -05:00
rich e21bc642b1 firmware: enable USB companion link, add bench query tool; verified on XIAO
Flashed the UART companion build to the SB-LoRa XIAO. With
ENABLE_USB_INTERFACE it also answers over USB, so it can be tested and
configured without an adapter. companion_query.py (stdlib only) sends
CMD_DEVICE_QUERY and got DEVICE_INFO for MeshCore v1.17.1; that frame
is now a palm-client host test.
2026-11-01 11:05:42 -05:00
rich cc989cf357 palm-client: Docker toolchain, app scaffold and protocol framing
prc-tools-remix 2.3.6 + PilRC + Palm OS 3.5 SDK (pinned) in a Docker
image; make builds visormesh.prc there when the toolchain isn't local.
App has a main form whose Query button sends CMD_DEVICE_QUERY over the
Serial Manager transport. Companion framing is plain C with host tests.
make install pushes the .prc to a Pi with the USB cradle (untested).
2026-11-01 10:19:33 -05:00