Skip to content

Add hi3518ev200_lite_baolian-11r6w25-hx20y (parallel JX-H65, zoom/focus lens) - #218

Merged
openipc-ai merged 2 commits into
masterfrom
add-hi3518ev200_lite_baolian-11r6w25-hx20y
Oct 30, 2026
Merged

openipc-ai merged 2 commits into
masterfrom
add-hi3518ev200_lite_baolian-11r6w25-hx20y

Conversation

@openipc-ai

Copy link
Copy Markdown
Contributor

Device

Baolian (宝利安) 11R6W25-HX20Y, the camera of OpenIPC/firmware#2675. It's a white-label board (openipc.org entry):

  • hi3518ev200, 8 MB NOR (XM25QH64A), MT7601U Wi-Fi
  • a parallel JX-H65 wired to the low VI pins
  • a motorised zoom/focus lens with two stepper motors

Cloned from hi3518ev200_lite_vstarcam-c8892wip: same SoC, flash size, Wi-Fi and kernel config.

What's specific to it

customizer.sh (first boot):

muxes.sh (every boot):

  • Muxes GPIO0_6, one of the focus coils, which boots as FLASH_TRIG.
  • Homes and parks the lens, in the background: zoom to its tele stop and focus to its near stop (gpio-motors -400 -530 3), then out to wide and the focus peak the reporter measured there (gpio-motors 370 170 3). A stepper doesn't know its position after a power cut, so this has to run every boot.
  • Only when /usr/bin/gpio-motors knows ptz_coil_active. An older gpio-motors would drive these coils inverted and leave both motors energised, so until gpio-motors: drive active-low coils without leaving them energised firmware#2731 is in the firmware it skips the lens entirely.

Excludes: the vstarcam list, with these changes:

README: a row for the device, marked "testing".

Order

Do not merge before OpenIPC/firmware#2731. The muxes.sh guard makes an earlier merge safe (the lens is simply left alone), but the lens only works once #2731 is in. The sensor part works with today's firmware.

Tested

  • Not on the camera yet. The #2675 reporter will flash this PR's build. Their earlier hand-driven tests are the source of every value here: pins, coil order and polarity with a shell script equivalent to gpio-motors with ptz_coil_active 0, ranges zoom 0–370 and focus 0–510, the focus peak at 168–171 at wide, and the sensor profile.
  • Both scripts parse under busybox ash (ash -n).
  • python3 .github/scripts/ci-matrix.py --self-test → self-test ok (130 devices, 16 smoke, 39 cases). The selector narrows this PR to the new device.

…us lens)

The OpenIPC/firmware#2675 camera: hi3518ev200, 8 MB NOR, MT7601U Wi-Fi,
a parallel JX-H65 wired to the low VI pins and a two-motor zoom/focus lens.
Cloned from hi3518ev200_lite_vstarcam-c8892wip (same SoC, flash and Wi-Fi):

- customizer.sh points majestic at dvp_jxh65_960p.ini, the profile measured
  on this camera (the shared jxh65_i2c_960p.ini gives a pink picture), and
  sets the lens pins in coil order with ptz_coil_active 0: both motors are
  active-low, decoded from the factory motor.ko.
- muxes.sh muxes GPIO0_6 (a focus coil, FLASH_TRIG at boot) and on every boot
  homes zoom to its tele stop and focus to its near stop, then parks at wide
  (370) and the focus peak the reporter measured there (170), in the
  background. Only with a gpio-motors that knows ptz_coil_active: an older
  one drives these coils inverted and leaves them energised.
- The excludes keep libsns_jxh65.so, the board's profile under both of its
  names, and the ov9732 IQ file the reporter is comparing; they drop the
  AR0237 files the vstarcam keeps.
@qodo-free-for-open-source-projects

Copy link
Copy Markdown

PR Summary by Qodo

Add Baolian 11R6W25-HX20Y firmware profile with zoom/focus support

✨ Enhancement ⚙️ Configuration changes 📝 Documentation 🕐 20-40 Minutes

Grey Divider

AI Description

• Add an 8 MB HI3518EV200 build for the Baolian camera’s parallel JX-H65 and MT7601U.
Diagram

graph TD
  A["First boot setup"] --> B["Device settings"] --> G["JX-H65 capture"]
  C["Boot pin mux"] --> D{"Polarity supported?"} -->|yes| E["GPIO motors"] --> F["Zoom focus lens"]
  D -->|no| H["Leave lens idle"]
  B -->|coil settings| E
Loading
High-Level Assessment

The per-device overlay is the right place for board-specific sensor selection, pin muxing, and lens travel. Reusing the sibling’s build configuration and the existing gpio-motors utility avoids a separate motor driver. Merge after the upstream active-low support lands and hardware validation confirms the boot sequence.

Files changed (6) +2669 / -0

Enhancement (2) +45 / -0
customizer.shSet the sensor and active-low lens wiring +30/-0

Set the sensor and active-low lens wiring

• Sets the device upgrade URL, JX-H65 sensor and board-specific DVP profile, MT7601U Wi-Fi profile, and ordered zoom/focus GPIO coils with active-low polarity. It does not advertise the lens as pan/tilt.

devices/hi3518ev200_lite_baolian-11r6w25-hx20y/general/overlay/usr/share/openipc/customizer.sh

muxes.shSafely home and park the lens at boot +15/-0

Safely home and park the lens at boot

• Remuxes the focus-coil pad from FLASH_TRIG, then runs a background home-and-park sequence on every boot. It skips motor movement unless gpio-motors recognizes the active-low setting.

devices/hi3518ev200_lite_baolian-11r6w25-hx20y/general/overlay/usr/share/openipc/muxes.sh

Documentation (1) +1 / -0
README.mdList the Baolian camera as testing +1/-0

List the Baolian camera as testing

• Adds its SoC, sensor, Wi-Fi, flash size, and zoom/focus lens to the device table. The testing status reflects that this build has not yet been flashed to the camera.

README.md

Other (3) +2623 / -0
hi3518ev200.generic.configAdd the HI3518EV200 kernel configuration +2502/-0

Add the HI3518EV200 kernel configuration

• Adds the Linux 4.9.37 configuration used for this device, based on the same-SoC sibling. It includes HI3518EV20X platform support and the MT7601U module.

devices/hi3518ev200_lite_baolian-11r6w25-hx20y/br-ext-chip-hisilicon/board/hi3516cv200/hi3518ev200.generic.config

hi3518ev200_lite_baolian-11r6w25-hx20y_defconfigRegister the Baolian 8 MB lite build +67/-0

Register the Baolian 8 MB lite build

• Adds the device’s Buildroot defconfig with Hisilicon packages, MT7601U firmware, Majestic, and gpio-motors. The config points to the device’s kernel configuration.

devices/hi3518ev200_lite_baolian-11r6w25-hx20y/br-ext-chip-hisilicon/configs/hi3518ev200_lite_baolian-11r6w25-hx20y_defconfig

hi3518ev200_lite.listTrim unused files while retaining JX-H65 assets +54/-0

Trim unused files while retaining JX-H65 assets

• Adds an 8 MB rootfs exclusion list that retains the JX-H65 library, both names for the board’s DVP profile, and the OV9732 IQ file for comparison. It excludes unused AR0237 assets and other unneeded sensor files.

devices/hi3518ev200_lite_baolian-11r6w25-hx20y/general/scripts/excludes/hi3518ev200_lite.list

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

qodo-free-for-open-source-projects Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0) 🎨 UX issues (0) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)

Grey Divider


Remediation recommended

1. Lens motor failures leave no boot log ✓ Resolved
Description
muxes.sh redirects all output from both gpio-motors commands to /dev/null and runs them in the
background without checking their final status. If homing or parking fails, the lens can remain out
of position while neither the motor error nor the failed boot-time operation is recorded.
Code

devices/hi3518ev200_lite_baolian-11r6w25-hx20y/general/overlay/usr/share/openipc/muxes.sh[14]

+	(gpio-motors -400 -530 3 && gpio-motors 370 170 3) >/dev/null 2>&1 &
Evidence
The new script makes homing a prerequisite for parking with &&, then discards stdout and stderr
from the entire background job. It contains no subsequent status check or logging path.

devices/hi3518ev200_lite_baolian-11r6w25-hx20y/general/overlay/usr/share/openipc/muxes.sh[6-15]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Boot-time lens homing and parking discard motor errors and do not record a failed exit status, making a failed operation difficult to diagnose.
## Fix Focus Areas
- devices/hi3518ev200_lite_baolian-11r6w25-hx20y/general/overlay/usr/share/openipc/muxes.sh[13-15]
## Recommended Fix
Keep the sequence asynchronous, but route motor errors to the system log and log a distinct failure if either command exits unsuccessfully.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Tip of the day
💡 Did you know, you can route each severity your way: inline, summary, both, or drop

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

muxes.sh sent gpio-motors' output to /dev/null, so a home or park that
failed left the lens out of position with nothing recorded. Its output and
the outcome now go to syslog under "lens": "homed, parked at zoom 370 focus
170", or "homing failed: lens position unknown" with gpio-motors' own
error before it. A gpio-motors too old to know ptz_coil_active is logged
too, rather than skipped silently. Still in the background.
@openipc-ai
openipc-ai merged commit bf39b9e into master Oct 30, 2026
7 checks passed
@openipc-ai
openipc-ai deleted the add-hi3518ev200_lite_baolian-11r6w25-hx20y branch October 30, 2026 13:15
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.

1 participant