Commit Graph
113 Commits
Author SHA1 Message Date
James BabcockandClaude Fable 5 a7684f603d Device-info probe: frame tracing, query retry, push acceptance, left-lens fallback
On stock 2.2.9 the settings read on the right lens goes unanswered even after
a successful security-auth exchange and fresh pairing. Since no 2.2.9-era
capture of a settings read exists (g2flash only exercises auth + OTA), turn
the probe into an experiment that a single on-device run can settle:

- Log every control-channel frame (sid/flag/type/magic/frag/payload prefix)
  and every write under the FaceclawDeviceInfo logcat tag.
- Retry the settings read once before concluding a lens is silent.
- Accept a sid-0x09 frame carrying firmware versions on the device's own
  magic (an unsolicited push) as an answer, not just the awaited ack.
- If the right lens stays silent, run the same connect/auth/prelude/read
  against the LEFT lens and use its answer, logging which lens replied, to
  test whether 2.2.9 moved the settings endpoint.

The probe now takes both arm addresses; the firmware-check page passes them.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016ZqzwmRQ3HQxasBz5rYyZV
2026-08-23 17:24:19 -07:00
James Babcock 33f06b9655 Fix up the first few pages of the onboarding flow 2026-08-23 16:52:34 -07:00
James BabcockandClaude Fable 5 1bde70aa45 Implement the 2.2.9 security-auth exchange on every stock-facing BLE connection
Firmware 2.2.9 requires the sid-0x80 DEVICE_SETTINGS/AUTHENTICATION(4)
exchange shortly after each GATT connection: it gates query responses on
completing it over an encrypted link, and closes unauthenticated links after
~30 s. On a phone with no existing bond (no inherited stock-app pairing) the
exchange is also what triggers SMP pairing. This is why the onboarding
firmware check failed with "no response to the device-info query" on a fresh
device: the probe connected, the prelude was acked, but the settings query was
never answered and no pairing ever happened. (See
../notes/ble-connections-2.2.9.md, validated by g2flash on hardware.)

- BleProtocol: buildAuthenticationRequest / isAuthenticationSuccess (strict:
  command 4, matching magic, empty result message), SID_SECURITY_AUTH.
- Device-info probe: authenticates before the prelude with a 30 s window (the
  user may need to accept an OS pairing prompt; the check page says so). Soft
  on non-response since the probe also runs against the custom firmware —
  but a query timeout after unconfirmed auth now names the pairing problem.
- Flash-prompt communicator: authenticates each arm before the prelude
  (mandatory — it only ever talks to stock firmware).
- Firmware flasher: control-channel notifications are now mandatory, each
  lens authenticates before OTA BEGIN, and the OTA-time heartbeat is gone —
  official captures show no control traffic during a transfer, heartbeats
  demonstrably do not satisfy the 2.2.9 deadline, and a concurrent control
  writer interleaves with the marker/data transactions. The OTA envelope
  counter now resets after bring-up, mirroring the stock sequence.
- Main communicator: authenticates both arms after connecting, before the
  prelude, with a short soft wait (logs and continues on timeout so firmware
  that never answers cannot stall reconnects).

Hardware test pending: fresh-device onboarding against stock 2.2.9 (check,
prompt, flash), and a regression pass on custom-firmware connect + probe.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016ZqzwmRQ3HQxasBz5rYyZV
2026-08-23 16:19:16 -07:00
James BabcockandClaude Fable 5 17182532f4 Address review findings for the proximity-pairing PR
Correctness:
- Pair-glasses flows no longer strand the app in the manual-disconnected
  state: the pre-scan disconnect is followed by resumeAutoReconnect(), and
  the config page's scan hand-off drops the live link too.
- The mixed-arms serial warning is reachable now: pairs() groups by the
  canonical serial key, and a lone left + lone right with different serials
  get the mismatch warning on both rows (it previously required two
  different serials inside one serial-keyed group, which cannot happen).
- A selected pair that degrades to one arm (prune while the page is open)
  is deselected, and Save never pads a missing arm from stored addresses.
- DiscoveryAggregator.ingest no longer lets a bonded re-emit or split
  advertisement overwrite the note/name/flag learned from a full
  advertisement, and reclassifies split reports using remembered fields so
  a nameless half doesn't drop the arm.
- estimateProximity ignores the advertised TX Power Level (radiated power,
  not measured-power-at-1m); the calibration table is the only reference.
- Saving a ring without a glasses pair updates the stored identity's ring
  name/address instead of leaving the previous ring on record.
- Ring detection requires the stock "EVEN R1" name prefix in both the TS
  classifier and the Java pre-filter; a bare "R1" substring matched
  unrelated devices, and ring rows are always selectable.
- One-shot scans keep every sample (buildAddressSet merges them through
  DiscoveryAggregator), and flash-flow address resolution takes left/right
  from one serial-joined complete pair instead of latest-per-role.

Lifecycle:
- The pairing scan and its refresh timer pause on app suspend and resume
  with the app, and the model's app-event hooks are detached when the page
  is left for good.

Cleanup:
- One MAC normalizer (even-advertisement.normalizeMacAddress, re-exported
  by device-addresses), used for the ring "Yours" comparison too.
- One serial-equality definition (serialKey/serialsMatch); the containment
  fallback in isPreviouslyPaired is gone.
- Shared formatErrorMessage replaces five per-view-model copies; shared
  hex-util replaces the duplicate TS hex codecs; one Java bytesToHex in
  FaceclawFirmwareUtil replaces three hand-rolled encoders.
- glassesRow/ringRow share a presentation-base helper; dead row address
  fields, the constant glassesSectionVisibility, the identical-branch
  status ternary, and zoneRank/ZONE_ORDER are removed.
- .gitignore now actually covers .test-build/ as tests/README claims.

UI:
- Dark-mode styles for the pairing page: readable instructions, dark-gray
  cards with consistent light text; light mode keeps its current look.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016ZqzwmRQ3HQxasBz5rYyZV
2026-08-23 15:28:59 -07:00
James Babcock ee022cdc84 Merge branch 'main' into bluetooth-pairing-improvements 2026-08-23 13:39:50 -07:00
James Babcock 2b71eddab5 Optimize APK size
Removes unused keyword-spotting model. Makes on-device voice model a
runtime download rather than bundling it. Removes native-code library
versions for 32-bit and x86_64 processors.
2026-08-22 23:04:01 -07:00
James Babcock 69ec828cb7 Add release-build script; and bump version number to 0.5.0 2026-08-22 22:28:36 -07:00
Kalani Helekunihi aaaa7288ee Add proximity-based pairing for Even devices
Stream BLE advertisements into a dedicated pairing flow with arm, ring, serial, and hardware variant detection.

Add proximity ranking, device artwork, pairing safeguards, and unit coverage for discovery and candidate grouping.
2026-08-22 21:50:17 -05:00
James Babcock 0ed242a36f QR code loading works 2026-08-22 00:24:36 -07:00
James Babcock 5db6df93dd Merge branch 'main' into evenhub-from-qr 2026-08-21 23:55:08 -07:00
James Babcock 8ebfbb4fa6 Speed up connection/wake
Removes "image warmup", which was a workaround for a firmware bug that
no longer exists (even in stock, I think).
2026-08-21 22:58:44 -07:00
James Babcock 92cd05b6ca Add options to load an app from a URL or a QR code
(The QR code reading does not work yet)
2026-08-21 12:03:24 -07:00
James Babcock 6e4ece5dc7 Brightness-correct and dither music player album art images 2026-08-21 10:54:25 -07:00
James Babcock 8cdee2a701 HTTP requests identify Faceclaw in their user-agent string 2026-08-20 11:32:50 -07:00
James Babcock 33b669ed41 Remove a stray merge conflict marker 2026-08-20 09:07:15 -07:00
James Babcock 0c0fc7d7f6 Merge branch 'evenhub-compatibility' 2026-08-20 08:46:47 -07:00
James Babcock f6035ea9ec Performance optimizations 2026-08-20 02:46:03 -07:00
James Babcock 96842ceb23 Use TTF fonts throughout the UI; also add some more functions to app extension API 2026-08-19 19:35:24 -07:00
James Babcock 90603b5aa4 Use the texture cache and builtin-font drawing firmware extensions 2026-08-19 10:36:16 -07:00
James Babcock 83e0fa919f Use the texture cache to avoid resending icons and font glyphs 2026-08-18 23:39:21 -07:00
James Babcock 526a236193 Display link to EvenHub apps' privacy policy on first run 2026-08-16 22:33:04 -07:00
James Babcock 6a9743d27c Fix an overly-strict validation firmware validatio
The flasher was validating that there are exactly 5 firmware segments
(which was true of 2.2.4 but not 2.2.6), causing it to reject the stock
firmware in the uninstall flow.

(This doesn't actually prevent uninstalling as you can still use the
stock Android app's OTA updater.)
2026-08-16 21:01:21 -07:00
James Babcock dcf35dd606 Fix issue with EvenHub apps freezing when not foregrounded on the phone 2026-08-16 21:01:20 -07:00
James Babcock b6785e5a5a Send cleanup messages on disconnect 2026-08-16 21:01:20 -07:00
James Babcock 5cd61da362 Virtualize timers in app webviews 2026-08-16 21:01:20 -07:00
James Babcock 1d00849eb2 Add font viewer 2026-08-16 21:01:17 -07:00
James Babcock b9f48c8e16 Allow backgrounding EvenHub apps 2026-08-16 20:59:42 -07:00
James Babcock 812c3f9b4a Add font viewer 2026-08-13 00:38:19 -07:00
James Babcock 5d29d91133 First-pass EvenHub compatibility layer 2026-08-11 22:52:32 -07:00
James Babcock 6f45888627 Add support for a local model (Qwen3) 2026-08-09 23:52:21 -07:00
James Babcock 9ade3503a0 Add a resource-usage monitor to debug app; fix excessive memory-usage from screen preview when not focused 2026-08-07 02:21:24 -07:00
James Babcock 2cfe511efb Ensure magnetometer compass is off when in suspend/sleep
<details>
<summary>Prompts Used</summary>
We recently added a magnetometer/compass app. I notice that, when I left it open, battery life was shorter (similar to what it was before we implemented screen-off powersave mode support). Let's ensure that we turn off magnetometer option off when turning the screen off.
</details>
2026-08-04 20:35:55 -07:00
James Babcock ba81e46624 Add Soniox as an API speech-to-text option 2026-08-04 20:15:39 -07:00
James Babcock 852626e950 Add a compass using the G2's magnetometer 2026-08-04 02:09:32 -07:00
James Babcock 1ec6b3ff83 Crop screenshots 2026-08-02 19:36:16 -07:00
James Babcock 960e2fd6e1 Add a lock screen, controlled by wear-detection 2026-08-02 15:38:07 -07:00
James Babcock 4302a506d4 On-device voice model: Normalize before input, place boundary cuts at silence
These changes hopefully improve transcription accuracy with the
on-device model
2026-08-02 02:43:53 -07:00
James Babcock 02c09ef889 Fix broken wakeword handling 2026-08-01 14:37:30 -07:00
James Babcock 6d42f0e65e Expand screen resolution to the full 640x480 2026-07-31 12:57:10 -07:00
James Babcock 818f33ce33 Increase screen size a little bit past 576x288, to exercise the corresponding new firmware 2026-07-30 00:45:31 -07:00
James Babcock e96011ef47 Remove remnants of BMP format from FaceclawBleCommunicator etc 2026-07-28 11:44:28 -07:00
James Babcock b738ce4bb2 Add screen-recording option 2026-07-28 10:16:44 -07:00
James Babcock dcf68cb09a Fix an issue in the on-device transcription that would cause it to break on longer inputs
Thanks. Let's move the Microphone button to the top-right position in the 3x3 arrangement.
2026-07-26 18:43:33 -07:00
James Babcock bde70ac380 Add a Navigate app (requires a Mapbox API token) 2026-07-25 23:32:01 -07:00
James Babcock 3c2f53ed75 Rename the Teleprompt app to Files, improve its navigation and add support for images 2026-07-25 21:33:58 -07:00
James Babcock d2c987d48a Add media-browser to Music app 2026-07-24 10:02:03 -07:00
James Babcock 8ffccad7f0 Use extended CFW options for sleep/wake handling to wake from sleep without a flash of dashboard 2026-07-23 23:54:56 -07:00
James Babcock e5649e9782 Add experimental option to end EvenHub session when the screen is off for power saving 2026-07-23 18:40:48 -07:00
James Babcock 7455775390 Add brightness setting 2026-07-23 10:48:35 -07:00
James Babcock a5c6f18795 Add silent-mode and low-battery indicators to Android preview form 2026-07-20 12:02:20 -07:00