Repository navigation
✨ #174: Auto-sleep, LED, field of view, mirror, audio, gestures and factory reset - #176
Closed
nofuturekid wants to merge 7 commits into
Closed
nofuturekid wants to merge 7 commits into
nofuturekid wants to merge 7 commits into
Conversation
Framed commands on unit 2, selector 2 carry two CRC-16/USB checksums (reflected polynomial 0xA001, init and final XOR 0xFFFF): one over the 12-byte header and one over the data block, each with its own field zeroed. Until now every command replayed a captured checksum together with its captured sequence number, so no new command could be added without a capture. The new frame builder takes receiver, command id and data and computes both checksums. Each camera hands out its own sequence numbers, seeded from the clock, because the camera drops a frame that repeats the previous sequence number. Sleep, tracking speed, exposure mode type and preset recall now use the builder. Their tests build with the captured sequence numbers and check that the captured frames come out byte for byte, which proves the checksums. Thanks to gnacho for working out the checksum in #171. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
New CLI commands: - `auto-sleep off|30s|2m|10m|<seconds>` sets the time after which the camera falls asleep on its own (short command `0b 02 <i16 seconds>`). `off` sends the current time negated, as OBSBOT Center does, so the camera keeps the time for when auto-sleep is turned on again. - `sleep-background black|image [--mirror on|off]` chooses what the camera shows while asleep (`0e 02 00 <v>`) and mirrors it (`0e 02 02 <v>`). `info` shows the auto-sleep time (status 0x0a, i16, negative = off), the sleep background (0x1b) and its mirroring (0x1d). The offsets were measured on a Tiny 2 Lite. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
New CLI commands: - `led off|1|2|3` sets the status LED brightness (short command `1a 01 <v>`). - `fov wide|medium|narrow` sets the field of view (`04 01 <v>`). - `mirror on|off` mirrors the image (`14 01 <v>`). - `invert on|off` turns view and gimbal upside down (framed command 0x3b84 to receiver 4). The camera does not report it back. `info` shows the field of view (status 0x11), mirroring (0x13) and the LED brightness (0x21). The offsets were measured on a Tiny 2 Lite, where 0x21 is the LED and not the tracking speed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
New CLI command `audio` with these settings (short commands `<cmd> 01 <v>`): - `noise-reduction off|weak|medium|strong` (0x0a) - `auto-gain on|off` (0x17) - `pickup-distance near|standard|far` (0x1b) - `mic-in-sleep on|off` keeps the microphone on while asleep (0x13) - `mic on|off` enables or disables the microphone (0x1c). Disabling it makes the camera restart, so the CLI prints a warning. `info` shows noise reduction (status 0x08), automatic gain (0x19), the pickup distance (low bits of 0x22 on top of 0x10) and the microphone while asleep (0x10). The offsets were measured on a Tiny 2 Lite. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
New CLI command `gesture` with these settings (framed commands to receiver 4): - `target-lock on|off` (0x30c4) - `zoom on|off` (0x3144) - `dynamic-zoom on|off` (0x3344) - `direction on|off`, the mirrored gesture direction (0x33c4) - `zoom-ratio <1.0-4.0>`, f32 (0x3244) `info` shows the target lock (status 0x01, measured on a Tiny 2 Lite). The camera does not report the other switches or the zoom ratio. The command tests reproduce frames captured from OBSBOT Center byte for byte. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
New CLI command `factory-reset` resets the camera to its factory settings (framed command 0xa802 to receiver 2, data 01). The camera restarts afterwards. The CLI asks for a confirmation unless `--yes` is given; without a terminal to ask on, it aborts. The command test reproduces the frame captured from OBSBOT Center byte for byte. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Checked in OBSBOT Center: "Invert view and gimbal" only reverses the gimbal's left/right direction; the image is not turned upside down. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KVMy3W9ATmKdDLXgny8Mv9
Author
|
Closing this: I moved the Tiny 2 Lite work to a separate tool, obsbot4linux, and won't maintain these changes here. The protocol notes and captures stay public in obsbot-tiny2-lite-protocol in case they help. Thanks for the project! (Written with Claude Code.) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #174
Builds on #175 (its commit is the first one here; review that one first or merge it before this).
New CLI subcommands:
auto-sleep,sleep-background,led,fov,mirror,invert,audio noise-reduction|auto-gain|pickup-distance|mic-in-sleep|mic,gesture target-lock|zoom|dynamic-zoom|direction|zoom-ratioandfactory-reset(asks unless--yes).infoshows the new fields the camera reports. English and German strings, docs indocs/cli.md.Bytes and status offsets are from captures of OBSBOT Center on a Tiny 2 Lite, see https://github.com/nofuturekid/obsbot-tiny2-lite-protocol. The offsets were measured on the Lite only (noted in the code); the tracking speed offset is left to #173.
Tested on a Tiny 2 Lite: every setting that has a status byte was set and read back. Not run on the hardware:
audio mic offandfactory-reset(both restart the camera; the factory reset frame matches the capture byte for byte). Gestures other than target lock andinvertare accepted but the camera does not report them back.Written with Claude Code (AI).
🤖 Generated with Claude Code