• Stars
    star
    156
  • Rank 238,024 (Top 5 %)
  • Language
    C
  • License
    MIT License
  • Created almost 3 years ago
  • Updated about 1 month ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Simple tool (and library) for checking IP camera hardware

OpenIPC Logo

IP camera hardware checking tool

Build CI status GitHub repo size GitHub issues GitHub pull requests License

This basic concept belongs to Maxim Chertov (thank you for your original utility) and Nikita Orlov (for cute YAML format for describing hardware). A warm welcome also to Igor Zalatov (for suggestions for new features and describing ways to do them).


Download

Use the link to download latest build (even directly to your camera). The build uses musl C library to work on vast majority of hardware.

Alternative launch methods

  • Public NFS server (in case your camera firmware includes NFS client support, proven to work on XM cameras):

    $ mount -o nolock 95.217.179.189:/srv/ro /utils/
    $ /utils/ipctool

    As an alternative, you may run your own NFS server, putting ipctool on it.

  • Using UART and rx busybox applet on camera side. This option was described in @themactep blog post.

  • Using telnet/console and uget utility: basically convert small uget binary into echo/printf chunks and deploy to /tmp partition. Read more in documentation

  • TFTP, since some cameras have tftp clients and/or servers by default. Assuming you have the ipctool-mips32 binary ready under /directory/to/serve:

    On a desktop computer:

    $ pip install ptftpd
    $ ptftpd -p 6969 en0 /directory/to/serve
    

    On the camera:

     # tftp -r /directory/to/serve/ipctool-mips32 -g 192.168.1.107 6969
    
       46% |**************                 | 61952   0:00:01 ETA
    
  • Using telnet/console only: uses a python script to transfer ipctool via telnet/echo to the camera.

    On a desktop computer:

    $ tools/telnet_upload.py 192.168.1.10
    

    On the shell:

    # transfer
    

Usage

# ipctool -h
Where:
  -c, --chip-name           read chip name
  -s, --sensor-name         read sensor model and control line
  -t, --temp                read chip temperature (where supported)

  backup <filename>         save backup into a file
  restore [mac|filename]    restore from backup (cloud-based or local file)
     [-s, --skip-env]       skip environment
     [-f, --force]          enforce
  upgrade <bundle>          upgrade to OpenIPC firmware (experimental feature, use only on cameras with UART)
     [-f, --force]          enforce
  printenv                  drop-in replacement for fw_printenv
  setenv <key> <value>      drop-in replacement for fw_setenv
  dmesg                     drop-in replacement for dmesg
  i2cget <device address> <register>
  spiget <register>
                            read data from I2C/SPI device
  i2cset <device address> <register> <new value>
  spiset <register> <new value>
                            write a value to I2C/SPI device
  i2cdump [--script] <device address> <from register> <to register>
  spidump [--script] <from register> <to register>
                            dump data from I2C/SPI device
  reginfo [--script]        dump current status of pinmux registers
  gpio (scan|mux)           GPIO utilities
  trace [--skip=usleep] <full/path/to/executable> [program arguments]
                            dump original firmware calls and data structures
  -h, --help                this help

When run without parameters utility produces YAML with all hardware-specific information about given IP-camera or DVR:

---
board:
  vendor: Xiongmai
  model: 50H20L
  cloudId: 3beae2b40d84f889
chip:
  vendor: HiSilicon
  model: 3516CV300
ethernet:
  mac: "00:12:89:12:88:e1"
  u-mdio-phyaddr: 1
  phy-id: 0x001cc816
  d-mdio-phyaddr: 0
rom:
  - type: nor
    block: 64K
    chip:
      name: "w25q128"
      id: 0xef4018
    partitions:
      - name: boot
        size: 0x30000
        sha1: 7a7a83e9
        contains:
          - name: xmcrypto
            offset: 0x1fc00
          - name: uboot-env
            offset: 0x20000
      - name: romfs
        size: 0x2e0000
        path: /,squashfs
        sha1: 62529dab
      - name: user
        size: 0x300000
        path: /usr,squashfs
        sha1: cbb7e9ca
      - name: web
        size: 0x160000
        path: /mnt/custom/data/Fonts,squashfs
        sha1: 48140b3b
      - name: custom
        size: 0x40000
        path: /mnt/custom,cramfs
        sha1: fb72a5f5
      - name: mtd
        size: 0x50000
        path: /mnt/mtd,jffs2,rw
    size: 8M
    addr-mode: 3-byte
ram:
  total: 128M
  media: 72M
firmware:
  u-boot: "2010.06-svn1098 (Jun 11 2018 - 13:17:42)"
  kernel: "3.18.20 (Thu Jul 5 14:44:19 CST 2018)"
  toolchain: gcc version 4.9.4 20150629 (prerelease) (Hisilicon_v500_20170922) 
  libc: uClibc 0.9.33.2
  sdk: "Hi3516CV300_MPP_V1.0.0.0 B010 Release (Jun 22 2018, 19:22:22)"
  main-app: /usr/bin/Sofia
sensors:
- vendor: Sony
  model: IMX291
  control:
    bus: 0
    type: i2c
    addr: 0x34
  params:
    bitness: 12
    databus: LVDS 4 ch
    fps: 30
  data:
    type: LVDS
    lane-id:
    - 0
    - 1
    - 2
    - 3
    lvds-wdr-en: 0
    lvds-wdr-mode: 0
    lvds-wdr-num: 0
    raw-data-type: RAW_DATA_12BIT
    sync-mode: LVDS_SYNC_MODE_SAV
    data-endian: LVDS_ENDIAN_BIG
    sync-code-endian: LVDS_ENDIAN_BIG
    sync-code:
    - 
      - 0xab0, 0xb60, 0x800, 0x9d0
      - 0xab0, 0xb60, 0x800, 0x9d0
      - 0xab0, 0xb60, 0x800, 0x9d0
      - 0xab0, 0xb60, 0x800, 0x9d0
    - 
      - 0xab0, 0xb60, 0x800, 0x9d0
      - 0xab0, 0xb60, 0x800, 0x9d0
      - 0xab0, 0xb60, 0x800, 0x9d0
      - 0xab0, 0xb60, 0x800, 0x9d0
    - 
      - 0xab0, 0xb60, 0x800, 0x9d0
      - 0xab0, 0xb60, 0x800, 0x9d0
      - 0xab0, 0xb60, 0x800, 0x9d0
      - 0xab0, 0xb60, 0x800, 0x9d0
    - 
      - 0xab0, 0xb60, 0x800, 0x9d0
      - 0xab0, 0xb60, 0x800, 0x9d0
      - 0xab0, 0xb60, 0x800, 0x9d0
      - 0xab0, 0xb60, 0x800, 0x9d0
  clock: 37.125MHz

In your own scripts

  • Determine chip name:

    # ipctool --chip-name
    hi3516cv300
  • Determine sensor model and control line:

    # ipctool --sensor-name
    imx291_i2c
  • Get temperature from chip's internal sensor (not all devices supported):

    # ipctool --temp
    50.69

As backup/restore tool

  • Save full backup with YAML metadata into specific file:

    # mount -o nolock mynfsserver:/srv /var/utils
    # ipctool backup /var/utils/mybackup-00:12:17:83:d6:39
    # sync

As reverse engineering tool

  • Drop-in replacement of dmesg command:

    # ipctool dmesg
  • Drop-in replacement of fw_printenv and fw_setenv commands:

    # ipctool printenv | grep bootargs
    # ipctool setenv bootargs "mem=\${osmem} mtdparts=hi_sfc:256k(boot),64k(env),2048k(kernel),5120k(rootfs),-(rootfs_data)"
  • Drop-in replacement of i2cget, i2cset and i2cdump commands from i2c-tools package:

    # ipctool i2cget 0x34 0x3000
    # ipctool i2cset 0x34 0x3000 1
    # ipctool i2cdump 0x34 0x3000 0x31ff
    # ipctool i2cdump --script 0x34 0x3000 0x31ff
  • The same approach is to manipulate SPI sensor registers:

    # ipctool spiget 0x200
    # ipctool spiset 0x200 1
    # ipctool spidump 0x200 0x300
    # ipctool spidump --script 0x200 0x300
  • Dump the state of pinmux registers in human- and machine-readable format or shell script ready to be applied on another system:

    # ipctool reginfo
    # ipctool --script reginfo
  • Advanced replacement of strace:

    # ipctool trace /usr/bin/Sofia

To help the researcher

On Ingenic devices, the original Sensor I2C address needs to be right shifted by 1bit, example:

IMX335: (0x34 >> 1) = 0x1A
SC2230: (0x60 >> 1) = 0x30
GC2053: (0x6E >> 1) = 0x37

Supported SoCs

Tested on:

Manufacturer Models
HiSilicon Hi3516CV100/200/300, Hi3516EV100/200/300, Hi3516DV300, Hi3518EV100
SigmaStar SSC335
Xiongmai XM510, XM530, XM550
Rockchip RV1109

Please test on your device to help us extend the list.

Supported boards

Tested on:

Manufacturer Models
Xiongmai Various models
Hankvision V6202IR-IMX327
Ruision RS-H649F-A0, RS-H651JAI-AO, RS-H656S-AO
TP-Link NC210

Supported sensors

Tested on:

Manufacturer Models
Silicon Optronics, Inc. JX-F22, JX-F23, JX-F37, JX-H62, JX-H65, JX-K05
Sony IMX224, IMX290, IMX291, IMX307, IMX322, IMX323, IMX327, IMX335, IMX415
ON Semiconductor AR0130, AR0237
SmartSens SC2135, SC2232, SC2235, SC2235P, SC2239, SC2315e (SC307E, SC4239Π ), SC335E (SC5300)
OmniVision OV9712
GalaxyCore GC2053

Please test on your device to help us extend the list.


Support

OpenIPC offers two levels of support.

  • Free support through the community (via chat).
  • Paid commercial support (from the team of developers).

Please consider subscribing for paid commercial support if you intend to use our product for business. As a paid customer, you will get technical support and maintenance services directly from our skilled team. Your bug reports and feature requests will get prioritized attention and expedited solutions. It's a win-win strategy for both parties, that would contribute to the stability your business, and help core developers to work on the project full-time.

If you have any specific questions concerning our project, feel free to contact us.

Participating and Contribution

If you like what we do, and willing to intensify the development, please consider participating.

You can improve existing code and send us patches. You can add new features missing from our code.

You can help us to write a better documentation, proofread and correct our websites.

You can just donate some money to cover the cost of development and long-term maintaining of what we believe is going to be the most stable, flexible, and open IP Network Camera Framework for users like yourself.

You can make a financial contribution to the project at Open Collective.

Thank you.

Open Collective donate button

More Repositories

1

firmware

Alternative IP Camera firmware from an open community
C
1,197
star
2

wiki

The new OpenIPC wiki
276
star
3

smolrtsp

A lightweight real-time streaming library for IP cameras
C
178
star
4

camerasrnd

Experiments with cheap Linux cameras
Shell
115
star
5

mini

OpenSource Mini IP camera streamer
C
94
star
6

coupler

Seamless transition between video cameras firmware
67
star
7

device-mjsxj02hl

OpenIPC for Xiaomi MJSXJ02HL
Shell
62
star
8

device-mjsxj03hl

OpenIPC for Xiaomi MJSXJ03HL
Shell
54
star
9

silicon_research

GK7205Vxx and Hi3536 some examples
C
49
star
10

sandbox-fpv

Sandbox for FPV experiments
C
48
star
11

webui

OpenIPC web interface.
Shell
42
star
12

openipc.github.io

Alternative IP Camera firmware from an open community
34
star
13

burn

OpenSource tool to unbrick HiSilicon and Goke devices
Python
32
star
14

majestic

Majestic Community edition integration kit
C
32
star
15

sbc-groundstations

sbc-groundstations
25
star
16

openhisilicon

Opensource Hisilicon SoCs SDK
C
24
star
17

uget

Simple but compact wget replacement for embedded devices
C
23
star
18

motors

Various code to manage motor hardware
C
22
star
19

python-dvr

python-dvr - library for configuring a wide range of IP cameras that use the NETsurveillance ActiveX plugin XMeye SDK
Python
19
star
20

sensors

Source code and ready-to-use drivers for video camera sensors
C
16
star
21

builder

Experimental system for building OpenIPC firmware for known devices
Shell
15
star
22

fpv4win

WiFi Broadcast FPV client for Windows platform
C++
13
star
23

aic8800

The aic8800 WiFi diver
C
13
star
24

hardware

A collection of hardware developments by the OpenIPC team
HTML
13
star
25

linux

Linux kernels for OpenIPC firmware
12
star
26

openxiongmai

Opensource Xiongmai SoCs SDK
C
11
star
27

mavfwd

Simplest MAVLink serial port to UDP forwarder in pure C
C
10
star
28

LoTool

Internal chip information extractor from HiSilicon HiTool
Java
10
star
29

u-boot-gk7205v200

U-Boot for gk7205v200 group SoC's
C
10
star
30

divinus

Multi-platform open source streamer
C
10
star
31

configurator

OpenIPC controller for setting up FPV and URLLC devices
Visual Basic .NET
10
star
32

devourer

The RTL8812AU driver that simply devours its competitors
C
9
star
33

u-boot-ingenic

U-Boot for Ingenic SoC's
C
8
star
34

microsnander

Stripped down and modified version of Serial Nor/nAND/Eeprom programmeR (based on CH341A)
C
8
star
35

u-boot-sigmastar

U-Boot for Infinity6xx SoC's
C
8
star
36

hisi-trace

A utility to run Sofia from XM in a non-stock environment
C++
7
star
37

u-boot-hi3516cv200

U-Boot for hi3516cv200 group SoC's
C
7
star
38

ssw101b

SigmaStar ssw101b WiFi driver
C
7
star
39

openingenic

Opensource Ingenic SoCs SDK
C
6
star
40

modding

IPCam modding scripts
Shell
6
star
41

sandbox

Sandbox for experiments in the OpenIPC project
Shell
6
star
42

snander-mstar

CH341A I2C MStar programmer
C
6
star
43

smolrtsp-libevent

SmolRTSP + libevent 2.x
C
5
star
44

audioplayer

Simple command line audioplayer for HiSilicon IPC
C
5
star
45

device-ezviz

OpenIPC for EZVIZ
5
star
46

packages

New OpenIPC packages feed - futurum
C
5
star
47

website

New website of the OpenIPC project
HTML
5
star
48

composer

Creating OpenIPC firmware with custom settings
Shell
5
star
49

hi_osd

Provide additional OSD regions on Hisilicon-based IPC
C
5
star
50

yaml-cli

Simple YAML console tool
C
5
star
51

realtek-wlan

Realtek WLAN drivers
C
4
star
52

device-hi3518ev200-wifi

OpenIPC for HI3518EV200 based devices with WiFi
Shell
4
star
53

ipctool_tests

PoC for do CI on distributed collection of hardware
Shell
4
star
54

u-boot-hi3516ev200

U-Boot for hi3516ev200 group SoC's
C
4
star
55

osd

An all-in-one daemon that exposes an HTTP frontend to adjust settings, manage OSD regions and stream AV content on supported IP cameras
C
4
star
56

majestic-plugins

Majestic plugins for OpenIPC
C
4
star
57

.github

OpenIPC is a Linux operating system targeting IP cameras
4
star
58

u-boot-hi3516cv100

U-Boot for hi3516cv100 group SoC's
C
3
star
59

u-boot-t20

U-Boot for t20 group SoC's
C
3
star
60

u-boot-hi3516av100

U-Boot for hi3516av100 group SoC's
C
3
star
61

u-boot-msc313e

U-Boot for Infinity3xx SoC's
C
3
star
62

u-boot-hi3516cv500

U-Boot for hi3516cv500 group SoC's
C
3
star
63

u-boot-hi3519v101

U-Boot for hi3519v101 group SoC's
C
3
star
64

telemetry

The OpenIPC telemetry system
Shell
3
star
65

u-boot-hi3516cv300

U-Boot for hi3516cv300 group SoC's
C
3
star
66

atbm_60xx

AltoBeam atbm WiFi driver
C
3
star
67

device-cip-37210

OpenIPC for Smartwares CIP-37210
3
star
68

capjpeg

Quick and dirty libimp (T31 - ingenic) testing for catpure still images using openipc sdk
C
3
star
69

u-boot-t40

About U-Boot for t40 group SoC's
C
2
star
70

debrick

Recovering Hisi/Goke devices
C#
2
star
71

majestic-webui

Web interface for OpenIPC firmware.
Shell
2
star
72

pyosd

OSD python app to run on MacOS
Python
2
star
73

plugins

Plugins for firmware OpenIPC 2.2
2
star
74

urllc-webui

OpenIPC URLLC WebUI examples
HTML
2
star
75

uboot-nt9856x

U-Boot for nt9856x group SoC's
C
2
star
76

docs

The new OpenIPC docs
Astro
2
star
77

fancyweb

Fancy WEB interface using React
JavaScript
2
star
78

faceter

Integration with the Faceter project
Shell
1
star
79

br-cache

Buildroot Cache Repo for CI
1
star
80

mt7601u

Mediatek WLAN drivers
C
1
star
81

distributor

Internal Workflow System
Shell
1
star
82

interface

OpenIPC Common Interface Prototype
TypeScript
1
star
83

dms

Device Management System
Python
1
star