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.
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).
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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).
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
Rename pi-install.sh to cradle-install.sh, default SYNC_HOST to the
Mac mini, and look for pilot-link in ~/.local (it's no longer packaged
in Debian 13). make install now depends on all, so it works when the
build runs in Docker.
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).
Checked in JLC's placement preview: U1, U2, U4 needed a 90 deg clockwise
turn (270) and U3, U5-U7 a 180 deg turn for pin 1 to land on the pin-1
pad. Y1 and D1 were already correct.
SXT32413BA07 (C6264361) is out of stock at LCSC. Same 14.7456 MHz and
3225-4P footprint; 20 pF load vs 13 pF, so with the existing 22 pF caps
it runs a few tens of ppm high, which is irrelevant for UART timing.