Skip to content

ios code - #2

Merged
imliubo merged 1 commit into
mainfrom
ios-dev
Jan 8, 2026
Merged

imliubo merged 1 commit into
mainfrom
ios-dev

Conversation

@yuanzhihong1

Copy link
Copy Markdown
Contributor

No description provided.

@imliubo
imliubo merged commit a77bc06 into main Jan 8, 2026
BrettKinny referenced this pull request in BrettKinny/StackChan Apr 26, 2026
* identity: cull dlib biometric face-recognition path (firmware)

Companion to dotty-stackchan PR #2. Description-based identity (Layer 4 v1.5 — VLM matches a free-form description against household.yaml's appearance: field) is the sole identity path; on-device biometrics are gone. Build green: stack-chan.bin 0x4fa720 bytes, 3% free.

Removed:
- firmware/main/stackchan/face/face_recognizer.{cpp,h} — NVS-backed enrollment cache + ESP-DL embedding stub (recognize() always returned kUnknown)
- firmware/main/stackchan/face/parental_gate.{cpp,h} — PIN gate for face_unlock
- firmware/main/stackchan/face/PRIVACY.md — doc for the dlib path
- face_detector.cpp recognition + emission block: FaceRecognizer::init(), the per-frame recognize() call, the JSON-escape + SendEvent("face_recognized") path, and the supporting state members (_last_recognize_ms, _last_emitted_ms, _last_emitted_identity, kRecognizeThrottleMs, kEmitStaleMs)
- 4 face MCP tools in hal_mcp.cpp: self.camera.face_enroll / face_recognize / face_forget / face_list
- StackChanCamera::EnrollFace / RecognizeFace / ForgetFace / ListFaces method bodies + DeriveFaceUrl + SimpleBridgeRequest helpers (only the face methods used them)
- Stale #include "face_recognizer.h" + #include "application.h" + <string> in face_detector

Kept (description path needs these):
- face_detector.cpp: ESP-DL detector that writes bbox to FaceDetectionResult
- face_tracking.cpp: emits face_detected / face_lost on the perception bus
- StreamJpegToBridge in stackchan_camera.cc: multipart helper used by Explain() to feed the VLM (room_view / take_photo path)
- Capture() / Explain() MCP tools

Server-side coordination:
- The bridge listener in custom-providers/xiaozhi-patches/textMessageHandlerRegistry.py still accepts both face_detected and face_recognized(identity=unknown) — that branch becomes dead-but-harmless after this firmware ships, and a small server-side cleanup PR will drop it in coordination with the flash.

Net: 1223 lines removed, 8 added across 10 files. Zero orphan refs (FaceImage, kRecognize*, _last_emitted*, DeriveFaceUrl, SimpleBridgeRequest, EnrollFace, RecognizeFace, ForgetFace, ListFaces, FaceRecognizer, ParentalGate all gone).

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

* display: drop 3 set-but-not-used vars in SetStatus

motion (line 548), is_listening (579), is_speaking (580) are all assigned but never read in StackChanAvatarDisplay::SetStatus. Likely vestiges of an older code path that branched on these flags before the ChatProfile push pattern landed. Compiler had been emitting -Wunused-variable / -Wunused-but-set-variable for them on every build.

No behaviour change. Build still green: stack-chan.bin still in 3% free envelope.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

---------

Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
Ryoichi-Kagaya pushed a commit to Ryoichi-Kagaya/StackChan that referenced this pull request Jun 30, 2026
add ios application source code
hiroshi-y added a commit to hiroshi-y/StackChan that referenced this pull request Jul 1, 2026
m5stack#1 電池表示: 左上を残量に応じた電池アイコン + "NN%" に変更(充電中は⚡前置)。
   LVGL 標準の LV_SYMBOL_BATTERY_*/CHARGE(montserrat_16 内蔵)を使用。

m5stack#2 usb_host_install fail 0x103(無リグ/PC接続時の再入室):
   原因は usb_lib_task が portMAX_DELAY 待ちで、無デバイス停止時に ALL_FREE が来ず
   固まり、usb_host_uninstall が失敗してホストが残存 → 次回 install が INVALID_STATE。
   - usb_lib_task: finite timeout(200ms)化 + 「停止済 & NO_CLIENTS 到達 & デバイス0」
     で ALL_FREE を待たず抜ける保険。
   - cat_core_stop: usb_host_uninstall の戻り値を確認し失敗時リトライ(最大5回)。
   - cat_core_start: install が INVALID_STATE なら残存ホストを uninstall→再 install で回復。
   これにより再入室 PANIC(旧ビルドで発生)も併せて解消の見込み。

Co-Authored-By: Claude Opus 4.8 <[email protected]>
jaspersj-consulting pushed a commit to jaspersj-consulting/StackChan that referenced this pull request Sep 8, 2026
…nt binding

Adds local agent + chat_message tables (MySQL) and a device.agent_id FK,
replacing server/internal/xiaozhi/xiaozhi.go for the two flows that were
actually reachable: RestoreDefaultAgent (now resets a device to the local
default agent instead of fetching a template from xiaozhi.me) and device
unbind (drops the xiaozhi.me UnbindDevice call entirely). Adds a new
/admin/stackChan/agent CRUD API plus /device/agent/bind, with a
transaction-enforced invariant that at most one agent is ever flagged
default, since every device unbind depends on one existing.

Scope is intentionally bounded: this does not touch xiaozhi.go's other,
currently-unreachable functions, does not touch the two xiaozhi token
passthrough endpoints (the Flutter app's agent-config/chat-history screens
still depend on them), and does not wire in an actual LLM/TTS backend --
llm_model/tts_voice are stored config only until the voice pipeline
(Path m5stack#2) exists to read them.

Verified with a full go build + go vet against the pinned go.mod/go.sum
in an isolated environment before this reached the working tree.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01A97WFMx17QSoFbhAnRXoZC
jaspersj-consulting pushed a commit to jaspersj-consulting/StackChan that referenced this pull request Sep 8, 2026
…agent

New POST /stackChan/device/chat route (device-auth protected, same
RSA-OAEP token scheme as the other device routes). Takes transcribed
text, resolves the device's bound agent (falling back to the default
agent), calls Ollama's /api/chat with the agent's persona as system
prompt plus recent chat_message history, persists both turns, and
returns the reply text.

This is Path m5stack#2's "Option B" integration: the M5Stack Module LLM
(AX630C) handles wake-word, ASR, and TTS entirely on-device, so only
already-transcribed text ever needs to cross the network here - no
OTA/websocket voice-streaming protocol involved. Consumes the
llm_model/persona agent fields that were seeded empty during the
agent-management work and finally have a reader.

New config.yaml section (ollama.base_url, ollama.default_model) added
as empty placeholders, matching how rsa/jwt/database secrets are kept
out of the tracked template - real values go into CT141's untracked
config.

Not yet built/deployed - Go isn't available on this Mac, so this is
pending a build/verify pass on CT141 (the only place Go actually runs
in this project so far).

Co-Authored-By: Claude Sonnet 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01A97WFMx17QSoFbhAnRXoZC
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants