{"id":20161645,"url":"https://github.com/openipc/ipctool","last_synced_at":"2025-04-08T03:11:30.812Z","repository":{"id":38681374,"uuid":"431928647","full_name":"OpenIPC/ipctool","owner":"OpenIPC","description":"Simple tool (and library) for checking IP camera hardware","archived":false,"fork":false,"pushed_at":"2024-09-14T21:10:52.000Z","size":798,"stargazers_count":163,"open_issues_count":8,"forks_count":35,"subscribers_count":8,"default_branch":"master","last_synced_at":"2024-10-29T10:37:33.621Z","etag":null,"topics":["ipcamera","ipctool","openipc"],"latest_commit_sha":null,"homepage":"https://openipc.org","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/OpenIPC.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"open_collective":"openipc"}},"created_at":"2021-11-25T17:34:50.000Z","updated_at":"2024-10-24T07:56:32.000Z","dependencies_parsed_at":"2023-12-16T07:37:49.988Z","dependency_job_id":"84883b28-e42f-4870-b8e5-73bcd8d162ca","html_url":"https://github.com/OpenIPC/ipctool","commit_stats":{"total_commits":772,"total_committers":27,"mean_commits":28.59259259259259,"dds":"0.32383419689119175","last_synced_commit":"55518d86026c34046dd890d8ea7920bfc5ffcc0c"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenIPC%2Fipctool","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenIPC%2Fipctool/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenIPC%2Fipctool/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenIPC%2Fipctool/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/OpenIPC","download_url":"https://codeload.github.com/OpenIPC/ipctool/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247767236,"owners_count":20992548,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ipcamera","ipctool","openipc"],"created_at":"2024-11-14T00:19:56.454Z","updated_at":"2025-04-08T03:11:30.774Z","avatar_url":"https://github.com/OpenIPC.png","language":"C","readme":"![OpenIPC Logo](https://cdn.themactep.com/images/logo_openipc.png)\n\n# IP camera hardware checking tool\n\n[![Build](https://github.com/OpenIPC/ipctool/actions/workflows/release-arm32.yml/badge.svg)](https://github.com/OpenIPC/ipctool/actions/workflows/release-arm32.yml)\n[![Build](https://github.com/OpenIPC/ipctool/actions/workflows/release-mips32.yml/badge.svg)](https://github.com/OpenIPC/ipctool/actions/workflows/release-mips32.yml)\n[![CI status](https://img.shields.io/github/downloads/OpenIPC/ipctool/total.svg)](https://github.com/OpenIPC/ipctool/releases)\n![GitHub repo size](https://img.shields.io/github/repo-size/OpenIPC/ipctool)\n![GitHub issues](https://img.shields.io/github/issues/OpenIPC/ipctool)\n![GitHub pull requests](https://img.shields.io/github/issues-pr/OpenIPC/ipctool)\n[![License](https://img.shields.io/github/license/OpenIPC/ipctool)](https://opensource.org/licenses/MIT)\n\nThis basic concept belongs to [Maxim Chertov](http://github.com/chertov) (thank you for\nyour original utility) and [Nikita Orlov](https://github.com/nikitos1550/) (for\ncute YAML format for describing hardware). A warm welcome also to [Igor\nZalatov](https://github.com/ZigFisher) (for suggestions for new features and\ndescribing ways to do them).\n\n-----\n\n## Download\n\nUse [the link](https://github.com/OpenIPC/ipctool/releases/download/latest/ipctool)\nto download latest build (even directly to your camera). The build uses `musl`\nC library to work on vast majority of hardware.\n\n### Alternative launch methods\n\n* *Public NFS server* (in case your camera firmware includes NFS client\n    support, proven to work on XM cameras):\n\n    ```console\n    $ mount -o nolock 95.217.179.189:/srv/ro /utils/\n    $ /utils/ipctool\n    ```\n\n   As an alternative, you may run your own NFS server, putting ipctool on it.\n\n* *Using UART and rx busybox applet on camera side*. This option was described in [@themactep blog post](https://themactep.com/notes/how-to-upload-a-file-onto-ip-camera-via-serial-uart-conection).\n\n* *Using telnet/console and uget utility*: basically convert small `uget` binary\n  into `echo`/`printf` chunks and deploy to `/tmp` partition. Read\n  [more in documentation](https://github.com/widgetii/uget)\n\n* *TFTP*, since some cameras have tftp clients and/or servers by default. Assuming\n  you have the `ipctool-mips32` binary ready under `/directory/to/serve`:\n\n  **On a desktop computer:**\n  ```\n  $ pip install ptftpd\n  $ ptftpd -p 6969 en0 /directory/to/serve\n  ```\n  **On the camera:**\n  ```\n   # tftp -r /directory/to/serve/ipctool-mips32 -g 192.168.1.107 6969\n\n     46% |**************                 | 61952   0:00:01 ETA\n  ```\n\n* *Using telnet/console only*: uses a python script to transfer ipctool via\n  telnet/echo to the camera.\n\n  **On a desktop computer:**\n  ```\n  $ tools/telnet_upload.py 192.168.1.10\n  ```\n  **On the shell:**\n  ```\n  # transfer\n  ```\n\n## Usage\n\n```console\n# ipctool -h\nUsage: ipctool [OPTIONS] [COMMANDS]\nWhere:\n  -c, --chip-name           read chip name\n  -s, --sensor-name         read sensor model and control line\n  -t, --temp                read chip temperature (where supported)\n\n  backup \u003cfilename\u003e         save backup into a file\n  upload                    upload full backup to the OpenIPC cloud\n  restore [mac|filename]    restore from backup (cloud-based or local file)\n     [-s, --skip-env]       skip environment\n     [-f, --force]          enforce\n  upgrade \u003cbundle\u003e          upgrade to OpenIPC firmware\n                            (experimental! use only on cameras with UART)\n     [-f, --force]          enforce\n  printenv                  drop-in replacement for fw_printenv\n  setenv \u003ckey\u003e \u003cvalue\u003e      drop-in replacement for fw_setenv\n  dmesg                     drop-in replacement for dmesg\n  i2cget \u003cdevice address\u003e \u003cregister\u003e\n  spiget \u003cregister\u003e\n                            read data from I2C/SPI device\n  i2cset \u003cdevice address\u003e \u003cregister\u003e \u003cnew value\u003e\n  spiset \u003cregister\u003e \u003cnew value\u003e\n                            write a value to I2C/SPI device\n  i2cdump [--script] [-b, --bus] \u003cdevice address\u003e \u003cfrom register\u003e \u003cto register\u003e\n  spidump [--script] \u003cfrom register\u003e \u003cto register\u003e\n                            dump data from I2C/SPI device\n  i2cdetect [-b, --bus]     attempt to detect devices on I2C bus\n  reginfo [--script]        dump current status of pinmux registers\n  gpio (scan|mux)           GPIO utilities\n  trace [--skip=usleep] \u003cfull/path/to/executable\u003e [program arguments]\n                            dump original firmware calls and data structures\n  -h, --help                this help\n```\n\nWhen run without parameters utility produces YAML with all hardware-specific\ninformation about given IP-camera or DVR:\n\n```yaml\n---\nboard:\n  vendor: Xiongmai\n  model: 50H20L\n  cloudId: 3beae2b40d84f889\nchip:\n  vendor: HiSilicon\n  model: 3516CV300\nethernet:\n  mac: \"00:12:89:12:88:e1\"\n  u-mdio-phyaddr: 1\n  phy-id: 0x001cc816\n  d-mdio-phyaddr: 0\nrom:\n  - type: nor\n    block: 64K\n    chip:\n      name: \"w25q128\"\n      id: 0xef4018\n    partitions:\n      - name: boot\n        size: 0x30000\n        sha1: 7a7a83e9\n        contains:\n          - name: xmcrypto\n            offset: 0x1fc00\n          - name: uboot-env\n            offset: 0x20000\n      - name: romfs\n        size: 0x2e0000\n        path: /,squashfs\n        sha1: 62529dab\n      - name: user\n        size: 0x300000\n        path: /usr,squashfs\n        sha1: cbb7e9ca\n      - name: web\n        size: 0x160000\n        path: /mnt/custom/data/Fonts,squashfs\n        sha1: 48140b3b\n      - name: custom\n        size: 0x40000\n        path: /mnt/custom,cramfs\n        sha1: fb72a5f5\n      - name: mtd\n        size: 0x50000\n        path: /mnt/mtd,jffs2,rw\n    size: 8M\n    addr-mode: 3-byte\nram:\n  total: 128M\n  media: 72M\nfirmware:\n  u-boot: \"2010.06-svn1098 (Jun 11 2018 - 13:17:42)\"\n  kernel: \"3.18.20 (Thu Jul 5 14:44:19 CST 2018)\"\n  toolchain: gcc version 4.9.4 20150629 (prerelease) (Hisilicon_v500_20170922) \n  libc: uClibc 0.9.33.2\n  sdk: \"Hi3516CV300_MPP_V1.0.0.0 B010 Release (Jun 22 2018, 19:22:22)\"\n  main-app: /usr/bin/Sofia\nsensors:\n- vendor: Sony\n  model: IMX291\n  control:\n    bus: 0\n    type: i2c\n    addr: 0x34\n  params:\n    bitness: 12\n    databus: LVDS 4 ch\n    fps: 30\n  data:\n    type: LVDS\n    lane-id:\n    - 0\n    - 1\n    - 2\n    - 3\n    lvds-wdr-en: 0\n    lvds-wdr-mode: 0\n    lvds-wdr-num: 0\n    raw-data-type: RAW_DATA_12BIT\n    sync-mode: LVDS_SYNC_MODE_SAV\n    data-endian: LVDS_ENDIAN_BIG\n    sync-code-endian: LVDS_ENDIAN_BIG\n    sync-code:\n    - \n      - 0xab0, 0xb60, 0x800, 0x9d0\n      - 0xab0, 0xb60, 0x800, 0x9d0\n      - 0xab0, 0xb60, 0x800, 0x9d0\n      - 0xab0, 0xb60, 0x800, 0x9d0\n    - \n      - 0xab0, 0xb60, 0x800, 0x9d0\n      - 0xab0, 0xb60, 0x800, 0x9d0\n      - 0xab0, 0xb60, 0x800, 0x9d0\n      - 0xab0, 0xb60, 0x800, 0x9d0\n    - \n      - 0xab0, 0xb60, 0x800, 0x9d0\n      - 0xab0, 0xb60, 0x800, 0x9d0\n      - 0xab0, 0xb60, 0x800, 0x9d0\n      - 0xab0, 0xb60, 0x800, 0x9d0\n    - \n      - 0xab0, 0xb60, 0x800, 0x9d0\n      - 0xab0, 0xb60, 0x800, 0x9d0\n      - 0xab0, 0xb60, 0x800, 0x9d0\n      - 0xab0, 0xb60, 0x800, 0x9d0\n  clock: 37.125MHz\n```\n\n### In your own scripts\n\n* Determine chip name:\n\n    ```console\n    # ipctool --chip-name\n    hi3516cv300\n    ```\n\n* Determine sensor model and control line:\n\n    ```console\n    # ipctool --sensor-name\n    imx291_i2c\n    ```\n\n* Get temperature from chip's internal sensor (not all devices supported):\n\n    ```console\n    # ipctool --temp\n    50.69\n    ```\n\n### As backup/restore tool\n\n* Save full backup with YAML metadata into specific file:\n\n    ```console\n    # mount -o nolock mynfsserver:/srv /var/utils\n    # ipctool backup /var/utils/mybackup-00:12:17:83:d6:39\n    # sync\n    ```\n\n### As reverse engineering tool\n\n* Drop-in replacement of `dmesg` command:\n\n    ```console\n    # ipctool dmesg\n    ```\n\n* Drop-in replacement of `fw_printenv` and `fw_setenv` commands:\n\n    ```console\n    # ipctool printenv | grep bootargs\n    # ipctool setenv bootargs \"mem=\\${osmem} mtdparts=hi_sfc:256k(boot),64k(env),2048k(kernel),5120k(rootfs),-(rootfs_data)\"\n    ```\n\n* Drop-in replacement of `i2cget`, `i2cset` and `i2cdump` commands from\n  `i2c-tools` package:\n\n    ```console\n    # ipctool i2cget 0x34 0x3000\n    # ipctool i2cset 0x34 0x3000 1\n    # ipctool i2cdump 0x34 0x3000 0x31ff\n    # ipctool i2cdump --script 0x34 0x3000 0x31ff\n    ```\n\n* The same approach is to manipulate SPI sensor registers:\n\n    ```console\n    # ipctool spiget 0x200\n    # ipctool spiset 0x200 1\n    # ipctool spidump 0x200 0x300\n    # ipctool spidump --script 0x200 0x300\n    ```\n\n* Dump the state of pinmux registers in human- and machine-readable format or\n  shell script ready to be applied on another system:\n\n    ```console\n    # ipctool reginfo\n    # ipctool --script reginfo\n    ```\n\n* Advanced replacement of `strace`:\n\n    ```console\n    # ipctool trace /usr/bin/Sofia\n    ```\n\n### To help the researcher\n\nOn Ingenic devices, the original Sensor I2C address needs to be right shifted by 1bit, example:\n\n```\nIMX335: (0x34 \u003e\u003e 1) = 0x1A\nSC2230: (0x60 \u003e\u003e 1) = 0x30\nGC2053: (0x6E \u003e\u003e 1) = 0x37\n```\n\n## Supported SoCs\n\nTested on:\n\n|Manufacturer|Models|\n|---|---|\n|[HiSilicon](https://github.com/openIPC/camerasrnd/#chip-families-information)|Hi3516CV100/200/300, Hi3516EV100/200/300, Hi3516DV300, Hi3518EV100|\n|[SigmaStar](http://linux-chenxing.org/)|SSC335|\n|[Xiongmai](http://www.xiongmaitech.com/product)|XM510, XM530, XM550|\n|[Rockchip](https://www.rock-chips.com/)|RV1109|\n|[Goke](http://www.goke.com/en/)|GK7205v200/210/300|\n\nPlease test on your device to help us extend the list.\n\n## Supported boards\n\nTested on:\n\n|Manufacturer|Models|\n|---|---|\n|Xiongmai| Various models |\n|Hankvision | V6202IR-IMX327 |\n|Ruision | RS-H649F-A0, RS-H651JAI-AO, RS-H656S-AO |\n|TP-Link | NC210 |\n\n## Supported sensors\n\nTested on:\n\n|Manufacturer           |Models                                 |\n|-----------------------|---------------------------------------|\n|Silicon Optronics, Inc.|JX-F22, JX-F23, JX-F37, JX-H62, JX-H65, JX-K05 |\n|Sony                   |IMX224, IMX290, IMX291, IMX307, IMX322, IMX323, IMX327, IMX335, IMX415, IMX664 |\n|ON Semiconductor       |AR0130, AR0237                         |\n|SmartSens              |SC2135, SC223A, SC2232, SC2235, SC2235P, SC2239, SC2315e (SC307E, SC4239Р), SC335E (SC5300) |\n|OmniVision             |OV9712                                 |\n|GalaxyCore             |GC2053                                 |\n\nPlease test on your device to help us extend the list.\n\n-----\n\n### Support\n\nOpenIPC offers two levels of support.\n\n- Free support through the community (via [chat](https://openipc.org/#telegram-chat-groups)).\n- Paid commercial support (from the team of developers).\n\nPlease consider subscribing for paid commercial support if you intend to use our product for business.\nAs a paid customer, you will get technical support and maintenance services directly from our skilled team.\nYour bug reports and feature requests will get prioritized attention and expedited solutions. It's a win-win\nstrategy for both parties, that would contribute to the stability your business, and help core developers\nto work on the project full-time.\n\nIf you have any specific questions concerning our project, feel free to [contact us](mailto:dev@openipc.org).\n\n### Participating and Contribution\n\nIf you like what we do, and willing to intensify the development, please consider participating.\n\nYou can improve existing code and send us patches. You can add new features missing from our code.\n\nYou can help us to write a better documentation, proofread and correct our websites.\n\nYou can just donate some money to cover the cost of development and long-term maintaining of what we believe\nis going to be the most stable, flexible, and open IP Network Camera Framework for users like yourself.\n\nYou can make a financial contribution to the project at [Open Collective](https://opencollective.com/openipc/contribute/backer-14335/checkout).\n\nThank you.\n\n\u003cp align=\"center\"\u003e\n\u003ca href=\"https://opencollective.com/openipc/contribute/backer-14335/checkout\" target=\"_blank\"\u003e\u003cimg src=\"https://opencollective.com/webpack/donate/button@2x.png?color=blue\" width=\"375\" alt=\"Open Collective donate button\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n","funding_links":["https://opencollective.com/openipc","https://opencollective.com/openipc/contribute/backer-14335/checkout"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenipc%2Fipctool","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopenipc%2Fipctool","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenipc%2Fipctool/lists"}