Skip to content

Add ssc325_lite_heimvision-hm202 (Heimvision HM202 pan/tilt, GC2063, RTL8188FU) - #223

Open
rp- wants to merge 1 commit into
OpenIPC:masterfrom
rp-:heimlink-hm202
Open

rp- wants to merge 1 commit into
OpenIPC:masterfrom
rp-:heimlink-hm202

Conversation

@rp-

@rp- rp- commented Nov 3, 2026 •

Copy link
Copy Markdown

Device

Heimvision HM202 indoor pan/tilt camera, also sold as HM202A and as Heimlink HM202 (made by Shenzhen VanCorp
Technology Innovation; vendor firmware EYEPLUS / Closeli "CloudCam"):
SigmaStar SSC325, 64 MB DRAM, 8 MB Winbond W25Q64JV SPI NOR, GalaxyCore GC2063 (reports chip ID 0x2053 and runs
with the infinity6 gc2053 driver and IQ file), LB-Link BL-M8188FU3 (RTL8188FTV) USB WiFi, two unipolar steppers
behind a 74HC595, IR-cut filter, IR LEDs, speaker amplifier, microphone, reset button, microSD slot. Some units
have an Ethernet jack; the profile keeps OpenIPC's default dual mode.

Cloned from ssc325_lite_imou-c22cp (same SoC, flash and WiFi chip). The commit message lists what each file is
for; in short: the WiFi power/probe sequence, wpa_supplicant bgscan, gpiostep in its 74HC595 mode plus the
majestic-af gpiostep settings, a microphone unmute, the GPIO map, a first-boot customizer and an exclude list. The
board needs no device tree of its own: the generic infinity6-ssc009a-s01a one is used unchanged (the SD driver's
hold on GPIO 17, which also powers the WiFi module, is hard-wired in the driver, not taken from the device tree, so
the WiFi script handles it).

Depends on

This profile needs one change that belongs in another repository; it stays a draft until it is in:

Already in:

Hardware tested on

Two Heimvision HM202 units (SSC325 + GC2063 + W25Q64JV + RTL8188FU), flashed over UART from microSD: OpenIPC's
u-boot-ssc325-nor.bin, then kernel and rootfs built from this profile. Both now run an image built from firmware
master (with #2753, #2754 and the majestic-af bump in #2756), the 2026-11-03 majestic nightly, and linux#166 as a
local patch. One unit's flash has QE set (1-1-4 reads), the other's has it clear (falls back to 1-1-1).

Evidence

  • Boots from cold without an SD card on both units; WiFi associates and gets DHCP on every boot; ping 2-4 ms on a
    near access point with power saving off (50-350 ms with it on).
  • Sensor autodetected as gc2053, IQ file loads, 1920x1080 at 20 fps main stream plus a 640x360 sub stream, both
    pulled over RTSP by an NVR overnight; colours neutral under room light with the filter in.
  • IR-cut pulses on GPIO 78/79 give day colour / night grey; IR LEDs on GPIO 44 follow night mode; automatic
    day/night switches both ways on gain.
  • Pan/tilt: homing to both stops and centring on the first majestic start after boot (later restarts keep the
    position); moves from /ptz, the WebUI pad and ONVIF PTZ from the NVR, in the expected directions with mirror
    and flip set.
  • Reset button: a 5 s hold beeps once and reboots. A hold over 15 s runs firstboot: the camera comes back
    unclaimed (setup page), with the U-Boot environment, WiFi credentials included, unchanged.
  • Microphone: GPIO 16 is a mute switch (high mutes, floating nearly mutes, low passes the signal; the vendor app
    switches it the same way). Speech could not be verified on these two units: the capsule glue had crept over the
    membranes on both, and the vendor firmware hears no speech on them either.
  • Image size: rootfs 4984 KB of its 5120 KB slot.

…RTL8188FU)

The Heimvision HM202, also sold as HM202A and as Heimlink HM202 (vendor
firmware EYEPLUS / Closeli "CloudCam"): SSC325, 8 MB W25Q64JV NOR,
GalaxyCore GC2063 (chip ID 0x2053, run as gc2053 with the infinity6
gc2053.bin), LB-Link BL-M8188FU3 (RTL8188FTV) on USB, two unipolar
steppers behind a 74HC595, IR-cut, IR LEDs, speaker, reset button.
Cloned from ssc325_lite_imou-c22cp (same SoC, flash and WiFi):

- The defconfig adds the gc2053 sensor, gpiostep, majestic-af and
  reset-button.
- /etc/wireless/usb: GPIO 17 powers the WiFi module (active low), and the
  SD driver drives the same pad as its card power switch, off at probe
  when no card is in. The script powers the module, re-probes the EHCI if
  the module is not there yet (it does not see a device that turns up
  after its probe), and loads 8188fu with its power saving off (it held
  packets for up to a beacon interval: 50-350 ms pings and a stalling
  stream).
- /etc/network/interfaces.d/wlan0 adds bgscan to wpa_supplicant: the
  driver never leaves an access point by itself, and with two APs on one
  SSID a camera stayed on the far one after a dropout.
- /etc/modules loads gpiostep in its 74HC595 mode (sck, si, rck on GPIO
  53, 47, 52; pan on Q0-Q3, tilt on Q4-Q7); /etc/gpiostep.conf gives
  majestic-af the travel (520 x 180 steps, the vendor driver's bounds),
  directions, step delays, homing and steps per frame.
- muxes.sh drives GPIO 16 low on every boot: high mutes the microphone,
  and left floating as an input it nearly mutes it.
- customizer.sh: mirror and flip (the sensor sits upside down), IR-cut on
  78/79, IR LEDs on 44, day/night by gain (the exposure flag never fires
  on this sensor), speaker amp on 62, PTZ via gpiostep, image.rotate 0 so
  the WebUI pad knows the orientation.
- The excludes drop the NFS modules by full path: wildcard lines are no
  longer expanded, and without them the rootfs is 4 KB over its slot.
- README: the device row, and HM202A and Heimlink HM202 in the clones
  table.

@openipc-ai openipc-ai left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. Keeping this as a draft is right while linux#166, firmware#2753, firmware#2754 and majestic-af#42 are open. Once the firmware pair merges, firmware also needs a majestic-af: bump to … that carries #42. The profile follows ssc325_lite_imou-c22cp's layout, the customizer is the run-once kind, and 4984/5120 KB leaves room.

Two small things:

  • etc/init.d/S94hm202-mic exists only to run gpio clear 16. /usr/share/openipc/muxes.sh is the per-device seam for that: S30customizer runs it on every boot, and the profile you cloned already ships one. Moving the line there drops an init script and keeps the board's pin setup in one place.
  • etc/network/interfaces.d/wlan0 is firmware's file plus the bgscan sed. That's fine, but it is now a fork of a shared file. If firmware's wlan0 changes, this one won't follow, so a comment naming the upstream file it copies would help the next person.

Thanks for being explicit that the microphone and the direct-GPIO gpiostep path could not be verified.

@openipc-ai

Copy link
Copy Markdown
Contributor

Both firmware dependencies are in master: OpenIPC/firmware#2753 (gpiostep 74HC595 mode, 4f08ef28a) and OpenIPC/firmware#2754 (reset-button, 552d10098). Two dependencies are left:

Once those land, take this out of draft.

@rp- rp- changed the title Add ssc325_lite_heimlink-hm202 (Heimlink HM202 pan/tilt, GC2063, RTL8188FU) Add ssc325_lite_heimlink-hm202 (Heimvision HM202A pan/tilt, GC2063, RTL8188FU) Nov 3, 2026
@rp- rp- changed the title Add ssc325_lite_heimlink-hm202 (Heimvision HM202A pan/tilt, GC2063, RTL8188FU) Add ssc325_lite_heimvision-hm202 (Heimvision HM202 pan/tilt, GC2063, RTL8188FU) Nov 3, 2026
@rp-

rp- commented Nov 3, 2026

Copy link
Copy Markdown
Author

Update: both firmware dependencies are in, and OpenIPC/majestic-af#42 was closed in favour of the core fix in OpenIPC/majestic#363, so the only open dependency is OpenIPC/linux#166; the description is updated. Your two suggestions are in as well: muxes.sh instead of S94hm202-mic, and a comment naming firmware's wlan0.

I've also renamed the profile to ssc325_lite_heimvision-hm202: the sticker on the camera says HM202 without a brand, and it is sold as HeimVision (made by Shenzhen VanCorp Technology Innovation). The README lists HM202A and Heimlink HM202 in the clones table, and the WiFi profile id and the upgrade URL follow the new name.

I rebuilt the image from current firmware master (ed19b25, with #2753, #2754 and the majestic-af bump in #2756), the 2026-11-03 nightly (master+43427ff) and linux#166 as a local patch, and moved both units to it: the plugin loads without any fallback, the head homes and moves, reset-button watches GPIO 66, muxes.sh unmutes the microphone, and bgscan is in the wpa_supplicant config. The unit whose flash has QE clear falls back to FAST_READ; the other reads in quad mode.

@rp-
rp- marked this pull request as ready for review November 7, 2026 06:36
@qodo-free-for-open-source-projects

Copy link
Copy Markdown

PR Summary by Qodo

Add Heimvision HM202 SSC325 lite camera profile

✨ Enhancement ⚙️ Configuration changes 📝 Documentation 🕐 40+ Minutes

Grey Divider

AI Description

• Adds an HM202 image profile with GC2063 sensor support through the GC2053 driver.
• Configures WiFi recovery, pan/tilt, IR controls, audio GPIO, and first-boot defaults.
• Documents supported model aliases; QE-clear flashes require the pending OpenIPC/linux#166 fix.
Diagram

graph TD
  Profile["HM202 profile"] --> Build["Build config"] --> Drivers["Drivers and packages"]
  Profile --> Overlay["Board overlay"] --> WiFi["WiFi startup"]
  Overlay --> PTZ["PTZ actuator"] --> Motors["Stepper motors"]
  Overlay --> GPIO["Board GPIO"]
Loading
High-Level Assessment

The isolated device profile is appropriate: it reuses the existing SSC325 lite foundation and generic device tree while keeping hardware-specific WiFi and GPIO behavior out of shared defaults. A shared-profile change or device-tree fork would broaden the impact without addressing the stated board-specific behavior; the flash-driver fix remains correctly scoped to the separate kernel PR.

Files changed (10) +205 / -0

Enhancement (1) +24 / -0
usbPower and detect the HM202 USB WiFi module +24/-0

Power and detect the HM202 USB WiFi module

• Powers the module through GPIO 17 and rebinds EHCI when the device was absent at probe time. Loads 8188fu with power management disabled to avoid packet latency and stream stalls.

devices/ssc325_lite_heimvision-hm202/general/overlay/etc/wireless/usb

Documentation (1) +3 / -0
README.mdList HM202 support and model aliases +3/-0

List HM202 support and model aliases

• Adds the HM202 hardware and working-feature status to the device table. Maps Heimlink HM202 and Heimvision HM202A to this profile.

README.md

Other (8) +178 / -0
ssc325_lite_heimvision-hm202_defconfigDefine the SSC325 lite HM202 image +76/-0

Define the SSC325 lite HM202 image

• Selects the infinity6 kernel configuration, 8 MB NOR layout, and GC2053-compatible sensor support. Includes RTL8188FU, gpiostep, majestic-af, and reset-button packages.

devices/ssc325_lite_heimvision-hm202/br-ext-chip-sigmastar/configs/ssc325_lite_heimvision-hm202_defconfig

gpiostep.confCalibrate HM202 pan and tilt travel +18/-0

Calibrate HM202 pan and tilt travel

• Sets motor travel, direction, speed, homing, and frame-relative movement for majestic-af's gpiostep actuator.

devices/ssc325_lite_heimvision-hm202/general/overlay/etc/gpiostep.conf

modulesLoad filesystem and shift-register motor modules +3/-0

Load filesystem and shift-register motor modules

• Loads vfat and exfat alongside gpiostep, configured to drive the 74HC595 through GPIOs 53, 47, and 52.

devices/ssc325_lite_heimvision-hm202/general/overlay/etc/modules

wlan0Enable WiFi background scanning +10/-0

Enable WiFi background scanning

• Adds a wpa_supplicant bgscan setting to the WLAN DHCP configuration so the camera can roam away from a weak access point.

devices/ssc325_lite_heimvision-hm202/general/overlay/etc/network/interfaces.d/wlan0

customizer.shApply HM202 first-boot settings +47/-0

Apply HM202 first-boot settings

• Sets the upgrade URL and WLAN device, corrects image orientation, and configures IR-cut, gain-based night switching, speaker, and PTZ defaults.

devices/ssc325_lite_heimvision-hm202/general/overlay/usr/share/openipc/customizer.sh

gpio.confMap HM202 board GPIOs +13/-0

Map HM202 board GPIOs

• Assigns reset button, IR-cut, IR LEDs, speaker, and USB power pins while marking unused mappings unavailable.

devices/ssc325_lite_heimvision-hm202/general/overlay/usr/share/openipc/gpio.conf

muxes.shUnmute the microphone at startup +6/-0

Unmute the microphone at startup

• Drives GPIO 16 low to release the board's microphone mute switch.

devices/ssc325_lite_heimvision-hm202/general/overlay/usr/share/openipc/muxes.sh

ssc325_lite.listExclude unused NFS modules from the image +5/-0

Exclude unused NFS modules from the image

• Removes lockd, NFS, grace, and sunrpc modules from the packaged image to conserve space in the 8 MB NOR layout.

devices/ssc325_lite_heimvision-hm202/general/scripts/excludes/ssc325_lite.list

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

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (1) 📎 Requirement gaps (0) 📜 Skill insights (0)

Grey Divider


Remediation recommended

1. Shared Wi-Fi file copied into device 📘 Rule violation ⚙ Maintainability
Description
The new wlan0 overlay is a full copy of OpenIPC/firmware's shared network file with one bgscan
line added, so it must be hand-synced with every upstream change. That duplication is what checklist
item 7 forbids, and it keeps the bgscan fix confined to this device even though it may apply to
other RTL8188FU boards.
Code

devices/ssc325_lite_heimvision-hm202/general/overlay/etc/network/interfaces.d/wlan0[R1-5]

+# The HM202's antenna sits badly for some head positions and the RTL8188FU
+# driver never leaves an access point on its own, so a camera can stay on a
+# far one after a dropout: let wpa_supplicant scan below -60 dBm and roam.
+# A copy of OpenIPC/firmware's general/overlay/etc/network/interfaces.d/wlan0
+# with the bgscan line added; keep it in step with that file.
Evidence
The added file's own comment says it is a copy of OpenIPC/firmware's shared interfaces.d/wlan0
with the bgscan line added and must be kept in step with that file. Duplicating a whole shared
component to change one line is the per-device duplication that checklist item 7 says to avoid.

CLAUDE.md: Keep Device Overlays Limited to Necessary Device-Specific Files
devices/ssc325_lite_heimvision-hm202/general/overlay/etc/network/interfaces.d/wlan0[1-10]

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

## Issue description
The device overlay `devices/ssc325_lite_heimvision-hm202/general/overlay/etc/network/interfaces.d/wlan0` duplicates the shared OpenIPC/firmware `wlan0` network file and adds one `bgscan` line. This duplicates a shared component in a per-device overlay, which checklist item 7 forbids, and the copy must be kept in sync manually.

## Fix Focus Areas
- devices/ssc325_lite_heimvision-hm202/general/overlay/etc/network/interfaces.d/wlan0[1-10]

## Recommended Fix
Either (a) propose the bgscan line for the shared `general/overlay/etc/network/interfaces.d/wlan0` in OpenIPC/firmware, if it applies to all RTL8188FU devices, and delete this copy once it lands; or (b) if it must stay device-specific, document in the PR why a shared change is not appropriate and keep this file as the only device-level override. Do not leave an unsynchronised full copy.

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


Grey Divider

Context sources
❌ Tickets: failed to load — Ticket collection could not establish complete evidence
✅ Context preparation
  Commit messages: summarized; full text retained for this review
Review mode: Auto: ⚖️ Balanced: New device profile touching boot-time WiFi, GPIO, module loading and PTZ scripts; too risky for lite.

Grey Divider

Tip of the day
💡 Did you know, you can hide the parts of a finding you never read, like the evidence or the agent prompt

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

This branch has not been deployed

No deployments
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