Skip to content

nt98566_lite_xm-rm1: add the XM IPC-RM1-BLK562 (NT98566 + SC501AI, ATBM6062 USB Wi-Fi, pan/tilt) - #297

Open
Simi541 wants to merge 1 commit into
OpenIPC:masterfrom
Simi541:nt98566-xm-rm1
Open

Simi541 wants to merge 1 commit into
OpenIPC:masterfrom
Simi541:nt98566-xm-rm1

Conversation

@Simi541

@Simi541 Simi541 commented Dec 4, 2026

Copy link
Copy Markdown

Adds nt98566_lite_xm-rm1: the XM pan/tilt dome board IPC-RM1-BLK562-M335-MINI-ETH V1.02 (sold as Loosafe). NT98566 + SmartSens SC501AI, 16 MB NOR (XM FM25Q128A), AltoBeam ATBM6062 Wi-Fi 6 on USB. Stock firmware General_IPC_NT98566_N8-WQ_S38 (product IPG-N8-WQ-BL).

It starts from nt98566_lite_xm-ivg-n8s: the same 8 MB lite layout, with the SC501AI kept and the IMX415 dropped in the excludes list.

What changes

  • Wi-Fi: BR2_PACKAGE_ATBM606X_OPENIPC=y, wlandev atbm606x-generic-usb. The stock firmware loads atbm6062u.ko wifi_bt_comb=1 from loadpublic. Following the Yoton WS03 profile, a kernel fragment turns off the kernel's cfg80211/mac80211 (the package brings its own) and keeps WIRELESS_EXT by building R8712U (CONFIG_STAGING=y). The excludes list then drops r8712u.ko. USB host has been in nt98566.generic.config since nt9856x: USB host in the kernel configs firmware#3038.

  • Night mode: confirmed on the board with the Day / Night pin map on a generic nt98566_lite image:

    • IR-cut: one pad, 225 (DSI 1), LOW at night → irCutSingleInvert: true
    • IR lamp 232 (DSI 8), white lamp 233 (DSI 9), both lit HIGH
    • photocell 231 (DSI 7), HIGH when dark

    The wiki's IVG-N8S row has the photocell and white lamp the other way round.

  • Pan/tilt: ptz_control gpio, ptz_gpio '230 229 228 227 66 67 234 224'. These come from the stock XmMotor gpio_pin=0x76,0x75,0x74,0x73,0x22,0x23,0x7A,0x70, which packs XM's group << 4 | pin, with group 7 = DSI and group 2 = S. In kernel numbers that is DSI_GPIO(n) = 0xE0 + n and S_GPIO(n) = 0x40 + n (gpio-nvt-na51089, base 0).

  • README row.

Status

  • Video: OK on the generic nt98566_lite image.
  • Night-mode pins: confirmed on hardware as listed above.
  • Not yet run on hardware: this image itself, Wi-Fi, pan/tilt phase order and direction, and whether the Wi-Fi module needs a power GPIO (the stock XmWlanDaemon has one, kept in an encrypted config). The image size against the 5 MB lite rootfs is also unchecked. I'll flash the CI build and report back here.
  • lightSensorInvert is left at its default for now; it will be set from the camera's saved config in a follow-up.

.github/scripts/ci-matrix.py --self-test passes, and the change narrows the matrix to this one device.

🤖 Generated with Claude Code

https://claude.ai/code/session_01LNoep3b7y4pGrqdg7ZUyks

…h ATBM6062 USB Wi-Fi

XM pan/tilt dome board IPC-RM1-BLK562-M335-MINI-ETH V1.02 (sold as Loosafe),
16 MB NOR, stock firmware General_IPC_NT98566_N8-WQ_S38. Built on the IVG-N8S
profile: the same 8 MB lite layout, the SC501AI kept and the IMX415 dropped.

- Wi-Fi: atbm606x-openipc for the on-board ATBM6062 on USB (the stock
  firmware loads atbm6062u.ko), with a kernel fragment that turns off the
  kernel's cfg80211/mac80211 and keeps wireless extensions via R8712U, as on
  the Yoton WS03. USB host is in the generic config since OpenIPC/firmware#3038.
- Night mode, confirmed on the board with the Day / Night pin map: single-pad
  IR-cut 225 (LOW at night), IR lamp 232, white lamp 233, photocell 231.
- Pan/tilt: GPIO steppers 230 229 228 227 / 66 67 234 224, from the stock
  loadpublic XmMotor line; not yet run on hardware.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LNoep3b7y4pGrqdg7ZUyks
@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

nt98566_lite_xm-rm1: add XM IPC-RM1-BLK562 (NT98566, SC501AI, ATBM6062 Wi-Fi)

✨ Enhancement ⚙️ Configuration changes 🕐 20-40 Minutes

Grey Divider

AI Description

• Adds the XM IPC-RM1-BLK562 board (NT98566, SC501AI) as a new nt98566_lite_xm-rm1 device profile.
• Enables ATBM6062 USB Wi-Fi via atbm606x-openipc, with a kernel fragment replacing the kernel
 cfg80211/mac80211 stack.
• Sets night-mode pins and pan/tilt GPIO steppers from the stock firmware; Wi-Fi, pan/tilt and this
 image are not yet tested on hardware.
Merge Risk 🟡 Medium

Blast radius 🟡 Medium 💥 4 capabilities

  • 4 affected capabilities within one bounded functional scope: nt98566_xm_rm1_device_firmware.
  • The defconfig, kernel fragment, and ATBM6062 package jointly produce one board image whose end-to-end outcome is booting this camera and providing its USB Wi-Fi path; these are implementation hops within the same device firmware integration.
  • PTZ movement and night-mode actuation are distinct user-visible operations but both are board-specific runtime controls configured by this same camera integration and share the same GPIO-oriented functional boundary.
  • Selecting the board-specific upgrade artifact is an independent user-visible update outcome within the same device firmware integration; it is not a separate deployment topology.
  • The exclusion list and sensor package selection jointly affect the single end-to-end SC501AI video-capture behavior; removed alternative sensor assets are not independent affected capabilities because they are not selected for this board.
Sources

devices/nt98566_lite_xm-rm1/general/overlay/usr/share/openipc/customizer.sh[35-48]

# Night mode, confirmed on this board with the Day / Night pin map: the IR-cut
# filter is a single pad (DSI 1, LOW at night), the IR lamp DSI 8 and the white
# lamp DSI 9 (both lit HIGH), the photocell DSI 7 (HIGH when dark). The XM
# IVG-N8S table in the wiki has the photocell and white lamp the other way
# round.
#
cli -s .nightMode.irCutPin1 225
cli -s .nightMode.irCutSingleInvert true
cli -s .nightMode.backlightPin 232
cli -s .nightMode.whiteLightPin 233
cli -s .nightMode.lightMonitor true
cli -s .nightMode.lightSensorPin 231

exit 0

devices/nt98566_lite_xm-rm1/general/scripts/excludes/nt98566_lite.list[1-4]

# The board's sensor is the SC501AI: every other sensor's files go.
/etc/sensors/imx415.yaml
/etc/sensors/os05a10.yaml
/etc/sensors/sc401ai.yaml

devices/nt98566_lite_xm-rm1/br-ext-chip-novatek/board/nt9856x/nt98566-xm-rm1.config[1-11]

# atbm606x-openipc builds its own cfg80211.ko and mac80211.ko, with the same
# names and exports as the kernel's, so the kernel's are off.
# CONFIG_CFG80211 is not set
# CONFIG_MAC80211 is not set
# That cfg80211 still calls the kernel's wireless-extensions core
# (wireless_send_event), and WIRELESS_EXT is a hidden symbol only a driver
# can select. R8712U is the one on this kernel that needs nothing but WLAN and
# USB (ZD1201 needs CFG80211); it lives in staging, which the generic config
# leaves off. Its module is dropped from the image by the excludes list.
CONFIG_STAGING=y
CONFIG_R8712U=m

devices/nt98566_lite_xm-rm1/br-ext-chip-novatek/configs/nt98566_lite_xm-rm1_defconfig[47-56]

# The chip is 16 MB (XM FM25Q128A), but this is the 8 MB NOR layout on purpose:
# it is firmware's nt98566_lite layout, the one the owner's camera runs
# today, and the rest of the chip is rootfs_data. The 16 MB layout is a
# different partition table and has not been tried on this board.
BR2_OPENIPC_FLASH_SIZE="8"

# Packages
# Wi-Fi: the on-board AltoBeam ATBM6062 on USB, which the stock firmware drives
# with atbm6062u.ko (insmod atbm6062u.ko wifi_bt_comb=1 in its loadpublic).
BR2_PACKAGE_ATBM606X_OPENIPC=y
Behavioral complexity 🟡 Medium 🧩 Compatibility cases

  • Before: the generic NT98566 configuration supplied the kernel wireless stack.
  • After: this board disables kernel cfg80211/mac80211, relies on ATBM606X replacements, and enables a staging module solely to select WIRELESS_EXT.
  • New correctness condition: the replacement modules, hidden Kconfig dependency, USB host support, and image exclusions must remain compatible across the build and boot transition.
Sources

devices/nt98566_lite_xm-rm1/br-ext-chip-novatek/board/nt9856x/nt98566-xm-rm1.config[1-11]

# atbm606x-openipc builds its own cfg80211.ko and mac80211.ko, with the same
# names and exports as the kernel's, so the kernel's are off.
# CONFIG_CFG80211 is not set
# CONFIG_MAC80211 is not set
# That cfg80211 still calls the kernel's wireless-extensions core
# (wireless_send_event), and WIRELESS_EXT is a hidden symbol only a driver
# can select. R8712U is the one on this kernel that needs nothing but WLAN and
# USB (ZD1201 needs CFG80211); it lives in staging, which the generic config
# leaves off. Its module is dropped from the image by the excludes list.
CONFIG_STAGING=y
CONFIG_R8712U=m
Potential damage 🟡 Medium 🩹 Temporary loss

  • If the new image configuration regresses, this board may fail to boot or lose USB Wi-Fi.
  • Reverting the image definition and rebuilding restores future images; a flashed device needs reflashing, but no persistent application data is implicated by the source inspected.
  • Reflashing a known-good image is supported by the repository workflow; no automatic repair path was verified.
Sources

devices/nt98566_lite_xm-rm1/br-ext-chip-novatek/board/nt9856x/nt98566-xm-rm1.config[1-11]

# atbm606x-openipc builds its own cfg80211.ko and mac80211.ko, with the same
# names and exports as the kernel's, so the kernel's are off.
# CONFIG_CFG80211 is not set
# CONFIG_MAC80211 is not set
# That cfg80211 still calls the kernel's wireless-extensions core
# (wireless_send_event), and WIRELESS_EXT is a hidden symbol only a driver
# can select. R8712U is the one on this kernel that needs nothing but WLAN and
# USB (ZD1201 needs CFG80211); it lives in staging, which the generic config
# leaves off. Its module is dropped from the image by the excludes list.
CONFIG_STAGING=y
CONFIG_R8712U=m

devices/nt98566_lite_xm-rm1/br-ext-chip-novatek/configs/nt98566_lite_xm-rm1_defconfig[47-56]

# The chip is 16 MB (XM FM25Q128A), but this is the 8 MB NOR layout on purpose:
# it is firmware's nt98566_lite layout, the one the owner's camera runs
# today, and the rest of the chip is rootfs_data. The 16 MB layout is a
# different partition table and has not been tried on this board.
BR2_OPENIPC_FLASH_SIZE="8"

# Packages
# Wi-Fi: the on-board AltoBeam ATBM6062 on USB, which the stock firmware drives
# with atbm6062u.ko (insmod atbm6062u.ko wifi_bt_comb=1 in its loadpublic).
BR2_PACKAGE_ATBM606X_OPENIPC=y
Assessed commit d66ceac
Diagram

graph TD
  A["nt98566_lite_xm-rm1 defconfig"] --> B["Kernel config fragment"] --> C["Kernel cfg80211 off"]
  A --> D["atbm606x-openipc Wi-Fi"]
  C --> E["R8712U keeps WIRELESS_EXT"]
  A --> F["Excludes list"]
  A --> G["customizer.sh"]
  G --> H["Night mode and pan/tilt"]
Loading
High-Level Assessment

The PR follows the Yoton WS03 pattern for Wi-Fi, which is a reasonable choice. Enabling the kernel's cfg80211 would clash with the package's same-named modules, and WIRELESS_EXT is hidden, so a driver has to select it. R8712U is the only option here that needs just WLAN and USB. Keeping the 8 MB lite layout is deliberate: it is the layout the owner's camera already runs, and the 16 MB table is untested. Hardware testing of Wi-Fi, pan/tilt and the image should come before merge, since those are the largest unverified parts.

Files changed (5) +176 / -0

Documentation (1) +1 / -0
README.mdAdd XM IPC-RM1-BLK562 row to the device table +1/-0

Add XM IPC-RM1-BLK562 row to the device table

• Adds a supported-devices row for the NT98566 + SC501AI board with ATBM6062 Wi-Fi, marked as testing with the video, IR-cut, lamps and photocell pins confirmed. Wi-Fi and pan/tilt are listed as untested.

README.md

Other (4) +175 / -0
nt98566-xm-rm1.configKernel fragment replacing cfg80211/mac80211 and enabling R8712U +11/-0

Kernel fragment replacing cfg80211/mac80211 and enabling R8712U

• Turns off the kernel's CFG80211 and MAC80211 so atbm606x-openipc can supply its own. Sets CONFIG_STAGING=y and CONFIG_R8712U=m so WIRELESS_EXT is selected, since no other option works on this kernel.

devices/nt98566_lite_xm-rm1/br-ext-chip-novatek/board/nt9856x/nt98566-xm-rm1.config

nt98566_lite_xm-rm1_defconfigNew NT98566 lite defconfig for the XM RM1 board +76/-0

New NT98566 lite defconfig for the XM RM1 board

• Defines the board's toolchain, kernel with the custom config and fragment, 8 MB lite flash layout and package set. Enables ATBM606X_OPENIPC for Wi-Fi, along with the Majestic, Novatek SDK and motors packages.

devices/nt98566_lite_xm-rm1/br-ext-chip-novatek/configs/nt98566_lite_xm-rm1_defconfig

customizer.shFirst-boot settings for Wi-Fi, night mode and pan/tilt +48/-0

First-boot settings for Wi-Fi, night mode and pan/tilt

• Sets wlandev to atbm606x-generic-usb and the GPIO stepper pins for pan/tilt. Configures night-mode IR-cut, lamp and photocell pins with the pin map confirmed on the board. Sets the upgrade URL.

devices/nt98566_lite_xm-rm1/general/overlay/usr/share/openipc/customizer.sh

nt98566_lite.listExclude non-SC501AI sensor files and the unused r8712u module +40/-0

Exclude non-SC501AI sensor files and the unused r8712u module

• Removes sensor configs and modules for every sensor except SC501AI from the image. Also drops r8712u.ko, which is built only to pull in WIRELESS_EXT and is not loaded at runtime.

devices/nt98566_lite_xm-rm1/general/scripts/excludes/nt98566_lite.list

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

Copy link
Copy Markdown

Code Review by Qodo

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

Grey Divider


Remediation recommended

1. Flash size set to 8 MB on a 16 MB board 📘 Rule violation ≡ Correctness 2
Description
BR2_OPENIPC_FLASH_SIZE is set to 8, so the image is built for the 8 MB NOR layout, while the
README row and the PR description both say this board has 16 MB NOR (XM FM25Q128A). The comment
justifies the choice as keeping the lite layout the owner's camera already runs, but the rule
requires the flash size to match the target. The image will not use the chip's extra 8 MB, and the
16 MB layout has not been tried on this board.
Code

devices/nt98566_lite_xm-rm1/br-ext-chip-novatek/configs/nt98566_lite_xm-rm1_defconfig[R47-51]

+# The chip is 16 MB (XM FM25Q128A), but this is the 8 MB NOR layout on purpose:
+# it is firmware's nt98566_lite layout, the one the owner's camera runs
+# today, and the rest of the chip is rootfs_data. The 16 MB layout is a
+# different partition table and has not been tried on this board.
+BR2_OPENIPC_FLASH_SIZE="8"
Evidence
The defconfig selects an 8 MB flash size, which the rule's failure criteria names as a mismatch,
while the README row and the PR description both record the board as 16 MB NOR. The comment
documents the choice as deliberate, so this is a remediation item rather than a clear defect.

Rule 2: Match Device Defconfig to the Target Hardware
devices/nt98566_lite_xm-rm1/br-ext-chip-novatek/configs/nt98566_lite_xm-rm1_defconfig[47-51]
README.md[143-143]

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 defconfig for `nt98566_lite_xm-rm1` sets `BR2_OPENIPC_FLASH_SIZE="8"`, but the board uses a 16 MB NOR chip (XM FM25Q128A), as the README row and PR description state. The rule requires the flash size to match the target hardware.

## Fix Focus Areas
- devices/nt98566_lite_xm-rm1/br-ext-chip-novatek/configs/nt98566_lite_xm-rm1_defconfig[47-51]
- README.md[143-143]

## Recommended Fix
Either set `BR2_OPENIPC_FLASH_SIZE` to the 16 MB value and verify the 16 MB partition layout builds and boots on this board, or keep the 8 MB layout and state the deliberate mismatch in the README row and the defconfig comment, with the reason and the condition for changing it. Choose one and make the defconfig comment and the README agree.

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


Grey Divider

Context sources
Review mode: Auto: ⚖️ Balanced: Hardware-specific configuration and runtime settings carry substantial but localized risk.

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

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