Skip to content

ak3918ev300l_lite_appix-sc03w: add the APPIX SC03-W - #269

Merged
openipc-ai merged 2 commits into
masterfrom
device/appix-sc03w
Nov 23, 2026
Merged

openipc-ai merged 2 commits into
masterfrom
device/appix-sc03w

Conversation

@openipc-ai

@openipc-ai openipc-ai commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

APPIX SC03-W (AK3918EV300L)

This adds the APPIX SC03-W: an AK3918EV300L camera with two SmartSens SC1346 behind one MIPI switch (separate lenses, the lower one on a pan/tilt head), 8 MB NOR, AltoBeam ATBM603x USB Wi-Fi, two GPIO steppers, IR and white lights, and a reset button. Its stock firmware is GZhongshi's. Everything below was worked out with the owner in OpenIPC/majestic#380.

What the profile sets

  • Kernel: the generic EV300L config with the ak3918ev300l-switch-sc1346 device tree (anyka: ak3918ev300l-switch-sc1346, two SC1346 behind one MIPI switch linux#305). That tree has the MIPI switch select on GPIO 17 and PWM0 on pad 16.
  • /etc/modprobe.d/anyka.conf: ak_isp in switch mode, and sensor_sc1346 with the two sensors at 0x32/0x31, as the stock vg_boot.sh loads them (anyka: majestic on the AK3918EV300L, and two sensors behind a MIPI switch firmware#2935).
  • Pan/tilt:
    • gpiostep on the stock tree's motor pins: pan 25, 24, 56, 55 and tilt 68, 58, 26, 27. It loads from /etc/modules; that two-parameter line needs overlay: S35modules passes each /etc/modules parameter as its own argument firmware#2937, which is merged.
    • /etc/gpiostep.conf holds what was measured on the camera: 1030 pan and 130 tilt steps, + pan left, + tilt up, 1 ms per pan step and 3 ms per tilt step.
    • majestic-af drives the head, and having it in the image also turns on the WebUI's pan/tilt pad.
  • Wi-Fi: its own wlandev, which powers the module from GPIO 70 (low is on) and loads the ATBM603x driver. The generic image's other USB Wi-Fi drivers and their firmware are left out.
  • customizer.sh: night mode on the pins from the stock factory_cfg.ini (IR-cut 65/66, IR LEDs 10, white light 9), and PTZ on.
  • gpio.conf: the stock pin map, with the reset button on 50.

Tested

  • Local build: against OpenIPC/firmware master, 6656K of 7616K.
  • qemu-bench ak3918ev300l: the image boots on the two-sensor tree, the customizer runs, and gpiostep loads with all eight pins.
  • The owner's camera, with this profile as test build 4 plus test majestic builds:
    • both sensors stream;
    • night mode works on these pins;
    • Wi-Fi works;
    • the head homes ("homed, centred at 515/65") and the WebUI arrows move it.

majestic

PTZ and automatic day/night on this camera also need a majestic for the AV100 family that loads the majestic-af plugin and reads the image processor's exposure state. The second one also shows up as isp_again, isp_avelum and isp_exposureismax on /metrics.

That majestic is merged, and the next nightly carries it. On the owner's camera, with the test builds in OpenIPC/majestic#380:

  • the head homes and the WebUI arrows move it;
  • covering the lens switches to night, and uncovering it back to day.

Kernel

The sub-millisecond step delays need OpenIPC/linux#317. On the AK3918AV100-family kernel, every sleep shorter than 10 ms used to wait a whole 10 ms tick. That made 200 pan steps take 16 s at any delay, and homing take four minutes. With that kernel fix, on the owner's camera, 200 steps take 1.78 s at 1 ms, and homing finishes in 50 s.

A build-one of this branch (nightly-bisect-997309d) already has the majestic it needs: the head homes, the arrows move it, and day/night switches. This stays a draft until OpenIPC/linux#317 is merged, then gets one more build-one.

@openipc-ai

Copy link
Copy Markdown
Contributor Author

build-one on this branch (997309d), built with a majestic that has the plugin support and the exposure reader: success, kernel headroom 366 KB, rootfs headroom 200 KB. https://github.com/OpenIPC/builder/actions/runs/45182489462 → release nightly-bisect-997309d-20261123131746. I've asked the owner to flash this exact image (OpenIPC/majestic#380); this stays a draft until the camera confirms it.

AK3918EV300L with two SmartSens SC1346 behind one MIPI switch (separate
lenses, the lower one on a pan/tilt head), 8 MB NOR, AltoBeam ATBM603x USB
Wi-Fi, two GPIO steppers, IR and white lights, reset button
(OpenIPC/majestic#380). Its stock firmware is GZhongshi's.

- Kernel: the generic EV300L config with the ak3918ev300l-switch-sc1346
  device tree (OpenIPC/linux#305): switch select on GPIO 17, PWM0 on pad 16.
- /etc/modprobe.d/anyka.conf: ak_isp in switch mode and sensor_sc1346 at
  0x32/0x31, as the stock vg_boot.sh loads them (OpenIPC/firmware#2935).
- Pan/tilt: gpiostep on the stock tree's motor0/motor1 pins,
  pan 25,24,56,55 and tilt 68,58,26,27, from /etc/modules (the two-parameter
  line needs OpenIPC/firmware#2937). /etc/gpiostep.conf has the travel,
  direction and speed measured on the camera: 1030 pan and 130 tilt steps,
  +pan left, +tilt up, 1 ms a pan step and 3 ms a tilt step (sub-tick
  delays need OpenIPC/linux#317). majestic-af drives it, which also turns
  on the WebUI's pan/tilt pad.
- Wi-Fi: its own wlandev, powering the module from GPIO 70 (low is on) and
  loading the ATBM603x driver; the generic image's other USB Wi-Fi drivers
  and firmware are left out.
- customizer.sh: night mode on the stock factory_cfg.ini pins (IR-cut 65/66,
  IR LEDs 10, white light 9, confirmed on the camera), PTZ on.
- gpio.conf: the stock pin map, with the reset button on 50.

Built against OpenIPC/firmware master with #2937's S35modules: 6656K of
7616K. On qemu-bench ak3918ev300l it boots on the two-sensor tree, the
customizer runs and gpiostep loads with its pins. Published as #380's test
build 4; not yet run on the camera.
@openipc-ai

Copy link
Copy Markdown
Contributor Author

OpenIPC/linux#317 is merged. build-one on this branch (b7190da): success, kernel headroom 366 KB, rootfs headroom 200 KB: https://github.com/OpenIPC/builder/actions/runs/45202832632 → release nightly-bisect-b7190da-20261123151344. The kernel in it has the timer fix: the old 120000-cycle minimum is no longer next to the 12 MHz rate in the decompressed image. Sent to the owner for a final check (OpenIPC/majestic#380).

@openipc-ai
openipc-ai marked this pull request as ready for review November 23, 2026 15:27
@qodo-free-for-open-source-projects

qodo-free-for-open-source-projects Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

PR Summary by Qodo

Add APPIX SC03-W AK3918EV300L device profile

✨ Enhancement ⚙️ Configuration changes 🕐 20-40 Minutes

Grey Divider

AI Description

• Add an 8 MB APPIX SC03-W image profile with switchable dual-SC1346 camera support.
• Configure pan/tilt, night lighting, reset button, and board-specific ATBM603x Wi-Fi.
• Enable Majestic PTZ controls and use measured motor travel, direction, and timing settings.
Merge Risk 🟢 Low

Blast radius 🟡 Medium 💥 4 capabilities

  • 4 affected capabilities within one bounded functional scope: appix_sc03w_device_integration.
  • The board DTB, kernel configuration, sensor modules, and streamer establish one end-to-end camera capture behavior.
  • These are implementation hops of the same capability, not separate functional scopes.
  • Wi-Fi power control, module loading, wlandev selection, and network use form one bounded board-specific wireless integration.
  • They produce one system outcome—network connectivity—and are not independent scopes merely because startup crosses script and kernel-module boundaries.
  • The GPIO module arguments, gpiostep calibration file, and Majestic/ONVIF/WebUI actuator settings jointly implement the single pan/tilt user outcome.
  • They are technical hops within the same bounded APPIX device integration.
  • The customizer's night-mode values and gpio.conf map implement one board-specific day/night control behavior.
  • This is distinct from PTZ because it changes optical filtering and illumination, but it remains within the same bounded device integration.
Sources

devices/ak3918ev300l_lite_appix-sc03w/general/overlay/etc/wireless/usb[5-10]

if [ "$1" = "atbm603x-ak3918ev300l-appix-sc03w" ]; then
	gpio clear 70 > /dev/null
	# The load's own result: S40network falls back to the wired port only
	# when this fails.
	modprobe atbm603x_wifi_usb 2>/dev/null || modprobe atbm603x_comb_wifi_usb
	exit $?
Behavioral complexity 🟢 Low 🧩 Straightforward

  • Before, this board had no image definition or runtime camera configuration in the repository.
  • After, the PR adds a direct board-to-DTB mapping and fixed module parameters using the existing Buildroot, kernel, and module-loading pipeline.
  • The new correctness condition is that the selected DTB, Anyka driver mode, and two sensor addresses agree for the intended camera streams; no new algorithm, concurrency protocol, or state machine is introduced.
Potential damage 🟡 Medium 🩹 Temporary loss

  • A bad board or sensor configuration can make video unavailable or leave a sensor unstreamed.
  • Recovery requires installing a corrected image or configuration; reverting code restores the expected configuration, and no persistent camera-state repair or external compensation is indicated.
  • Recoverable by reflashing or replacing the board configuration and rebooting.
  • The exact external kernel and consumer behavior is unavailable for verification.
Assessed commit b03cfd7
Diagram

graph TD
  A["Device profile"] --> B["Kernel and ISP"] --> C["Dual SC1346 sensors"]
  A --> D["Majestic configuration"] --> E["Pan tilt motors"]
  D --> F["Night lighting"]
  A --> G["Wi-Fi startup"] --> H["ATBM603x module"]
Loading
High-Level Assessment

A separate device profile is appropriate because the sensor switch, GPIO assignments, motor calibration, and Wi-Fi power sequence are board-specific. Reusing the generic EV300L kernel configuration while adding a small device-tree fragment avoids changing behavior for other cameras. Reviewers should confirm the referenced kernel timing fix is available before relying on the configured 1 ms pan delay.

Files changed (9) +181 / -0

Enhancement (1) +11 / -0
usbPower and load the ATBM603x Wi-Fi module +11/-0

Power and load the ATBM603x Wi-Fi module

• Recognizes the board-specific wireless device name, powers its USB radio through active-low GPIO 70, and attempts the available ATBM603x driver variants.

devices/ak3918ev300l_lite_appix-sc03w/general/overlay/etc/wireless/usb

Other (8) +170 / -0
ak3918ev300l-appix-sc03w.configSelect the switched dual-SC1346 device tree +1/-0

Select the switched dual-SC1346 device tree

• Adds a kernel configuration fragment selecting the APPIX SC03-W device tree.

devices/ak3918ev300l_lite_appix-sc03w/br-ext-chip-anyka/board/ak3918av100/ak3918ev300l-appix-sc03w.config

ak3918ev300l_lite_appix-sc03w_defconfigDefine the APPIX SC03-W Lite image +83/-0

Define the APPIX SC03-W Lite image

• Sets up the 8 MB Anyka build with the generic EV300L kernel, board device-tree fragment, vendor modules, and required camera, PTZ, Wi-Fi, WebUI, and reset-button packages. Leaves out unrelated generic USB Wi-Fi drivers.

devices/ak3918ev300l_lite_appix-sc03w/br-ext-chip-anyka/configs/ak3918ev300l_lite_appix-sc03w_defconfig

gpiostep.confCalibrate pan/tilt motion and homing +19/-0

Calibrate pan/tilt motion and homing

• Records measured pan and tilt travel, direction, and step delays for the majestic-af gpiostep actuator. Enables homing and centering at boot.

devices/ak3918ev300l_lite_appix-sc03w/general/overlay/etc/gpiostep.conf

anyka.confConfigure switched ISP and both sensor addresses +7/-0

Configure switched ISP and both sensor addresses

• Enables ISP multi-sensor switch mode and assigns the SC1346 sensors addresses 0x32 and 0x31. Also sets the EV300L USB host to CPU mode.

devices/ak3918ev300l_lite_appix-sc03w/general/overlay/etc/modprobe.d/anyka.conf

modulesLoad filesystem and dual-stepper modules +3/-0

Load filesystem and dual-stepper modules

• Loads vfat, exfat, and gpiostep with the board's eight pan/tilt GPIO pins.

devices/ak3918ev300l_lite_appix-sc03w/general/overlay/etc/modules

customizer.shApply board-specific Wi-Fi, lighting, and PTZ settings +42/-0

Apply board-specific Wi-Fi, lighting, and PTZ settings

• Sets the firmware upgrade URL and wireless device, maps night-mode lighting pins, and enables Majestic's gpiostep PTZ actuator. Supplies image orientation settings and PTZ capabilities needed by the WebUI.

devices/ak3918ev300l_lite_appix-sc03w/general/overlay/usr/share/openipc/customizer.sh

gpio.confMap the camera's controls and peripherals +13/-0

Map the camera's controls and peripherals

• Records the stock GPIO assignments for reset, IR-cut, LEDs, speaker, and USB power, including absent peripherals.

devices/ak3918ev300l_lite_appix-sc03w/general/overlay/usr/share/openipc/gpio.conf

ak3918ev300l_lite.listKeep the board's package exclusion list empty +2/-0

Keep the board's package exclusion list empty

• Documents that the defconfig already omits unrelated USB Wi-Fi drivers and firmware, so no further image exclusions are needed.

devices/ak3918ev300l_lite_appix-sc03w/general/scripts/excludes/ak3918ev300l_lite.list

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

qodo-free-for-open-source-projects Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

Code Review by Qodo

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

Grey Divider


Action required

1. README omits the new camera ✓ Resolved
Description
The PR adds the ak3918ev300l_lite_appix-sc03w device directory but leaves README.md unchanged,
and the 'List of known and supported devices' table has no APPIX SC03-W row (the only AK3918 entry
is the HeimVision PE3020-W at line 45). The new device therefore stays undocumented in the device
list until someone adds the row by hand.


Remediation recommended

2. The camera speaker stays unconfigured 🐞 Bug ≡ Correctness
Description
gpio.conf declares the speaker amplifier on GPIO 69, but customizer.sh never sets Majestic's
.audio.speakerPin to that pin. On this camera, the night-mode and pan/tilt pins are passed to
Majestic while the declared speaker pin is not, leaving speaker control without its device-specific
setting.
Code

devices/ak3918ev300l_lite_appix-sc03w/general/overlay/usr/share/openipc/gpio.conf[12]

+speaker=69
Evidence
The new pin map names GPIO 69 as the speaker pin, while the complete Majestic settings block omits
it. Another device profile explicitly configures .audio.speakerPin in its customizer.

devices/ak3918ev300l_lite_appix-sc03w/general/overlay/usr/share/openipc/gpio.conf[12-12]
devices/ak3918ev300l_lite_appix-sc03w/general/overlay/usr/share/openipc/customizer.sh[23-42]
devices/ssc325_lite_heimvision-hm202/general/overlay/usr/share/openipc/customizer.sh[40-40]

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 profile declares a speaker amplifier on GPIO 69 but does not pass that pin to Majestic.
## Fix Focus Areas
- devices/ak3918ev300l_lite_appix-sc03w/general/overlay/usr/share/openipc/customizer.sh[25-40]
- devices/ak3918ev300l_lite_appix-sc03w/general/overlay/usr/share/openipc/gpio.conf[12-12]
## Recommended Fix
Add `cli -s .audio.speakerPin 69` to the device customizer, following the pattern used by other speaker-equipped profiles.

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


3. Wi-Fi setup can report a failed load as success ✓ Resolved
Description
/etc/wireless/usb exits with status zero after its two modprobe attempts regardless of their
results. If neither ATBM603x module loads, the script reports successful setup even though it has
not loaded the driver needed for the camera's wireless interface.

Grey Divider

Tip of the day
💡 Did you know, you can keep summaries lean with Findings visible per group, which tucks the rest behind a View link

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

…load reports failure

Review of #269:
- README.md lists the APPIX SC03-W.
- /etc/wireless/usb exits with the module load's own status. S40network
  runs usb || sdio, then the modem, and only then falls back to DHCP on the
  wired port; an exit 0 after both ATBM603x loads failed sent it to ifup a
  wlan0 that does not exist.
@openipc-ai

Copy link
Copy Markdown
Contributor Author

On the Qodo review:

  1. README row: added in b03cfd7.
  2. Speaker pin: left out on purpose, so no change. The kernel's audio codec driver (8000000.adc_dac) already holds GPIO 69: /sys/kernel/debug/pinctrl/*/pinmux-pins lists the pad as its own. majestic for this SoC also has no audio path yet, so there is no amplifier for it to drive. gpio.conf records the stock pin map, speaker=69 included, as information for a later audio port.
  3. Wi-Fi exit status: fixed in b03cfd7. The script now exits with the module load's own status. S40network runs usb || sdio, then the modem, and only after that falls back to DHCP on the wired port. With the old exit 0, a failed load sent it to ifup a wlan0 that doesn't exist.

@openipc-ai
openipc-ai merged commit 383c0b2 into master Nov 23, 2026
7 checks passed
@openipc-ai
openipc-ai deleted the device/appix-sc03w branch November 23, 2026 15:47
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