From d66ceacddcf30b4e6ddbda73413beef99f26baa7 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 4 Dec 2026 23:14:39 +0200 Subject: [PATCH 1/2] nt98566_lite_xm-rm1: add the XM IPC-RM1-BLK562, NT98566 + SC501AI with 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 Claude-Session: https://claude.ai/code/session_01LNoep3b7y4pGrqdg7ZUyks --- README.md | 1 + .../board/nt9856x/nt98566-xm-rm1.config | 11 +++ .../configs/nt98566_lite_xm-rm1_defconfig | 76 +++++++++++++++++++ .../overlay/usr/share/openipc/customizer.sh | 48 ++++++++++++ .../scripts/excludes/nt98566_lite.list | 40 ++++++++++ 5 files changed, 176 insertions(+) create mode 100644 devices/nt98566_lite_xm-rm1/br-ext-chip-novatek/board/nt9856x/nt98566-xm-rm1.config create mode 100644 devices/nt98566_lite_xm-rm1/br-ext-chip-novatek/configs/nt98566_lite_xm-rm1_defconfig create mode 100755 devices/nt98566_lite_xm-rm1/general/overlay/usr/share/openipc/customizer.sh create mode 100644 devices/nt98566_lite_xm-rm1/general/scripts/excludes/nt98566_lite.list diff --git a/README.md b/README.md index 62d122a8f..f16910df1 100644 --- a/README.md +++ b/README.md @@ -140,6 +140,7 @@ ZTE K545 T31X SC4336 ATBM6012B_USB NOR_16M done XM IPG-G3-WR GK7202V300 JXH63 ATBM60321S_USB NOR_8M done XM G2-WR-V (TFT robot) GK7201V300 JXH63P SSV6020_SDIO NOR_8M in progress, untested on hardware: LCD via openipc-spilcd, pan/tilt and IR-cut via mx2208a (motors) XM IPC-RM1-BLK7202V3 GK7202V300 SC223A SV6115C/8188EUS NOR_8M video-yes, wifi-yes (ssv6x5x#1), pan/tilt-yes, ir+audio untested +XM IPC-RM1-BLK562 NT98566 SC501AI ATBM6062_USB NOR_16M testing: video-ok, ircut+lamps+photocell pins confirmed on generic nt98566_lite, wifi+pan/tilt untested, this image untested ``` diff --git a/devices/nt98566_lite_xm-rm1/br-ext-chip-novatek/board/nt9856x/nt98566-xm-rm1.config b/devices/nt98566_lite_xm-rm1/br-ext-chip-novatek/board/nt9856x/nt98566-xm-rm1.config new file mode 100644 index 000000000..475d37b61 --- /dev/null +++ b/devices/nt98566_lite_xm-rm1/br-ext-chip-novatek/board/nt9856x/nt98566-xm-rm1.config @@ -0,0 +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 diff --git a/devices/nt98566_lite_xm-rm1/br-ext-chip-novatek/configs/nt98566_lite_xm-rm1_defconfig b/devices/nt98566_lite_xm-rm1/br-ext-chip-novatek/configs/nt98566_lite_xm-rm1_defconfig new file mode 100644 index 000000000..65830490b --- /dev/null +++ b/devices/nt98566_lite_xm-rm1/br-ext-chip-novatek/configs/nt98566_lite_xm-rm1_defconfig @@ -0,0 +1,76 @@ +# Architecture +BR2_arm=y +BR2_cortex_a9=y +BR2_ARM_ENABLE_NEON=y +BR2_ARM_ENABLE_VFP=y +BR2_ARM_FPU_VFPV3=y +BR2_ARM_INSTRUCTIONS_THUMB2=y + +# Toolchain +BR2_TOOLCHAIN_EXTERNAL=y +BR2_TOOLCHAIN_EXTERNAL_CUSTOM=y +BR2_TOOLCHAIN_EXTERNAL_DOWNLOAD=y +BR2_TOOLCHAIN_EXTERNAL_URL="https://github.com/openipc/firmware/releases/download/$(OPENIPC_TOOLCHAIN).tgz" +BR2_TOOLCHAIN_EXTERNAL_CUSTOM_PREFIX="arm-openipc-linux-musleabihf" +BR2_TOOLCHAIN_EXTERNAL_HEADERS_4_19=y +BR2_TOOLCHAIN_EXTERNAL_CUSTOM_MUSL=y +BR2_TOOLCHAIN_EXTERNAL_CXX=y + +# Kernel +BR2_LINUX_KERNEL=y +BR2_LINUX_KERNEL_CUSTOM_TARBALL=y +BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION="https://github.com/openipc/linux/archive/$(OPENIPC_KERNEL).tar.gz" +BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y +BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="$(EXTERNAL_VENDOR)/board/$(OPENIPC_SOC_FAMILY)/nt98566.generic.config" +# The generic NT98566 kernel (USB host since OpenIPC/firmware#3038) without its +# own cfg80211/mac80211, which atbm606x-openipc brings itself. +BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="$(EXTERNAL_VENDOR)/board/$(OPENIPC_SOC_FAMILY)/nt98566-xm-rm1.config" +BR2_LINUX_KERNEL_UIMAGE=y +BR2_LINUX_KERNEL_XZ=y + +# Filesystem +BR2_PACKAGE_BUSYBOX_CONFIG="$(BR2_EXTERNAL)/package/busybox/busybox.config" +BR2_PACKAGE_UBOOT_TOOLS=y +BR2_PACKAGE_ZLIB=y +# BR2_PACKAGE_IFUPDOWN_SCRIPTS is not set +BR2_PACKAGE_WIREGUARD_LINUX_COMPAT=y +BR2_PACKAGE_WIREGUARD_TOOLS=y +BR2_TARGET_ROOTFS_CPIO=y +BR2_TARGET_ROOTFS_SQUASHFS=y +BR2_TARGET_ROOTFS_SQUASHFS4_XZ=y + +# OpenIPC +BR2_OPENIPC_SOC_VENDOR="novatek" +BR2_OPENIPC_SOC_MODEL="nt98566" +BR2_OPENIPC_SOC_FAMILY="nt9856x" +BR2_OPENIPC_VARIANT="lite" +# 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 +BR2_PACKAGE_DROPBEAR_OPENIPC=y +BR2_PACKAGE_IPCTOOL=y +BR2_PACKAGE_LIBCURL_OPENIPC=y +BR2_PACKAGE_LIBCURL_OPENIPC_CURL=y +# BR2_PACKAGE_LIBCURL_OPENIPC_PROXY_SUPPORT is not set +# BR2_PACKAGE_LIBCURL_OPENIPC_COOKIES_SUPPORT is not set +# BR2_PACKAGE_LIBCURL_OPENIPC_EXTRA_PROTOCOLS_FEATURES is not set +BR2_PACKAGE_LIBEVENT_OPENIPC=y +BR2_PACKAGE_LIBOGG_OPENIPC=y +BR2_PACKAGE_MAJESTIC_FONTS=y +BR2_PACKAGE_MAJESTIC_WEBUI=y +BR2_PACKAGE_MAJESTIC=y +BR2_PACKAGE_MBEDTLS_OPENIPC=y +BR2_PACKAGE_MOTORS=y +BR2_PACKAGE_NOVATEK_OSDRV_NT9856X=y +BR2_PACKAGE_NOVATEK_OPENSDK=y +BR2_PACKAGE_OPUS_OPENIPC=y +BR2_PACKAGE_OPUS_OPENIPC_FIXED_POINT=y +BR2_PACKAGE_VTUND_OPENIPC=y +BR2_PACKAGE_YAML_CLI=y diff --git a/devices/nt98566_lite_xm-rm1/general/overlay/usr/share/openipc/customizer.sh b/devices/nt98566_lite_xm-rm1/general/overlay/usr/share/openipc/customizer.sh new file mode 100755 index 000000000..71d7d48b1 --- /dev/null +++ b/devices/nt98566_lite_xm-rm1/general/overlay/usr/share/openipc/customizer.sh @@ -0,0 +1,48 @@ +#!/bin/sh +# +# Perform basic settings on a known IP camera +# +# XM board IPC-RM1-BLK562-M335-MINI-ETH V1.02 (NT98566 + SC501AI, 16 MB NOR, +# AltoBeam ATBM6062 Wi-Fi 6 on USB), pan/tilt dome sold as Loosafe. Stock +# firmware General_IPC_NT98566_N8-WQ_S38 (product IPG-N8-WQ-BL). +# +# GPIO numbers are the kernel's (gpio-nvt-na51089, base 0): C_GPIO 0x00, +# P 0x20, S 0x40, L 0x60, D 0x80, H 0xA0, A 0xC0, DSI 0xE0, plus the pin. +# +# +# Set custom upgrade url +# +fw_setenv upgrade 'https://github.com/OpenIPC/builder/releases/download/latest/nt98566_lite_xm-rm1-nor.tgz' +# +# +# Set wlan device and credentials if need +# +fw_setenv wlandev atbm606x-generic-usb +#fw_setenv wlanssid Router +#fw_setenv wlanpass 12345678 +# +# Pan/tilt: two unipolar steppers straight from GPIO, pan coils first, then +# tilt. Stock loadpublic: XmMotor gpio_pin=0x76,0x75,0x74,0x73,0x22,0x23,0x7A,0x70 +# x_stepmax=8388 y_stepmax=1438, packed as XM's group << 4 | pin with group 7 +# the DSI pads and group 2 the S pads. +# +fw_setenv ptz_control gpio +fw_setenv ptz_gpio '230 229 228 227 66 67 234 224' +fw_setenv ptz_caps 'pan tilt' +# +# Set majestic settings +# +# 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 diff --git a/devices/nt98566_lite_xm-rm1/general/scripts/excludes/nt98566_lite.list b/devices/nt98566_lite_xm-rm1/general/scripts/excludes/nt98566_lite.list new file mode 100644 index 000000000..7b97b0393 --- /dev/null +++ b/devices/nt98566_lite_xm-rm1/general/scripts/excludes/nt98566_lite.list @@ -0,0 +1,40 @@ +# 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 +/etc/sensors/sc430ai.yaml +/etc/sensors/sen_imx415.cfg +/etc/sensors/sen_os05a10.cfg +/etc/sensors/sen_sc200ai.cfg +/etc/sensors/sen_sc2232h.cfg +/etc/sensors/sen_sc2239.cfg +/etc/sensors/sen_sc2335.cfg +/etc/sensors/sen_sc3335.cfg +/etc/sensors/sen_sc401ai.cfg +/etc/sensors/sen_sc4210.cfg +/etc/sensors/sen_sc4238.cfg +/etc/sensors/sen_sc430ai.cfg +/etc/sensors/sen_sc4335p.cfg +/etc/sensors/sen_sc450ai.cfg +/etc/sensors/sen_sc500ai.cfg +/etc/sensors/sen_sc8238.cfg +# +/etc/sensors/profiles/isp_imx415_0.cfg +/etc/sensors/profiles/isp_imx415_1.cfg +/etc/sensors/profiles/isp_sc2239_0.cfg +/etc/sensors/profiles/isp_sc2239_1.cfg +/etc/sensors/profiles/isp_sc401ai_0.cfg +/etc/sensors/profiles/isp_sc401ai_1.cfg +/etc/sensors/profiles/isp_sc430ai_0.cfg +/etc/sensors/profiles/isp_sc430ai_1.cfg +/etc/sensors/profiles/isp_sc4335p_0.cfg +/etc/sensors/profiles/isp_sc4335p_1.cfg +# +/lib/modules/4.19.91/novatek/nvt_sen_imx415.ko +/lib/modules/4.19.91/novatek/nvt_sen_sc401ai.ko +/lib/modules/4.19.91/novatek/nvt_sen_sc430ai.ko +/lib/modules/4.19.91/novatek/nvt_sen_sc500ai.ko +# +# Built only so its Kconfig selects WIRELESS_EXT for atbm606x-openipc's +# cfg80211 (see the kernel config fragment); nothing loads it. +/lib/modules/4.19.91/kernel/drivers/staging/rtl8712/r8712u.ko From 8712c11e59a0ca2f9b2b4cdc1919d12f7cfc3764 Mon Sep 17 00:00:00 2001 From: AI Dev Date: Sat, 5 Dec 2026 12:48:27 +0000 Subject: [PATCH 2/2] nt98566_ultimate_xm-rm1: ultimate on the board's 16 MB, split layout The flash is 16 MB, so the profile is ultimate rather than lite on the 8 MB layout: majestic ultimate with the NPU's object detector (nvtnpu-models), LAME, exFAT and ZeroTier, as firmware's nt98566 ultimate carries them, but on NOR. majestic-af is left out: the lens is fixed. The image is packaged with post-image-split.sh and the kernel read size firmware's nt98566_lite uses since the split move (OpenIPC/firmware#3049), so OpenIPC's Novatek U-Boot, which scans only up to 0x400000, boots it. The directory, defconfig, exclude list and upgrade URL follow the new name. --- .../board/nt9856x/nt98566-xm-rm1.config | 0 .../nt98566_ultimate_xm-rm1_defconfig} | 22 ++++++++++++++----- .../overlay/usr/share/openipc/customizer.sh | 2 +- .../scripts/excludes/nt98566_ultimate.list} | 0 4 files changed, 17 insertions(+), 7 deletions(-) rename devices/{nt98566_lite_xm-rm1 => nt98566_ultimate_xm-rm1}/br-ext-chip-novatek/board/nt9856x/nt98566-xm-rm1.config (100%) rename devices/{nt98566_lite_xm-rm1/br-ext-chip-novatek/configs/nt98566_lite_xm-rm1_defconfig => nt98566_ultimate_xm-rm1/br-ext-chip-novatek/configs/nt98566_ultimate_xm-rm1_defconfig} (75%) rename devices/{nt98566_lite_xm-rm1 => nt98566_ultimate_xm-rm1}/general/overlay/usr/share/openipc/customizer.sh (97%) rename devices/{nt98566_lite_xm-rm1/general/scripts/excludes/nt98566_lite.list => nt98566_ultimate_xm-rm1/general/scripts/excludes/nt98566_ultimate.list} (100%) diff --git a/devices/nt98566_lite_xm-rm1/br-ext-chip-novatek/board/nt9856x/nt98566-xm-rm1.config b/devices/nt98566_ultimate_xm-rm1/br-ext-chip-novatek/board/nt9856x/nt98566-xm-rm1.config similarity index 100% rename from devices/nt98566_lite_xm-rm1/br-ext-chip-novatek/board/nt9856x/nt98566-xm-rm1.config rename to devices/nt98566_ultimate_xm-rm1/br-ext-chip-novatek/board/nt9856x/nt98566-xm-rm1.config diff --git a/devices/nt98566_lite_xm-rm1/br-ext-chip-novatek/configs/nt98566_lite_xm-rm1_defconfig b/devices/nt98566_ultimate_xm-rm1/br-ext-chip-novatek/configs/nt98566_ultimate_xm-rm1_defconfig similarity index 75% rename from devices/nt98566_lite_xm-rm1/br-ext-chip-novatek/configs/nt98566_lite_xm-rm1_defconfig rename to devices/nt98566_ultimate_xm-rm1/br-ext-chip-novatek/configs/nt98566_ultimate_xm-rm1_defconfig index 65830490b..e9d7242b9 100644 --- a/devices/nt98566_lite_xm-rm1/br-ext-chip-novatek/configs/nt98566_lite_xm-rm1_defconfig +++ b/devices/nt98566_ultimate_xm-rm1/br-ext-chip-novatek/configs/nt98566_ultimate_xm-rm1_defconfig @@ -43,19 +43,21 @@ BR2_TARGET_ROOTFS_SQUASHFS4_XZ=y BR2_OPENIPC_SOC_VENDOR="novatek" BR2_OPENIPC_SOC_MODEL="nt98566" BR2_OPENIPC_SOC_FAMILY="nt9856x" -BR2_OPENIPC_VARIANT="lite" -# 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" +BR2_OPENIPC_VARIANT="ultimate" +# 16 MB NOR (XM FM25Q128A). Ultimate, since the flash leaves room for it: majestic +# ultimate with the NPU's object detector (nvtnpu-models), LAME, +# exFAT and ZeroTier, on the split NOR layout. +BR2_OPENIPC_FLASH_SIZE="16" +BR2_OPENIPC_MAJESTIC="ultimate" # 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 BR2_PACKAGE_DROPBEAR_OPENIPC=y +BR2_PACKAGE_EXFAT_OPENIPC=y BR2_PACKAGE_IPCTOOL=y +BR2_PACKAGE_LAME_OPENIPC=y BR2_PACKAGE_LIBCURL_OPENIPC=y BR2_PACKAGE_LIBCURL_OPENIPC_CURL=y # BR2_PACKAGE_LIBCURL_OPENIPC_PROXY_SUPPORT is not set @@ -70,7 +72,15 @@ BR2_PACKAGE_MBEDTLS_OPENIPC=y BR2_PACKAGE_MOTORS=y BR2_PACKAGE_NOVATEK_OSDRV_NT9856X=y BR2_PACKAGE_NOVATEK_OPENSDK=y +BR2_PACKAGE_NVTNPU_MODELS=y BR2_PACKAGE_OPUS_OPENIPC=y BR2_PACKAGE_OPUS_OPENIPC_FIXED_POINT=y BR2_PACKAGE_VTUND_OPENIPC=y BR2_PACKAGE_YAML_CLI=y +BR2_PACKAGE_ZEROTIER_ONE=y +BR2_ROOTFS_POST_IMAGE_SCRIPT="$(BR2_EXTERNAL_GENERAL_PATH)/scripts/post-image-split.sh" +# OpenIPC's Novatek U-Boot reads the kernel for the size its layout scan +# finds (the uImage up to the squashfs), not a fixed 2 MiB slot. Its +# published builds scan only up to 0x400000, so the squashfs, and with it +# the uImage's end, has to start below that for them to boot the image. +BR2_OPENIPC_NOR_KERNEL_READ_SIZE=0x3B0000 diff --git a/devices/nt98566_lite_xm-rm1/general/overlay/usr/share/openipc/customizer.sh b/devices/nt98566_ultimate_xm-rm1/general/overlay/usr/share/openipc/customizer.sh similarity index 97% rename from devices/nt98566_lite_xm-rm1/general/overlay/usr/share/openipc/customizer.sh rename to devices/nt98566_ultimate_xm-rm1/general/overlay/usr/share/openipc/customizer.sh index 71d7d48b1..cdb9a93a5 100755 --- a/devices/nt98566_lite_xm-rm1/general/overlay/usr/share/openipc/customizer.sh +++ b/devices/nt98566_ultimate_xm-rm1/general/overlay/usr/share/openipc/customizer.sh @@ -12,7 +12,7 @@ # # Set custom upgrade url # -fw_setenv upgrade 'https://github.com/OpenIPC/builder/releases/download/latest/nt98566_lite_xm-rm1-nor.tgz' +fw_setenv upgrade 'https://github.com/OpenIPC/builder/releases/download/latest/nt98566_ultimate_xm-rm1-nor.tgz' # # # Set wlan device and credentials if need diff --git a/devices/nt98566_lite_xm-rm1/general/scripts/excludes/nt98566_lite.list b/devices/nt98566_ultimate_xm-rm1/general/scripts/excludes/nt98566_ultimate.list similarity index 100% rename from devices/nt98566_lite_xm-rm1/general/scripts/excludes/nt98566_lite.list rename to devices/nt98566_ultimate_xm-rm1/general/scripts/excludes/nt98566_ultimate.list