直接操作寄存器来查看当前是否有接摄像头,可以直接执行以下脚本来查看当前是否有接摄像头:

#bin/bash
#ahd1
busybox i2cset -f -y 2 0x31 0xff 0x05
busybox i2cset -f -y 2 0x31 0x82 0xff
busybox i2cset -f -y 2 0x31 0xff 0x13
busybox i2cset -f -y 2 0x31 0x30 0xff
busybox i2cset -f -y 2 0x31 0x31 0xff
busybox i2cset -f -y 2 0x31 0x32 0xff
busybox i2cset -f -y 2 0x31 0xff 0x01
busybox i2cget -f -y 2 0x31 0x10

#ahd2
busybox i2cset -f -y 2 0x31 0xff 0x06
busybox i2cset -f -y 2 0x31 0x82 0xff
busybox i2cset -f -y 2 0x31 0xff 0x13
busybox i2cset -f -y 2 0x31 0x30 0xff
busybox i2cset -f -y 2 0x31 0x31 0xff
busybox i2cset -f -y 2 0x31 0x32 0xff
busybox i2cset -f -y 2 0x31 0xff 0x01
busybox i2cget -f -y 2 0x31 0x30

#ahd3
busybox i2cset -f -y 2 0x31 0xff 0x07
busybox i2cset -f -y 2 0x31 0x82 0xff
busybox i2cset -f -y 2 0x31 0xff 0x13
busybox i2cset -f -y 2 0x31 0x30 0xff
busybox i2cset -f -y 2 0x31 0x31 0xff
busybox i2cset -f -y 2 0x31 0x32 0xff
busybox i2cset -f -y 2 0x31 0xff 0x01
busybox i2cget -f -y 2 0x31 0x50

#ahd4
busybox i2cset -f -y 2 0x31 0xff 0x08
busybox i2cset -f -y 2 0x31 0x82 0xff
busybox i2cset -f -y 2 0x31 0xff 0x13
busybox i2cset -f -y 2 0x31 0x30 0xff
busybox i2cset -f -y 2 0x31 0x31 0xff
busybox i2cset -f -y 2 0x31 0x32 0xff
busybox i2cset -f -y 2 0x31 0xff 0x01
busybox i2cget -f -y 2 0x31 0x70

#ahd5
busybox i2cset -f -y 2 0x30 0xff 0x08
busybox i2cset -f -y 2 0x30 0x82 0xff
busybox i2cset -f -y 2 0x30 0xff 0x13
busybox i2cset -f -y 2 0x30 0x30 0xff
busybox i2cset -f -y 2 0x30 0x31 0xff
busybox i2cset -f -y 2 0x30 0x32 0xff
busybox i2cset -f -y 2 0x30 0xff 0x01
busybox i2cget -f -y 2 0x30 0x70

#ahd6
busybox i2cset -f -y 2 0x30 0xff 0x07
busybox i2cset -f -y 2 0x30 0x82 0xff
busybox i2cset -f -y 2 0x30 0xff 0x13
busybox i2cset -f -y 2 0x30 0x30 0xff
busybox i2cset -f -y 2 0x30 0x31 0xff
busybox i2cset -f -y 2 0x30 0x32 0xff
busybox i2cset -f -y 2 0x30 0xff 0x01
busybox i2cget -f -y 2 0x30 0x50

#ahd7
busybox i2cset -f -y 2 0x30 0xff 0x06
busybox i2cset -f -y 2 0x30 0x82 0xff
busybox i2cset -f -y 2 0x30 0xff 0x13
busybox i2cset -f -y 2 0x30 0x30 0xff
busybox i2cset -f -y 2 0x30 0x31 0xff
busybox i2cset -f -y 2 0x30 0x32 0xff
busybox i2cset -f -y 2 0x30 0xff 0x01
busybox i2cget -f -y 2 0x30 0x30

#ahd8
busybox i2cset -f -y 2 0x30 0xff 0x05
busybox i2cset -f -y 2 0x30 0x82 0xff
busybox i2cset -f -y 2 0x30 0xff 0x13
busybox i2cset -f -y 2 0x30 0x30 0xff
busybox i2cset -f -y 2 0x30 0x31 0xff
busybox i2cset -f -y 2 0x30 0x32 0xff
busybox i2cset -f -y 2 0x30 0xff 0x01
busybox i2cget -f -y 2 0x30 0x10

如果有接摄像头正常返回0x31,未接摄像头返回0xff

例如:当前接ahd8,返回如下:

9 天 后

我这边有台执行这个命令后报错。

    5 天 后

    tgj891
    下载这个文件试一下

    ahd.txt
    2kB
      12 天 后

      LPA3568J(4*1080P) 执行这个命令提示:
      i2cset: can't open '/dev/i2c/2': No such file or directory
      i2cget: can't open '/dev/i2c/2': No such file or directory
      所以,LPA3568J 有其他办法能够达成对AHD摄像头的是否接入的检测么?

      1 个月 后

      Volcan 返回是0X21也是正常的吗