Commit Graph
60 Commits
Author SHA1 Message Date
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 80a0c90954 palm-client: bridge.sh to start, stop and check the Visor USB bridge 2026-11-02 09:55:11 -05:00
rich 8d8cd563d1 progress: repeater admin console and contact screens verified on the Neo 2026-11-02 07:21:41 -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 55b77c84a7 palm-client: third code section (vmcode3); checker resolves COFF symbol sections
visormesh.def adds vmcode3 and sections.h VM_SECT3, ahead of new screens
(segment 2 is at 27 KB). check_sections.py checks every extra section, and
now maps COFF symbols' (sec N) to section names: before, it only resolved
section symbols such as .text, not named ones. sect2.py takes --sect3.
2026-11-01 21:49:29 -05:00
rich 49fe88728a README: palm-client and firmware descriptions are current 2026-11-01 21:48:10 -05:00
rich 3f6cf7cc1c docs: upstream issues found so far (pilot-link, PilRC/prc-tools, MeshCore)
Evidence, workaround and suggested fix for each: pilot-link's macOS USB
open race and dead debug logging, PilRC's corrupt NFNT header, the
prc-tools multi-section traps, MeshCore's radio params not retuning until
reboot, the clock persisting through contact lastmods, and stale bytes in
unused GET_CHANNEL replies. Nothing has been filed yet.
2026-11-01 21:48:04 -05:00
rich bd7a9ec4b2 progress: compose, Unicode, line breaks, alerts and new divider verified on the Neo 2026-11-01 17:38:32 -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 8dd34839e0 palm-client: two-line compose field; redraw fully after the keyboard
The single-line compose field didn't scroll, so typing past its width was
blind; it's now a two-line multi-line field (Palm scrolls it to keep the
cursor visible; the transcript is 8 px shorter). Graffiti return still
sends: the form catches linefeed before the field.

Screens treated every frmUpdateEvent as new data and only redrew their own
content, so after the on-screen keyboard (frmRedrawUpdateCode) the field,
buttons and counter weren't redrawn. Conversation, Home, Contacts and Node
now redraw the form for frmRedrawUpdateCode.
2026-11-01 17:22:54 -05:00
rich 3e3edb1d4d progress: channels and wake-reconnect verified on the Neo 2026-11-01 17:19:50 -05:00
rich ac40815b4f palm-client: only start Docker when sources changed
make install hung for minutes when Docker Desktop's amd64 emulation stopped
starting containers, although the .prc was already built. Without a local
toolchain, build/visormesh.prc now depends on the sources, resources and
.def, so an up-to-date install goes straight to pilot-xfer.
2026-11-01 17:17:27 -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 6ebcf9a2de palm-client: reconnect after the Visor wakes from sleep
The serial/USB link doesn't survive sleep, and the session kept thinking it
was connected. Ticks stop during sleep while the clock runs on, so a clock
jump past the ticks means we slept: drop the session, reconnect quietly
(the radio queued what arrived; connect syncs it) and refresh the screen.
If the reconnect fails it's retried on the next wake.
2026-11-01 16:13:02 -05:00
rich 5aa9a46dcf progress: clock fixed end to end; mentions and segments verified on the Neo 2026-11-01 16:11:54 -05:00
rich 2d1a9afb44 palm-client: don't move a set radio clock more than a week
A slip in the Visor's date picker (Oct 1 2027 instead of Nov 1 2026) went
straight into the radio, whose clock only moves forward, so it can't be
undone without a radio reboot. When the radio's clock looks set (after
2025-01-01), SessionSyncClock now only corrects drift under 7 days and
otherwise flags a mismatch, shown on the Node clock line.
2026-11-01 16:06:28 -05:00
rich 651217aecb palm-client: ignore a nonsense system time zone; dates on the clock line
The Neo's prefMinutesWestOfGMT was 1140 (19 h), so the default UTC offset
was -19 h, which explains the radio clock being set to the wrong day. A
system value past +-14 h is now ignored (offset 0 until set in Settings).
The Node clock line shows dates too: the remaining problem looks like the
Visor's date, which the times alone couldn't show.
2026-11-01 16:04:28 -05:00
rich fa11770c13 palm-client: clock line on Node (Visor, UTC, offset, radio, system pref)
The radio clock stays ~9 h behind although Settings shows UTC -5: at
connect it was set to Visor time minus 5 h, i.e. an offset of +5 was in
effect, and later saves read the radio clock without setting it. Rather
than guess, Node now shows the Visor's clock, the computed UTC and the
offset in effect, the radio's clock as last read, and Palm OS's
prefMinutesWestOfGMT (the offset's default).
2026-11-01 16:01:10 -05:00
rich 157646e093 firmware/tools: fake companion radio on a pty for transmit-free testing
Answers the companion protocol per MyMesh.cpp: device/self info, clock
(forward-only like the firmware), channels with stale bytes in unused
slots, one contact of each type plus a UTF-8 name, queued messages behind
PUSH_MSG_WAITING, and DM sends with SENT, a confirmation ~2 s later (none
for 'noack') and an echo reply. Verified with companion_query.py.
2026-11-01 15:53:04 -05:00
rich 4d00bd8576 palm-client: @[Name] mentions drawn as chips; tap a channel message to reply
Complete @[Name] tokens on a transcript line draw as MeshTerm's mention
chip (@ dropped); a chip is never wider than the raw token, so wrapped
lines still fit. Tapping someone's channel message inserts @[Name] at the
cursor; tapping a failed message of ours still offers Retry.
2026-11-01 15:52:01 -05:00
rich 74f2888477 palm-client: second code segment (protocol and text modules)
Code was 28.8 KB of the ~32 KB a single 68k code resource can reach.
visormesh.def declares section vmcode2; multigen generates the stub and
linker script; build-prc takes the name, creator and backup bit from the
.def. protocol.c and ui/text.c move there (segment 1 now 24.3 KB, segment
2 4.9 KB). Every function in them, static ones too, is declared VM_SECT2
so calls from segment 1 go through the __text__vmcode2 jump base, and
their two static const tables became plain data, since const data stays in
segment 1 where PC-relative code in segment 2 can't reach it. The rules
are in src/sections.h. Checked in the objects: no .text left in the moved
files, cross-segment calls go through the section bases.
2026-11-01 15:50:51 -05:00
rich 6c7061f3f1 palm-client: real UTC timestamps (UTC offset setting) and UTF-8 names
Palm OS 3.5's clock is local time with no zone, and SessionNow used it as
UTC: outgoing messages carried times hours off, contact ages all read
'now', and clock sync set the radio (which only moves forward) to the
wrong time. SessionNow now applies a UTC offset kept as an app preference
(default from prefMinutesWestOfGMT, editable in Settings as hours, quarter
hours allowed); display converts back with SessionLocalPalm. Changing the
offset re-syncs the radio clock.

Contact, channel and node names are converted from UTF-8 when stored;
names with emoji showed missing-glyph boxes.
2026-11-01 15:41:57 -05:00
rich 4b69cda619 palm-client: an empty channel name means an unused slot
The bridge log showed GET_CHANNEL replies for unused slots with an empty
name but non-zero bytes after it: the firmware builds them in a reused
buffer, so they carry the previous reply's leftovers. Treating a non-zero
secret as in use listed all 40 slots as channels.
2026-11-01 15:35:45 -05:00
rich 40412223a4 palm-client: shared tables must not be const (prc-tools puts const in code)
The transcript wrapped after a few characters on the Visor: gSmallFontWidths
was const, so prc-tools placed it in .text, but text.c reached it through an
extern declaration A5-relative (lea %a5@(0)) as if it were data, and read
garbage widths. The same applied to gPresets. Both generators now emit
non-const tables, with a note why. Host tests can't see this.
2026-11-01 15:34:13 -05:00
rich c04bebeb81 palm-client: MeshTerm-style screens: conversations, transcript, contacts, node
Home is now the conversation list (channels in slot order, then direct
conversations most recent first) with markers, unread badges, failed
marks, ages and previews; it connects on launch with the saved link.
The conversation screen shows day dividers, sender chips, time column,
wrapped text and SNR or delivery marks (pending, waiting for ack, acked,
failed), with a compose field, a UTF-8 byte counter, Send (or Graffiti
return), and tap-to-retry on failed messages. Contacts pins our node and
shows type marks, heard ages and routes; Message opens a DM. The old main
screen becomes Node with Advert and Done. One Options menu everywhere;
while connected the event loop polls every half second and posts a form
update when messages or contacts change.
2026-11-01 15:29:19 -05:00
rich ece6a01c7f palm-client: message store, channel cache and background sync
messages.c keeps one record per message (conversation, times, direction,
status pending/sent/acked/failed, unread, SNR, path, sender, text in the
Visor's charset), newest 500, backed up. channels.c caches the radio's
channel slots so the conversation list works offline.

session.c now acts on pushes wherever frames are read, so an ack that
arrives during another request isn't lost: MSG_WAITING triggers a sync,
SEND_CONFIRMED marks the DM acked, adverts mark contacts changed.
SessionPoll drains input, syncs and expires overdue acks; SessionSend/
SessionRetry send with a single try (a repeated send would go out twice)
and track the ack deadline from the radio's estimate. Connect also sets the
radio clock forward from the Visor's, refreshes channels and contacts, and
pulls waiting messages. ContactsRefresh accepts a NULL count.
2026-11-01 15:24:03 -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 9f9032c2bb palm-client: rowlist, a callback-drawn scrolling list for the new screens
Fixed-height rows drawn by a callback in a gadget area with a scroll bar;
section rows can be marked unselectable. Taps highlight like a Palm list
and report the row; the hard up/down buttons and the scroll bar page it.
Events are forwarded by the form rather than FrmSetGadgetHandler, so it
doesn't depend on Palm OS 3.5's gadget extensions.
2026-11-01 15:19:50 -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 5249d7f5e6 palm-client: write the small font's NFNT directly (PilRC's was corrupt)
Font Preview showed garbled text: the bundled PilRC's FONT compiler writes
a broken NFNT header (first/last char words missing, later fields shifted,
height lost), reproduced with a two-glyph test font. gen_font.py now builds
the NFNT itself (header, glyph strip, location and offset/width tables),
decodes it back and checks every glyph, and PilRC includes it as a DATA
resource. Resources now rebuild when the font changes.
2026-11-01 15:15:46 -05:00
rich 1bae27fe9b palm-client: small 4x6 UI font and a Font Preview screen
tools/gen_font.py builds an NFNT (app font 0x80) from X.org's public-domain
misc-fixed 4x6 BDF plus hand-drawn MeshTerm-style symbols (star, node-type
marks, ack/fail/pending, lock) in 0x80-0x9F, reusing Windows-1252's slots for
ellipsis and angle quotes. It also writes glyphs.h and a width table for host
tests. src/ui/draw.c registers the font and adds section, chip, cut and
right-align helpers. Options > Font Preview draws sample screens so the font
can be judged on the Visor's LCD before the real screens use it.
2026-11-01 15:12:23 -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 97b07747ae palm-client: stop duplicate commands and stale replies over USB
The bridge log showed each Refresh sending GET_CONTACTS twice: SrmSend
reports a timeout while the Visor's USB re-attaches but still delivers
the bytes it accepted, so resending the whole frame duplicated the
command, and the extra reply could be taken as the next request's.
TransportSend now only resends the unsent remainder, and each request
first drains input left over from earlier ones (still noting pushes).
2026-11-01 15:00:01 -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 5f268f4d0e progress: Node Settings verified on the Visor 2026-11-01 12:15:07 -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 87e337b6fd palm-client README: Query radio is now Connect 2026-11-01 11:57:48 -05:00
rich c9f6aaeae4 Connect screen verified on the Visor; update bridge prompt 2026-11-01 11:57:44 -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 f4bab463d1 palm-client: USB bench link works end to end
Query radio on the Visor Neo got DEVICE_INFO from the XIAO via USB
cradle -> visor_bridge.py -> FTDI -> D6/D7 UART. The app's HsUd driver
sends on the Visor's HOTSYNC USB port (2), not GENERIC, so the bridge
listens on every port and replies on the one in use; stalled endpoints
are cleared instead of ending the session. The app waits after SrmOpen
and retries sends that time out while the bridge attaches. make install
stops the bridge, which would otherwise grab the Visor during HotSync.
2026-11-01 11:46:04 -05:00
rich 8a118e4cac palm-client: USB link to the radio via the Visor's HsUd port and a Mac bridge
The Ports screen showed the Neo's Serial Manager drivers, including
'HsUd' (USB, the GENERIC port). The app gets a Serial/USB link switch
(USB default); Query radio retries since the bridge needs a moment to
attach, and SrmSendWait is gone (it can block over USB with no host).
tools/visor_bridge.py (stdlib + libusb via ctypes) finds the GENERIC
port from the Visor's connection info and forwards bytes to the radio's
serial port, logging each companion frame. Ports shows one line per
driver so all of them fit.
2026-11-01 11:32:22 -05:00
rich 259c666ad8 palm-client: Ports diagnostics screen; make editor for clangd
The Ports screen lists Serial Manager drivers (creator, feature flags,
max baud, description) to find which one reaches the USB cradle, as a
first step toward a USB bridge for testing before the boards arrive.
make editor copies the SDK headers out of the image and writes
compile_flags.txt so the editor stops flagging Palm OS types.
2026-11-01 11:24:36 -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 829f544479 firmware: D6/D7 UART verified with an FT232R at 115200 8N1 2026-11-01 11:15:49 -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 f1bd57a434 firmware: Makefile build at pinned MeshCore, fix I2C pin override
The patch's -UPIN_WIRE_* flags undefined the new values too (PlatformIO
emits -U after all -D), breaking Wire; use build_unflags instead.
Regenerate the patch against MeshCore a366955c. On Apple Silicon, pin the
native GCC 14 toolchain since the default GCC 7.2.1 is x86_64-only.
2026-11-01 11:01:04 -05:00
rich 7d1846e3c9 progress: VisorMesh runs on the Visor Neo 2026-11-01 10:54:15 -05:00
rich decded0375 palm-client: pilot-link patch for Visor USB on macOS, verified link
macOS briefly holds the Visor right after HotSync enumerates it, so
pilot-link's single USBDeviceOpen failed with kIOReturnExclusiveAccess
and the Visor reported the connection couldn't be established. The
patch retries the open for up to 2 s. pilot-xfer -l now lists the
Visor Neo's databases.
2026-11-01 10:52:12 -05:00