ipctool not working on Victure PC420
Hello,
I have a Victure PC420 camera and I already got telnet and ftp working on it. On the camera I tried to collect Information with the ipctool, but it seems not to work.
When I type in ./ipctool the output is nothing
When I type in ./ipctool -h the output is the "Usage" text.
output from dmesg on the camera:
Booting Linux on physical CPU 0
Linux version 3.4.35 (zhout@apemans_server) (gcc version 4.8.5 (anyka (gcc-4.8.5 + binutils-2.24 + ulcibc-0.9.33.2)(20170223)) ) #9 Thu Feb 25 11:45:35 UTC 2021
CPU: ARM926EJ-S [41069265] revision 5 (ARMv5TEJ), cr=00053177
CPU: VIVT data cache, VIVT instruction cache
Machine: CLOUD39EV3_AK3918EV300_MNBD
Memory policy: ECC disabled, Data cache writeback
ANYKA CPU AK3918 (ID 0x20160100)
On node 0 totalpages: 9472
free_area_init_node: node 0, pgdat c03e9084, node_mem_map c0411000
Normal zone: 74 pages used for memmap
Normal zone: 0 pages reserved
Normal zone: 9398 pages, LIFO batch:1
pcpu-alloc: s0 r0 d32768 u32768 alloc=1*32768
pcpu-alloc: [0] 0
Built 1 zonelists in Zone order, mobility grouping on. Total pages: 9398
Kernel command line: console=ttySAK0,115200n8 root=/dev/mtdblock4 rootfstype=squashfs init=/sbin/init mem=64M memsize=64M
PID hash table entries: 256 (order: -2, 1024 bytes)
Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
Memory: 37MB = 37MB total
Memory: 33276k/33276k available, 4612k reserved, 0K highmem
Virtual kernel memory layout:
vector : 0xffff0000 - 0xffff1000 ( 4 kB)
fixmap : 0xfff00000 - 0xfffe0000 ( 896 kB)
vmalloc : 0xc2800000 - 0xff000000 ( 968 MB)
lowmem : 0xc0000000 - 0xc2500000 ( 37 MB)
modules : 0xbf000000 - 0xc0000000 ( 16 MB)
.text : 0xc0008000 - 0xc03a8000 (3712 kB)
.init : 0xc03a8000 - 0xc03c3000 ( 108 kB)
.data : 0xc03c4000 - 0xc03e9f58 ( 152 kB)
.bss : 0xc03e9f7c - 0xc040aee8 ( 132 kB)
SLUB: Genslabs=13, HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
NR_IRQS:117
sched_clock: 32 bits at 12MHz, resolution 83ns, wraps every 357913ms
AK39 console driver initial
console [ttySAK0] enabled
Calibrating delay loop... 199.06 BogoMIPS (lpj=995328)
pid_max: default: 32768 minimum: 301
Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: ok
Setting up static identity map for 0x81ddbdf0 - 0x81ddbe48
devtmpfs: initialized
NET: Registered protocol family 16
On-chip L2 memory initialized
AK39 clocks: CPU 400MHz, MEM 400MHz, ASIC 120MHz
Anyka platform share gpio locks initialize.
bio: create slab <bio-0> at 0
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
i2c-ak39 i2c-ak39: Unable to achieve desired frequency 300KHz. Lowest achievable 312KHz
i2c-ak39 i2c-ak39: i2c-0: AK39 I2C adapter
Linux video capture interface: v2.00
cfg80211: Calling CRDA to update world regulatory domain
Switching to clocksource ak_timer5 cs
NET: Registered protocol family 2
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
TCP established hash table entries: 2048 (order: 2, 16384 bytes)
TCP bind hash table entries: 2048 (order: 1, 8192 bytes)
TCP: Hash tables configured (established 2048 bind 2048)
TCP: reno registered
UDP hash table entries: 256 (order: 0, 4096 bytes)
UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
NET: Registered protocol family 1
RPC: Registered named UNIX socket transport module.
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
RPC: Registered tcp NFSv4.1 backchannel transport module.
squashfs: version 4.0 (2009/01/31) Phillip Lougher
exFAT: Version 1.2.9
jffs2: version 2.2. © 2001-2006 Red Hat, Inc.
msgmni has been set to 64
io scheduler noop registered
io scheduler cfq registered (default)
AK39xx uart driver init, (c) 2013 ANYKA
ak39-uart.0: ttySAK0 at MMIO 0x20130000 (irq = 10) is a AK39
ion: failed to create debug files.
brd: module loaded
loop: module loaded
@@@ [akpcm_init]: enter @@@
@@@ [akpcm_probe]: enter @@@
akpcmL0->ak39_codec_probe enter...
@@@ [akpcm_probe:357]: akpcm initialize OK! @@@
@@@ [set_channel_source:105]: addr=2, src=2 @@@
@@@ [set_channel_source:153]: src=2, s_dac=0, s_linein=0, s_mic=1 @@@
akpcm probe: mic on
akpcm_probe: OK
akisp_init
Start to init Anyka SPI Flash...
Start to init Anyka partition table...
AK SPI Driver, (c) 2012 ANYKA
akpi regs: SPICON:00000152, SPISTA:00000015, SPIINT:00000000.
ak-spi ak-spi: master is unqueued, this is deprecated
ak_spi setup the master.
pre-scaler=2 (wanted 20Mhz, got 20Mhz)
ak spiflash probe enter.
pre-scaler=2 (wanted 20Mhz, got 20Mhz)
ak_spi_setupxfer,con:00000252.
akspi flash ID: 0x00c84017
akspi flash VERSION: 0x53
ak-spiflash spi0.0: gd25q64 (8192 Kbytes)
FHA:partition lib version: V1.1.06
FHA:spiflash init
FHA:boot block num offset:427
FHA:Sflash_Get_Partition_Startpage g_boot_len:880
mtd_part[0]:
name = KERNEL
size = 0x200000
offset = 0x39000
mask_flags = 0x1
mtd_part[1]:
name = MAC
size = 0x1000
offset = 0x239000
mask_flags = 0x1
mtd_part[2]:
name = ENV
size = 0x1000
offset = 0x23a000
mask_flags = 0x1
mtd_part[3]:
name = A
size = 0x180000
offset = 0x23b000
mask_flags = 0x1
mtd_part[4]:
name = B
size = 0x7d000
offset = 0x3bb000
mask_flags = 0x1
mtd_part[5]:
name = C
size = 0x3b6000
offset = 0x438000
mask_flags = 0x1
Creating 6 MTD partitions on "spi0.0":
0x000000039000-0x000000239000 : "KERNEL"
0x000000239000-0x00000023a000 : "MAC"
0x00000023a000-0x00000023b000 : "ENV"
0x00000023b000-0x0000003bb000 : "A"
0x0000003bb000-0x000000438000 : "B"
0x000000438000-0x0000007ee000 : "C"
Init AK SPI Flash finish.
akspi master initialize success, use for DMA mode.
input: akgpio-keys as /devices/platform/akgpio-keys/input/input0
We're Using Internal RC OSC.
AK RTC, (c) 2010 ANYKA
i2c /dev entries driver
AK MCI Driver (c) 2010 ANYKA
akmci_probe : MCI
## MMC Power: GPIO-1 Setup
akmci ak_mci.0: Mci Interface driver.mmc0. using l2dma, sw IRQ. detect mode:GPIO detect.
akmci_probe : SDIO
## MMC Power: GPIO-1 Setup
mmc0: host does not support reading read-only switch. assuming write-enable.
mmc0: new SDHC card at address b368
mmcblk0: mmc0:b368 SMI 14.9 GiB
mmcblk0: p1
akmci ak_sdio.1: Mci Interface driver.mmc1. using l2dma, hw IRQ. detect mode:plugin alway.
Registered led device: system_state_led
Registered led device: red_led
Registered led device: blue_led
TCP: cubic registered
NET: Registered protocol family 17
lib80211: common routines for IEEE802.11 drivers
lib80211_crypt: registered algorithm 'NULL'
/home/zhout/nooie/nooie_ipc_code_base/kernel/drivers/rtc/hctosys.c: unable to open rtc device (rtc0)
VFS: Mounted root (squashfs filesystem) readonly on device 31:4.
devtmpfs: mounted
Freeing init memory: 108K
aksensor_module_init
soc-camera-pdrv soc-camera-pdrv: Probing soc-camera-pdrv
ak_camera ak_camera.39: AK Camera driver attached to camera 0
f22_set_power_on
f22_probe_id id:0xf37
f22_probe_id id:0xf37
aksensor 0-0001: probe_sensors Probing Sensor ID: 0xf37
ak_camera ak_camera.39: AK Camera driver detached from camera 0
ak_camera ak_camera.39: AK Camera driver loaded
ak_info_dump_init
Nothing is wrong with your setup — ipctool simply does not know your SoC.
Your dmesg says it plainly:
Machine: CLOUD39EV3_AK3918EV300_MNBD
ANYKA CPU AK3918 (ID 0x20160100)
Anyka is not among the vendors ipctool can detect. Today that list is HiSilicon (and Goke), Xiongmai XM510, SigmaStar/MStar, Ingenic, Novatek, Fullhan, Grain Media, Rockchip, Allwinner, Broadcom, Xilinx and Tegra.
Why you get nothing rather than an error
Detection first reads the UART0 base address out of /proc/iomem to recognise HiSilicon/Goke/XM by register base, and otherwise matches the Hardware line of /proc/cpuinfo against a vendor table. An Anyka matches neither, so getchipname() returns NULL, and the report builder returns an empty tree — the program prints nothing and exits with status 1 (./ipctool; echo $? will show 1).
-h works because printing the usage text touches no hardware. The same wall stops the subcommands too: ipctool i2cget … or ipctool i2cdetect will print Unknown chip.
So: a missing platform, not a bug in your camera or your telnet setup. The silent exit is confusing and worth improving on our side.
What your dmesg already tells us about the PC420
- SoC: Anyka AK3918EV300, ARM926EJ-S (ARMv5TEJ), CPU 400 MHz / DDR 400 MHz / ASIC 120 MHz
- RAM: 64 MB total, 37 MB handed to Linux — the rest is reserved for the video pipeline
- Flash: SPI NOR, 8 MB, partitions
KERNEL@0x39000 (2 MB),MAC,ENV,A(1.5 MB),B,C; squashfs root on/dev/mtdblock4 - Sensor: the line
f22_probe_id id:0xf37is the SOI/JX family — product id0x0f, version0x37, i.e. a JX-F37 oni2c-0. That is exactly what ipctool's SOI probe would report (JXF37) if it could get that far. - Firmware: Linux 3.4.35 built from a Nooie code base (
/home/zhout/nooie/nooie_ipc_code_base/…in the kernel paths), Anyka gcc 4.8.5 + uClibc 0.9.33.2
If you would like Anyka support
It is a contained piece of work: a detect function that recognises the chip and fills the chip name/generation, a setup_hal_anyka() that installs I2C and register access, and one row in the vendor table. The useful dumps from a root shell on the camera are:
cat /proc/cpuinfo
cat /proc/iomem
cat /proc/mtd
cat /proc/meminfo
ls -l /dev/i2c-* /dev/mem
cat /proc/device-tree/model 2>/dev/null
/proc/iomem is the important one — it tells us where the sysctl block lives, which is where that ID 0x20160100 the kernel prints comes from, and that register is what a detect function would read.
Also note that on this kernel (3.4.35) /dev/mem access may be restricted by CONFIG_STRICT_DEVMEM; if it is, part of what ipctool reports would stay out of reach even after Anyka detection is added. Quick check on the camera:
zcat /proc/config.gz | grep DEVMEM # if the kernel exports its config
and, using any peripheral base address from /proc/iomem (for example the i2c-ak39 one), a read of that address that comes back Operation not permitted is the tell.
Closing this one as not planned: the Anyka AK3918EV300 has no HAL in ipctool, and nobody is working on adding one, so there is nothing here that a fix would land against.
What did come out of it: as of 0b2263a ipctool no longer exits silently on hardware it cannot identify — it says what failed and shows the inputs it looked at, so the next person on an unsupported SoC learns that in one run instead of assuming a broken binary. That reaches the next latest build.
If you would like Anyka support to happen, post cat /proc/iomem from a root shell on the camera (plus /proc/cpuinfo and /proc/mtd) and I will reopen — that dump is the missing piece, since it locates the register behind the ID 0x20160100 the kernel prints, which is what a detect function would read. Meanwhile the hardware notes from your dmesg stand: Anyka AK3918EV300, ARM926EJ-S at 400 MHz, 64 MB RAM with 37 MB to Linux, 8 MB SPI NOR, and an SOI JX-F37 sensor on i2c-0.
Hello,
Thanks for the explanation. Your latest built of IPCtool works now with this output:
[root@anyka /mnt]$ ./ipctool ipctool: SoC not recognised, no hardware report possible. no UART0 entry in /proc/iomem no vendor matches /proc/cpuinfo: CLOUD39EV3_AK3918EV300_MNBD Run it as root on the camera. If this is an IP camera or DVR, please report the SoC with the output of 'cat /proc/cpuinfo; cat /proc/iomem; dmesg | head -40' at https://github.com/OpenIPC/ipctool/issues
Here is the Output you were asking for:
[root@anyka ~]$ cat /proc/cpuinfo Processor : ARM926EJ-S rev 5 (v5l) BogoMIPS : 199.06 Features : swp half fastmult edsp java CPU implementer : 0x41 CPU architecture: 5TEJ CPU variant : 0x0 CPU part : 0x926 CPU revision : 5
Hardware : CLOUD39EV3_AK3918EV300_MNBD Revision : 0000 Serial : 0000000000000000 [root@anyka ~]$ cat /proc/iomem 08000000-0800ffff : akpcm_AnalogCtrlRegs 20000000-2000004c : isp_char 20020000-2002ffff : video-base 20100000-20100043 : ak_mci.0 20100000-20100043 : ak_mci 20108000-20108043 : ak_sdio.1 20108000-20108043 : ak_sdio 20110000-2011800f : akpcm_ADC2ModeCfgRegs 20120000-20120027 : ak-spi 20120000-20120027 : ak-spi 20150000-20150100 : i2c-ak39 20150000-20150100 : i2c-ak39 20180000-20180067 : ak-crypto 20200000-202003ff : usb-host 20200000-202003ff : ak-hsudc 81b00000-83ffffff : System RAM 81b08000-81ea7fff : Kernel code 81ec4000-81f0aee7 : Kernel data [root@anyka ~]$ cat /proc/mtd dev: size erasesize name mtd0: 00800000 00001000 "spi0.0" mtd1: 00200000 00001000 "KERNEL" mtd2: 00001000 00001000 "MAC" mtd3: 00001000 00001000 "ENV" mtd4: 00180000 00001000 "A" mtd5: 0007d000 00001000 "B" mtd6: 003b6000 00001000 "C" [root@anyka ~]$ cat /proc/meminfo MemTotal: 33384 kB MemFree: 292 kB Buffers: 2172 kB Cached: 9496 kB SwapCached: 0 kB Active: 16968 kB Inactive: 5944 kB Active(anon): 11460 kB Inactive(anon): 0 kB Active(file): 5508 kB Inactive(file): 5944 kB Unevictable: 216 kB Mlocked: 0 kB SwapTotal: 0 kB SwapFree: 0 kB Dirty: 192 kB Writeback: 0 kB AnonPages: 11488 kB Mapped: 3196 kB Shmem: 0 kB Slab: 5760 kB SReclaimable: 2648 kB SUnreclaim: 3112 kB KernelStack: 896 kB PageTables: 312 kB NFS_Unstable: 0 kB Bounce: 0 kB WritebackTmp: 0 kB CommitLimit: 16692 kB Committed_AS: 72184 kB VmallocTotal: 991232 kB VmallocUsed: 31080 kB VmallocChunk: 742596 kB [root@anyka ~]$ ls -l /dev/i2c-* /dev/mem crw-rw---- 1 root root 89, 0 Jan 1 1970 /dev/i2c-0 crw-r----- 1 root 9 1, 1 Jan 1 1970 /dev/mem [root@anyka ~]$ cat /proc/device-tree/model 2>/dev/null [root@anyka ~]$ zcat /proc/config.gz | grep DEVMEM # if the kernel exports its config -sh: zcat: not found
Reopened, and that dump was exactly the missing piece — thank you. Anyka support is up as #217.
Your /proc/iomem settled the question I could not answer from the dmesg alone. The ID 0x20160100 the kernel prints comes from the first word of the system controller, and the block you dumped at 08000000-0800ffff : akpcm_AnalogCtrlRegs is it — the audio driver claims the surrounding 64 KB, which is why nothing in the list is called "sysctrl". AK_PA_SYSCTRL is 0x08000000 in every AK37/AK39 memory map, and the chip ID sits at offset 0.
Two things the dump also decided:
- The register cannot name the part. A vendor kernel compares it against one constant chosen by its
CONFIG_CPU_AK39xxand prints whichever name it was built for, so the same0x20160100is announced as AK3916, AK3918 and AK3919 by three different source trees. So the part number comes from yourHardwareline (CLOUD39EV3_AK3918EV300_MNBD→AK3918EV300) and the register only names the generation. That also means detection no longer depends on/dev/memat all, so it still works if this kernel turns out to filter it. - Your RAM split is now reportable.
memsize=64Mfrom the cmdline is the real DRAM size, andSystem RAM 81b00000-83ffffffis the 37 MB the kernel got — so 27 MB is held for the ISP and encoder, and that is what theram:section will say.
Sensor addresses came from the vendor's own drivers, including SOI at 0x80, which is where your JX-F37 lives.
Once #217 lands, the rolling latest prerelease picks it up and you can pull a fresh ipctool from there. When you run it, could you post the full output? Two parts I would especially like to see:
- the
chip:section — that is the whole point of the change; - the
sensors:section, once with the camera application running and once with it stopped. The Anyka camera controller gates the sensor's clock, so the JX-F37 may only answer on I2C while the vendor app has the pipeline up. If it comes back empty with the app stopped, that tells me a sensor-clock hook is needed, and I would much rather learn that from your camera than guess at register writes on hardware I cannot test.
Nobody here has an Anyka camera, so everything in #217 is grounded in vendor kernel sources and your dumps, with an off-hardware test over the parsing. Your run is the part that turns it from plausible into verified.
Merged as 664ac91. The latest prerelease is rebuilding from it now, so within a few minutes https://github.com/OpenIPC/ipctool/releases/tag/latest will carry an ipctool with Anyka support — grab the plain ipctool asset, that is the arm32 build and it runs on your ARM926EJ-S.
GitHub closed this issue automatically off the commit, which is right in the sense that the fix has shipped. But the part that matters to me is still open: none of it has run on an Anyka camera. Everything in there is derived from vendor kernel sources and your dumps. So please do post what you get — I will reopen without hesitation if anything is off.
What I am hoping to see:
- The whole
ipctooloutput, but especially thechip:section. It should nameAK3918EV300, familyak3918ev300, and echo the0x20160100your kernel prints. - The
ram:section — I expecttotal: 64Mandmedia: 27M, the latter being the part of your 64 MB the boot loader keeps for the ISP and encoder. - The
sensors:section twice: once with the camera application running, once with it stopped. This is the real unknown. The Anyka camera controller gates the sensor's clock, so your JX-F37 may only answer on I2C while the vendor app has the pipeline up. If it shows up in one case and not the other, that is a concrete thing to fix rather than something I would have to guess at.
If it still prints nothing at all, that would mean the machine-string match missed, and cat /proc/cpuinfo | grep Hardware plus the exact output would tell me why in one line.
Thanks for coming back with the dumps — that is what made this possible at all.
The latest ipctool gives no output, I have to close it via control + c
following output is even with or without app open: [root@anyka /mnt]$ ./ipctool ^C [root@anyka /mnt]$ ./ipctool -c ak3918ev300 [root@anyka /mnt]$ ./ipctool -s jxf37_i2c [root@anyka /mnt]$ ./ipctool -t Temperature cannot be retrieved [root@anyka /mnt]$
By the way,
there is no arm32 build in the release, there is only ipctool, ipctool-arm64 and ipctool-mips32
I have used ipctool (without anything)
here is the output to cpuinfo:
[root@anyka /mnt]$ cat /proc/cpuinfo | grep Hardware Hardware : CLOUD39EV3_AK3918EV300_MNBD
Sorry, I gave the tool some time and it succeeded! Here is the Output:
[root@anyka /mnt]$ cat /proc/cpuinfo Processor : ARM926EJ-S rev 5 (v5l) BogoMIPS : 199.06 Features : swp half fastmult edsp java CPU implementer : 0x41 CPU architecture: 5TEJ CPU variant : 0x0 CPU part : 0x926 CPU revision : 5
Hardware : CLOUD39EV3_AK3918EV300_MNBD Revision : 0000 Serial : 0000000000000000 [root@anyka /mnt]$ ./ipctool
chip: vendor: Anyka model: AK3918EV300 family: ak3918ev300 id: 0x20160100 ethernet: mac: "34:20:03:86:ea:1e" rom:
- type: nor
block: 4K
partitions:
- name: spi0.0 size: 0x800000 sha1: fbfda58b
- name: KERNEL size: 0x200000 sha1: fadae76b
- name: MAC size: 0x1000 sha1: 65d77247
- name: ENV size: 0x1000 sha1: bc80cd3b
- name: A size: 0x180000 path: /,squashfs sha1: 49c78d21
- name: B size: 0x7d000 path: /etc/jffs2,jffs2,rw
- name: C size: 0x3b6000 path: /usr,squashfs sha1: d5a23c2a size: 15M ram: total: 64M media: 27M firmware: kernel: "3.4.35 (Thu Feb 25 11:45:35 UTC 2021)" toolchain: gcc version 4.8.5 (anyka (gcc-4.8.5 + binutils-2.24 + ulcibc-0.9.33.2)(20170223)) libc: uClibc 0.9.33.2 main-app: anyka_ipc sensors:
- vendor: Silicon Optronics model: JXF37 control: bus: 0 type: i2c addr: 0x80