Files
actionkamera/OPENIPC.md
T
BRNSystemsandClaude Opus 5.5 497c0758cc Research notes: hardware, flash layout, rooting
Notes on the AK3918AV130/SC3332 Tuya camera derived from a flash dump:
SoC, U-Boot, 8 MiB NOR layout, the three anti-root locks and how to get a
root shell. Boot logs are redacted (MAC addresses, device-derived AP name).
The dump itself is never committed (.gitignore): CONFIG holds per-device
Tuya keys.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 22:01:43 +01:00

6.6 KiB

Flashing OpenIPC on the AK3918AV130

Reality check first. The port you found — DavidL54/OpenIPC-firmware-Anyka — is an experimental research handoff, not a product. Its own docs state: a public source checkout "cannot currently reproduce a complete bootable image," it deliberately ships no one-command NOR installer, and the build needs the proprietary AnyCloud SDK (AnyCloud39AV130_SDK_V1.03) plus the OpenIPC musl toolchain. So today you cannot "download and flash" OpenIPC here — you build it, and some pieces (the Anyka ISP/encoder runtime) depend on that closed SDK.

This doc gives the honest state, the correct method for when you have an image, and how to do it safely with the toolkit/ in this repo. Your rooted local image (toolkit/out/camera_flash_local.bin) already works today; treat OpenIPC as the next milestone.


1. There is a defconfig for your exact SoC

br-ext-chip-anyka/configs/ak3918av130_lite_defconfig targets AK3918AV130 (family ak3918ev300, 8 MiB, squashfs-xz root) and pulls in Majestic (the OpenIPC streamer, local RTSP), Dropbear SSH, wpa_supplicant, wireless_tools, mbedTLS, curl, and the ANYKA_OSDRV_AK3918AV130 SDK package. It reuses the stock Anyka kernel, DTB, and U-Boot.

Verify your unit matches before trusting any build: sensor SC3332, Wi-Fi AltoBeam ATBM6x6x (USB). If a future OpenIPC build assumes a different sensor or an EV300 kernel, it will not work as-is.

2. OpenIPC's flash layout ≠ your stock layout

OpenIPC-Anyka uses a different NOR map than your camera (from their flash-layout.md):

Offset Size Role
mtd0 0x000000 256K bootloader + env
mtd1 0x040000 64K DTB
mtd2 0x050000 ~1.75M stock kernel
mtd3 0x210000 ~960K rootfs (squashfs)
mtd4 0x300000 ~4.6M app fs
mtd5 0x7a0000 384K config (jffs2)

Your stock map (see README.md §1) puts UBOOT+ENV+ENVBK in the first 0x34000, kernel at 0x44000, rootfs at 0x1c4000. Adopting OpenIPC's full image means adopting its layout, which on your unit means updating mtdparts in U-Boot (one saveenv) so the kernel sees the new partitions. Keep UBOOT, ENV, DTB, and the kernel for this architecture — those are the "deployment contract."

3. Building OpenIPC (standard OpenIPC flow)

git clone https://github.com/DavidL54/OpenIPC-firmware-Anyka firmware
cd firmware
make BOARD=ak3918av130_lite        # defconfig = ak3918av130_lite_defconfig
# output lands in: output/images/   (uImage, rootfs.squashfs, etc.)

Anyka-specific extras this fork needs (from its build.md), which upstream boards don't:

  • OpenIPC musl toolchain at e.g. /opt/anyka-toolchain/bin/arm-openipc-linux-musleabi-*
  • the closed SDK checked out at the project root as AnyCloud39AV130_SDK_V1.03
  • the native gateway / busybox helpers:
    export CC=/opt/anyka-toolchain/bin/arm-openipc-linux-musleabi-gcc
    python3 native-gateway/build.py --output out/native-gateway
    python3 internal-firmware/build-busybox.py --source /opt/sources/busybox-1.36.1.tar.bz2 --output out/busybox
    
  • build-images.py (the full-image packager) needs private stock inputs + manifest pins and, per the project, cannot complete from a clean public checkout yet.

So expect to finish with partition artifacts (a rootfs.squashfs, maybe an app fs), not a ready 8 MiB blob.

4. Flashing method — use this repo's toolkit

Whatever OpenIPC artifacts you end up with, flash them the same way as everything else here: keep stock UBOOT/ENV/DTB/KERNEL, replace ROOTFS (+ app), then assemble an 8 MiB image and write it.

cd toolkit

# 1. Back up (you already have camera_flash.bin — keep it).
#    If the chip ever changed, re-dump and re-split:
#    ./split.sh current_dump.bin parts/openipc

# 2. Start from stock parts, drop in the OpenIPC rootfs (and app):
cp parts/stock/*.bin parts/openipc/ 2>/dev/null; mkdir -p parts/openipc
cp /path/to/openipc/output/images/rootfs.squashfs parts/openipc/rootfs.bin
#    (if OpenIPC also produces an app fs, put it in parts/openipc/app.bin)

# 3. Describe OpenIPC's layout in a layout file (copy layout.conf, edit offsets/sizes
#    to match §2 — especially the bigger KERNEL/ROOTFS slots), then assemble:
LAYOUT=layout-openipc.conf ./build-image.sh parts/openipc out/camera_flash_openipc.bin

# 4. Flash it (same as README §8):
flashrom -p ch341a_spi -w out/camera_flash_openipc.bin

If OpenIPC's rootfs is larger than your stock ROOTFS slot (likely — Majestic + Dropbear), you must use OpenIPC's layout (bigger mtd2/mtd3) and set mtdparts in U-Boot:

=> setenv mtdparts 'mtdparts=spi-nor:<openipc partitions...>'
=> saveenv
=> reset

The OpenIPC-Anyka doc warns its deployment "never runs saveenv" — that's about not disturbing their baked contract. On your stock camera, mtdparts lives in the U-Boot env and saveenv is the correct, intended way to change it. It's reversible: you have camera_flash.bin, and the SPI programmer is your recovery path.

5. Safe-install checklist (from OpenIPC's own guidance)

  1. Identify the unit live: cat /proc/mtd, cat /proc/cpuinfo, uname -a, sensor, Wi-Fi.
  2. Back up: full dump + per-partition, with sizes/hashes. Confirm a recovery route (programmer) before writing.
  3. Test from RAM/SD first if possible — don't commit to NOR until the OpenIPC userland runs and streams.
  4. Only change rootfs/app. Keep bootloader, env, DTB, kernel.
  5. Read back and verify the programmed chip against the padded image.
  6. Cold-boot and observe on serial; keep the programmer attached until it's proven.

6. Recovery

Bad flash → no network, maybe no boot. Recovery is always the SPI programmer:

flashrom -p ch341a_spi -w camera_flash.bin      # restore your original dump

You still have U-Boot on serial as long as UBOOT/ENV aren't corrupted; if the kernel or rootfs is bad, U-Boot's => prompt lets you re-flash via Y-modem (loady → sf write, see README §8B). This is why you keep UBOOT/ENV untouched whenever possible.


  1. Now: flash toolkit/out/camera_flash_local.bin → rooted, Tuya-free, on your Wi-Fi, telnet + serial shell, 2.9 MB writable DATA. Fully working today.
  2. Next: stand up the OpenIPC toolchain + SDK and build the ak3918av130_lite target; test its rootfs from the DATA partition / RAM before committing.
  3. Then: assemble an OpenIPC image with toolkit/ using OpenIPC's layout and flash it for local RTSP via Majestic — no Tuya, no cloud.