Skip to content

fh8852v200_lite_tuya-f1602-d2: upright by default, measured pan/tilt travel - #296

Merged
openipc-ai merged 3 commits into
OpenIPC:masterfrom
lexleite:patch-2
Dec 4, 2026
Merged

openipc-ai merged 3 commits into
OpenIPC:masterfrom
lexleite:patch-2

Conversation

@lexleite

@lexleite lexleite commented Dec 4, 2026

Copy link
Copy Markdown
Contributor

Two changes to the Tuya F1602-D2 profile (from #291), both tested on the camera.

1. Upright by default. The profile assumed a ceiling mount: flip and mirror on, with the pan/tilt directions to match. This is a desk/shelf camera, so it now defaults to standing upright: customizer.sh sets image.flip and image.mirror to false, and gpiostep.conf has pan_left=1, tilt_up=-1. The comments in both files, and NOTES.md, say what to change for a ceiling mount: both flips on and both directions reversed.

The old comment's reason for flip + mirror (the Bayer table only matched mirrored readout, OpenIPC/firmware#3027) no longer applies since #292 and #294: all four orientations have the right colours.

2. Measured travel. The travel was longer than the head can turn, so every move to the far end of an axis drove the motor into the gearbox stop, where it ground. I drove the head from one stop to the other in small counted moves (/ptz?move=...&steps=N), comparing snapshots after each, until the picture stopped moving:

axis was stop to stop now
pan 320 ~292, the same in both directions (the stock lr_len is 290) 288
tilt 230 (the stock ud_len) ~146 142

With 320/230 the head drove about 28 (pan) and 84 (tilt) steps into the far stop. The new values stop a few steps short of it. The earlier "~2590 half-steps" pan figure was wrong; the stock 290 was right.

Also new: pan_frame_steps=128 and tilt_frame_steps=60, from the picture shift at 2560x1440 (about 20 px a pan step and 24 px a tilt step). They centre a point double-tapped on the picture, as on gk7205v510_ultimate_zenointel-sd-2n-4g.

Tested on the camera, standing upright with flip and mirror off and this gpiostep.conf:

  • homing found both stops and centred at 144/71;
  • each arrow turns the head the way it says, checked by the picture shift;
  • at all four soft limits the picture was still moving on the last 4-step move, so the head stops before the gearbox does.

Not covered here: under the streamer's load the head runs about 2.5x slower than pan_delay_us/tilt_delay_us ask for (100 steps take about 2.3 s instead of 0.8 s). That is gpiostep.ko's per-micro-step cond_resched() handing the core to majestic; with majestic stopped the same move runs at the configured rate. That would need a change in OpenIPC/firmware, not in this profile.

🤖 Generated with Claude Code

…travel

Updated pan and tilt travel values and adjusted camera orientation settings.
…travel

Update camera settings to set image flip and mirror to false.
…travel

Clarified camera orientation settings and adjustments for upside down usage.
@qodo-free-for-open-source-projects

qodo-free-for-open-source-projects Bot commented Dec 4, 2026 •

Copy link
Copy Markdown

PR Summary by Qodo

Tuya F1602-D2: upright default and measured pan/tilt travel

⚙️ Configuration changes 🐞 Bug fix 🕐 10-20 Minutes

Grey Divider

AI Description

• Defaults the profile to upright: flip and mirror off, pan_left=1, tilt_up=-1.
• Replaces guessed travel with measured stop-to-stop values: pan 288, tilt 142, avoiding gearbox
 stops.
• Adds pan_frame_steps=128 and tilt_frame_steps=60 for double-tap centring at 2560x1440.
Merge Risk 🟢 Low

Blast radius 🟡 Medium 💥 2 capabilities

  • 2 affected capabilities within one bounded functional scope: fh8852v200 camera imaging and PTZ integration.
  • This is the end-to-end presentation behavior for the same camera profile whose PTZ coordinates are calibrated in the companion gpiostep configuration; it is a distinct viewer outcome within one bounded device integration.
  • The changed values directly control the pan/tilt movement and image-relative positioning of this camera.
  • They are separate user-visible PTZ operations within the same bounded camera integration, not independent deployment or storage capabilities.
Sources

devices/fh8852v200_lite_tuya-f1602-d2/general/overlay/etc/gpiostep.conf[27-31]

# Steps that turn the head by one whole frame of the picture, across and down,
# measured on the board by image shift at 2560x1440 (about 20 px a pan step
# and 24 px a tilt step): what centres a point double-tapped on the picture.
pan_frame_steps=128
tilt_frame_steps=60

devices/fh8852v200_lite_tuya-f1602-d2/general/overlay/usr/share/openipc/customizer.sh[28-32]

# The camera stands upright, so the picture is neither flipped nor mirrored.
# Hung upside down it needs both true (this SoC can't rotate), and pan_left and
# tilt_up in /etc/gpiostep.conf the other way round.
cli -s .image.flip false
cli -s .image.mirror false

devices/fh8852v200_lite_tuya-f1602-d2/general/overlay/etc/gpiostep.conf[5-16]

# Travel from one gearbox stop to the other, in gpiostep steps (8 half-steps),
# measured by driving the head from stop to stop until the picture stopped
# moving: pan ~292 (both ways; the stock lr_len is 290), tilt ~146. A few steps
# short of that, so a move to the far end stops before the gearbox does.
pan_travel=288
tilt_travel=142
# The camera stands upright and the picture is neither flipped nor mirrored: raw
# +pan turns the view left, +tilt turns it down (from the picture shift on the
# camera). Hung upside down, with image.flip and image.mirror on, it needs both
# the other way round: pan_left=-1 and tilt_up=1.
pan_left=1
tilt_up=-1
Behavioral complexity 🟢 Low 🧩 Straightforward

  • Before, the profile enabled both image transformations for an upside-down installation.
  • After, it directly selects false for both transformations for an upright installation.
  • The new correctness condition is that the fixed device mounting orientation and the two image settings agree; no new algorithm, state interaction, or compatibility protocol is introduced.
Sources

devices/fh8852v200_lite_tuya-f1602-d2/general/overlay/usr/share/openipc/customizer.sh[28-32]

# The camera stands upright, so the picture is neither flipped nor mirrored.
# Hung upside down it needs both true (this SoC can't rotate), and pan_left and
# tilt_up in /etc/gpiostep.conf the other way round.
cli -s .image.flip false
cli -s .image.mirror false
Potential damage 🟡 Medium 🩹 Incorrect results

  • If the orientation settings regress for an upright camera, the video can be displayed upside down or mirrored.
  • The supported source describes only image presentation effects, not data corruption or external side effects.
  • Changing the two image settings and restarting or reapplying customization restores the intended presentation; no persistent data repair is indicated.
Sources

devices/fh8852v200_lite_tuya-f1602-d2/general/overlay/usr/share/openipc/customizer.sh[28-32]

# The camera stands upright, so the picture is neither flipped nor mirrored.
# Hung upside down it needs both true (this SoC can't rotate), and pan_left and
# tilt_up in /etc/gpiostep.conf the other way round.
cli -s .image.flip false
cli -s .image.mirror false
Assessed commit d894556
Diagram

graph TD
  A["customizer.sh"] --> B["majestic image flip/mirror"] --> C["Picture orientation"]
  D["gpiostep.conf"] --> E["gpiostep.ko"] --> F["Pan/tilt motor GPIOs"]
  D --> G["Travel and frame steps"]
  G --> E
Loading
High-Level Assessment

The PR keeps the existing configuration-file approach and replaces guessed values with values measured on hardware. Stop-to-stop travel depends on the physical gearbox, so it cannot be derived from code. Clamping travel in gpiostep.ko or detecting stops at runtime would be a firmware change, which the PR notes is out of scope. The profile-level change is the right scope.

Files changed (3) +26 / -15

Documentation (1) +4 / -2
NOTES.mdDocument upright default and upside-down configuration +4/-2

Document upright default and upside-down configuration

• Rewrites the Bayer table note to say the profile is upright with flip and mirror off. Explains that the upside-down mount needs both flips on and the pan/tilt directions swapped.

devices/fh8852v200_lite_tuya-f1602-d2/NOTES.md

Other (2) +22 / -13
customizer.shSet image flip and mirror to false for upright mounting +5/-4

Set image flip and mirror to false for upright mounting

• Changes majestic image.flip and image.mirror from true to false. Comments now explain that a upside-down mount needs both enabled, with pan_left and tilt_up reversed in gpiostep.conf.

devices/fh8852v200_lite_tuya-f1602-d2/general/overlay/usr/share/openipc/customizer.sh

gpiostep.confUpdate measured travel, upright directions, and frame step values +17/-9

Update measured travel, upright directions, and frame step values

• Sets pan_travel to 288 and tilt_travel to 142 from measured stop-to-stop moves, so moves stop short of the gearbox. Sets pan_left=1 and tilt_up=-1 for upright mounting. Adds pan_frame_steps=128 and tilt_frame_steps=60 for double-tap centring.

devices/fh8852v200_lite_tuya-f1602-d2/general/overlay/etc/gpiostep.conf

@qodo-free-for-open-source-projects

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider

Great, no issues found!

Qodo reviewed your code and found no material issues that require review

Grey Divider

Tip of the day
💡 Did you know, you can import rules and skills only from the repositories your team follows

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

@openipc-ai
openipc-ai merged commit b85bcc3 into OpenIPC:master Dec 4, 2026
7 checks passed
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