Skip to content

Add hi3516dv100_lite_anxinshi-asrih698t (HI3516D_N81820 speed dome, Pelco-D pan/tilt) - #210

Merged
widgetii merged 1 commit into
masterfrom
hi3516dv100-anxinshi-asrih698t
Oct 22, 2026
Merged

widgetii merged 1 commit into
masterfrom
hi3516dv100-anxinshi-asrih698t

Conversation

@widgetii

Copy link
Copy Markdown
Member

Device profile for the Anxinshi ASRIH698T-020-20X speed dome: the XiongMai HI3516D_N81820 main board (hi3516dv100, IMX291 DC) in a 20x pan/tilt dome. From OpenIPC/firmware#2385.

Pan/tilt: a base MCU speaking Pelco-D, address 1, 9600 8N1, over RS-485 on UART1. The reporter drove it by hand on nightly-20261020-ef421c8 once OpenIPC/linux#111 enabled ttyAMA1. Their report: #2385 (comment). Pan left/right and tilt up/down all work.

muxes.sh runs on every boot, before majestic opens the port:

  • It puts UART1 RXD/TXD on their pads (IOCONFIG 0x7C/0x84 = 1).
  • It keeps the UART1_RTSN ball as GPIO9_2 (0x78 = 0) and drives it high. That pin is the transceiver's direction pin, which the stock firmware also drives. It resets low, which is receive, so nothing sent would reach the bus.
  • The registers come from the Hi3516A/D datasheet, table 2-48.

customizer.sh sets ptz_control=pelco-d, ptz_port=/dev/ttyAMA1, ptz_speed=9600, ptz_caps='pan tilt' and .ptz.enabled.

Differences from the sibling hi3516dv100_lite_xm-n81820 (the varifocal on the same board):

  • FLASH_SIZE="8". The dome boots the 8M layout (5120k rootfs, per its mtdparts in firmware#2219), and its chip size is unknown. The reporter has no UART, so the image must fit the partitions it already has.
  • The lens is not driven by majestic. majestic drives a single ptz.actuator, and here that is the pan/tilt head. The board's MS41908M zoom/focus would need majestic-af to drive two actuators at once, which is a separate change.

Local build (./builder.sh, firmware 020f895):

  • Image sizes: uImage 1815/2048 KB, rootfs.squashfs 4540/5120 KB.
  • The rootfs carries both scripts, majestic-af.so and the DC IMX291 sensor files.
  • The kernel's DTB has uart@20090000.
  • ci-matrix.py --self-test passes.

Not run on a camera as a whole image. The individual steps were run by hand by the reporter. The profile still needs a boot on the dome.

…elco-D pan/tilt)

The Anxinshi ASRIH698T-020-20X is the XiongMai HI3516D_N81820 main board in
a 20x pan/tilt dome. Its base MCU speaks Pelco-D, address 1, 9600 8N1, over
RS-485 on UART1, which the reporter of OpenIPC/firmware#2385 drove by hand
on nightly-20261020-ef421c8 once OpenIPC/linux#111 gave the board ttyAMA1.

muxes.sh repeats what the stock firmware does at every boot: UART1 RXD/TXD
on their pads, and the UART1_RTSN ball kept as GPIO9_2, the transceiver's
direction pin, driven high. It resets low, which is receive, and nothing
sent would reach the bus. customizer.sh points majestic's Pelco-D actuator
at ttyAMA1 at 9600 and narrows the WebUI pad to pan and tilt.

Cloned from hi3516dv100_lite_xm-n81820, the varifocal on the same board,
with two differences. FLASH_SIZE is 8: the dome boots the 8M layout
(5120k rootfs per its mtdparts in #2219) and its chip size is not known, so
a 16M image could not be written to it. And majestic drives one actuator,
which here is the pan/tilt head, so the MS41908M lens is not driven by
majestic on this image.
@qodo-free-for-open-source-projects

Copy link
Copy Markdown

PR Summary by Qodo

Add Anxinshi ASRIH698T 8M profile with Pelco-D pan/tilt

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

Grey Divider

AI Description

• Add an 8M firmware profile for the Anxinshi speed dome and its DC IMX291 sensor.
• Enable Pelco-D pan/tilt over UART1 by configuring the RS-485 pins and majestic.
• Document the device as testing; the complete image has not yet booted on the dome.
Diagram

graph TD
  Boot["Device boot"] --> Mux["Pin setup"] --> GPIO["Direction GPIO"] --> Bus["RS-485 bus"] --> MCU["Pan tilt MCU"]
  Boot --> Settings["Device settings"] --> Majestic["Majestic PTZ"] --> UART["UART1 port"] --> Bus
  Mux --> UART
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Extend the sibling board profile with runtime device detection
  • ➕ Could reduce duplicated build and sensor configuration.
  • ➖ The devices require different flash layouts and motor actuators.
  • ➖ Incorrect detection could select an image unsuitable for the dome's existing partitions.

Recommendation: Keep the separate profile: the 8M layout and Pelco-D head are device-specific despite the shared main board. Runtime selection would add risk without resolving the image-layout difference. Validate a full boot on the dome before treating the profile as supported.

Files changed (5) +155 / -0

Enhancement (1) +20 / -0
muxes.shPrepare UART1 and RS-485 transmit direction at boot +20/-0

Prepare UART1 and RS-485 transmit direction at boot

• Assigns UART1 RX/TX pads while retaining the RTSN ball as GPIO9_2. Configures that GPIO as an output and drives it high so Pelco-D commands can reach the RS-485 bus.

devices/hi3516dv100_lite_anxinshi-asrih698t/general/overlay/usr/share/openipc/muxes.sh

Documentation (1) +1 / -0
README.mdList the Anxinshi speed dome as testing +1/-0

List the Anxinshi speed dome as testing

• Adds the ASRIH698T to the device list with its HI3516DV100, IMX291, 8M NOR layout, and Pelco-D pan/tilt status.

README.md

Other (3) +134 / -0
hi3516dv100_lite_anxinshi-asrih698t_defconfigDefine the dome's 8M HI3516DV100 build +65/-0

Define the dome's 8M HI3516DV100 build

• Adds a lite Buildroot profile based on the sibling board's toolchain, kernel, filesystem, and package selection. Selects the 8M flash layout rather than the sibling's 16M layout.

devices/hi3516dv100_lite_anxinshi-asrih698t/br-ext-chip-hisilicon/configs/hi3516dv100_lite_anxinshi-asrih698t_defconfig

customizer.shConfigure the DC sensor and Pelco-D pan/tilt +42/-0

Configure the DC sensor and Pelco-D pan/tilt

• Selects the parallel IMX291 sensor configuration and device-specific upgrade URL. Enables majestic PTZ on /dev/ttyAMA1 at 9600 baud with pan/tilt capabilities; the SPI zoom/focus lens is not selected as its actuator.

devices/hi3516dv100_lite_anxinshi-asrih698t/general/overlay/usr/share/openipc/customizer.sh

hi3516dv100_lite.listExclude unused sensor assets from the lite image +27/-0

Exclude unused sensor assets from the lite image

• Removes unneeded sensor libraries and configuration files from the image, matching the sibling profile's exclusion list while retaining the DC IMX291 assets.

devices/hi3516dv100_lite_anxinshi-asrih698t/general/scripts/excludes/hi3516dv100_lite.list

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

qodo-free-for-open-source-projects Bot commented Oct 22, 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. The dome image cannot initialize video 🐞 Bug ≡ Correctness
Description
The new exclude list removes /usr/lib/sensors/libsns_imx291.so even though customizer.sh selects
the IMX291 sensor and its DC configuration. When the rootfs is assembled, the selected sensor
library is deleted, leaving Majestic without that sensor backend on the dome.
Code

devices/hi3516dv100_lite_anxinshi-asrih698t/general/scripts/excludes/hi3516dv100_lite.list[6]

+/usr/lib/sensors/libsns_imx291.so
Evidence
The customizer selects IMX291 and its DC configuration, while the added exclude entry names the
IMX291 shared library. The repository documents that exclude-list paths are deleted from the rootfs;
this profile supplies no replacement sensor library in its overlay.

devices/hi3516dv100_lite_anxinshi-asrih698t/general/overlay/usr/share/openipc/customizer.sh[16-20]
devices/hi3516dv100_lite_anxinshi-asrih698t/general/scripts/excludes/hi3516dv100_lite.list[6-6]
CLAUDE.md[64-67]

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 dome selects IMX291 for video but its exclude list deletes the IMX291 sensor library from the rootfs.
## Fix Focus Areas
- devices/hi3516dv100_lite_anxinshi-asrih698t/general/scripts/excludes/hi3516dv100_lite.list[5-7]
- devices/hi3516dv100_lite_anxinshi-asrih698t/general/overlay/usr/share/openipc/customizer.sh[16-20]
## Recommended Fix
Remove the IMX291 library from this profile's exclude list and verify that the resulting image retains the library needed by the selected sensor configuration.

ⓘ 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 ask Qodo to dismiss a finding you disagree with, with your reason on record

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

@widgetii
widgetii merged commit e642e22 into master Oct 22, 2026
7 checks passed
@widgetii
widgetii deleted the hi3516dv100-anxinshi-asrih698t branch October 22, 2026 18:07
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