Navigation

    VEYE IMAGING Forum

    • Register
    • Login
    • Search
    • Categories
    • Tags
    • Recent
    • Popular
    • Users
    • WIKI
    • veye.cc
    1. Home
    2. MJYC
    3. Posts
    M
    • Profile
    • Following 0
    • Followers 0
    • Topics 3
    • Posts 25
    • Best 0
    • Groups 0

    Posts made by MJYC

    • RE: 树莓派5b & 2个sc132 相机,拍照问题

      @veye_xumm
      亲,目前两个相机都能拍照了,但是sudo reboot,重启后,又都不能拍照了了,需要重新./find_entity.sh,./media_setting_rpi5.sh XXX。

      posted in CS MIPI camera
      M
      MJYC
    • RE: 树莓派5b & 2个sc132 相机,拍照问题

      @veye_xumm
      好像可以了,给您添麻烦了

      posted in CS MIPI camera
      M
      MJYC
    • RE: 树莓派5b & 2个sc132 相机,拍照问题

      @veye_xumm
      ./media_setting_rpi5.sh mvcam -fmt RAW8 -w 1024 -h 1280

      posted in CS MIPI camera
      M
      MJYC
    • RE: 树莓派5b & 2个sc132 相机,拍照问题

      @veye_xumm
      其余的一些信息
      HZCU@raspberrypi:~ $ v4l2-ctl -d /dev/video0 --set-fmt-video=width=1024,height=1280,pixelformat=GREY --stream-mmap --stream-count=1 --stream-to=y8-1024x1280.raw
      VIDIOC_STREAMON returned -1 (Invalid argument)

      HZCU@raspberrypi:~ $ dmesg | grep mvcam
      [ 3.077392] rp1-cfe 1f00110000.csi: found subdevice /axi/pcie@120000/rp1/i2c@88000/veyemvcam@3b
      [ 3.081206] rp1-cfe 1f00128000.csi: found subdevice /axi/pcie@120000/rp1/i2c@80000/veyemvcam@3b
      [ 3.145470] veye_mvcam: loading out-of-tree module taints kernel.
      [ 3.148379] mvcam 4-003b: veye mv series camera driver version: 01.01.04
      [ 3.153600] mvcam 4-003b: Unable to load veye_vbyone driver,will go on
      [ 3.665752] mvcam 4-003b: camera is: RAW-MIPI-SC132M
      [ 3.666514] mvcam 4-003b: firmware version: 0x1040000
      [ 3.680173] mvcam 4-003b: mvcam_enum_controls success
      [ 3.680855] rp1-cfe 1f00128000.csi: Using sensor mvcam 4-003b for capture
      [ 3.692868] mvcam 6-003b: veye mv series camera driver version: 01.01.04
      [ 3.705052] mvcam 6-003b: Unable to load veye_vbyone driver,will go on
      [ 4.207041] mvcam: mvcam_read: Reading register 0x04 failed
      [ 4.207052] mvcam 6-003b: failed to read chip id
      [ 673.554515] Modules linked in: rfcomm snd_seq_dummy snd_hrtimer snd_seq snd_seq_device algif_hash algif_skcipher af_alg bnep binfmt_misc hci_uart aes_ce_blk btbcm aes_ce_cipher brcmfmac ghash_ce gf128mul bluetooth sha2_ce sha256_arm64 sha1_ce brcmutil ecdh_generic ecc veye_mvcam(O) cfg80211 libaes raspberrypi_hwmon rfkill rpivid_hevc(C) rp1_cfe pisp_be v4l2_mem2mem v4l2_fwnode videobuf2_dma_contig v4l2_async videobuf2_memops videobuf2_v4l2 videobuf2_common videodev rp1_adc mc raspberrypi_gpiomem nvmem_rmem uio_pdrv_genirq uio i2c_dev fuse dm_mod ip_tables x_tables ipv6 spidev vc4 snd_soc_hdmi_codec drm_display_helper cec drm_dma_helper drm_kms_helper syscopyarea sysfillrect sysimgblt fb_sys_fops i2c_brcmstb spi_bcm2835 snd_soc_core v3d gpu_sched snd_compress drm_shmem_helper snd_pcm_dmaengine snd_pcm snd_timer drm gpio_keys snd drm_panel_orientation_quirks backlight i2c_designware_platform i2c_designware_core
      粗体字

      posted in CS MIPI camera
      M
      MJYC
    • RE: 树莓派5b & 2个sc132 相机,拍照问题

      您好
      1、./media_setting_rpi5.sh文件我没有更改
      @veye_xumm
      #!/bin/bash

      I2CBUS_CAM1=4
      I2CBUS_CAM0=6

      #default params of YUV_type cameras
      WIDTH_YUV=1920
      HEIGHT_YUV=1080
      MEDIA_FMT_YUV=UYVY8_1X16
      PIXEL_FMT_YUV=UYVY

      #default params of MV_type cameras
      WIDTH_MV=1280
      HEIGHT_MV=1024
      MEDIA_FMT_MV=Y8_1X8
      PIXEL_FMT_MV=GREY
      2、执行./find_entity.sh
      HZCU@raspberrypi:~/Desktop/raspberrypi_v4l2/rpi5_scripts $ ./find_entity.sh
      Found mvcam @ i2c-4 entity on /dev/media2
      Plese get frame from /dev/video0 and use /dev/v4l-subdev2 for camera setting.
      3、执行完./media_setting_rpi5.sh,
      HZCU@raspberrypi:~/Desktop/raspberrypi_v4l2/rpi5_scripts $ ./media_setting_rpi5.sh
      This is a Raspberry Pi 5.
      Usage: ./media_setting_rpi5.sh veyecam2m/csimx307/cssc132/mvcam -fmt [UYVY/RAW8/RAW10/RAW12] -w [width] -h [height]
      This shell script is designed to detect the connection of a camera on Raspberry Pi 5.
      It utilizes media-ctl and v4l2-ctl commands to configure the linking relationships and data formats of the media pad.
      Once completed, you can directly use /dev/video0 or /dev/video8 to obtain image data.
      4、media-ctl -p -d /dev/media2
      HZCU@raspberrypi:~/Desktop/raspberrypi_v4l2/rpi5_scripts $ media-ctl -p -d /dev/media2
      Media controller API version 6.1.63

      Media device information

      driver rp1-cfe
      model rp1-cfe
      serial
      bus info platform:1f00128000.csi
      hw revision 0x114666
      driver version 6.1.63

      Device topology

      • entity 1: csi2 (8 pads, 8 links)
        type V4L2 subdev subtype Unknown flags 0
        device node name /dev/v4l-subdev0
        pad0: Sink
        [fmt:SRGGB10_1X10/640x480 field:none colorspace:raw xfer:none ycbcr:601 quantization:full-range]
        <- "mvcam 4-003b":0 [ENABLED,IMMUTABLE]
        pad1: Sink
        [fmt:unknown/8192x1 field:none]
        pad2: Sink
        [fmt:SRGGB10_1X10/640x480 field:none colorspace:raw xfer:none ycbcr:601 quantization:full-range]
        pad3: Sink
        [fmt:SRGGB10_1X10/640x480 field:none colorspace:raw xfer:none ycbcr:601 quantization:full-range]
        pad4: Source
        [fmt:SRGGB10_1X10/640x480 field:none colorspace:raw xfer:none ycbcr:601 quantization:full-range]
        -> "rp1-cfe-csi2_ch0":0 []
        -> "pisp-fe":0 []
        pad5: Source
        [fmt:unknown/8192x1 field:none]
        -> "rp1-cfe-embedded":0 []
        pad6: Source
        [fmt:SRGGB10_1X10/640x480 field:none colorspace:raw xfer:none ycbcr:601 quantization:full-range]
        -> "rp1-cfe-csi2_ch2":0 []
        -> "pisp-fe":0 []
        pad7: Source
        [fmt:SRGGB10_1X10/640x480 field:none colorspace:raw xfer:none ycbcr:601 quantization:full-range]
        -> "rp1-cfe-csi2_ch3":0 []
        -> "pisp-fe":0 []

      • entity 10: pisp-fe (5 pads, 7 links)
        type V4L2 subdev subtype Unknown flags 0
        device node name /dev/v4l-subdev1
        pad0: Sink
        [fmt:SRGGB16_1X16/640x480 field:none colorspace:raw xfer:none ycbcr:601 quantization:full-range]
        <- "csi2":4 []
        <- "csi2":6 []
        <- "csi2":7 []
        pad1: Sink
        [fmt:FIXED/8192x1 field:none]
        <- "rp1-cfe-fe_config":0 []
        pad2: Source
        [fmt:SRGGB16_1X16/640x480 field:none colorspace:raw xfer:none ycbcr:601 quantization:full-range]
        -> "rp1-cfe-fe_image0":0 []
        pad3: Source
        [fmt:SRGGB16_1X16/640x480 field:none colorspace:raw xfer:none ycbcr:601 quantization:full-range]
        -> "rp1-cfe-fe_image1":0 []
        pad4: Source
        [fmt:FIXED/8192x1 field:none]
        -> "rp1-cfe-fe_stats":0 []

      • entity 16: mvcam 4-003b (1 pad, 1 link)
        type V4L2 subdev subtype Sensor flags 0
        device node name /dev/v4l-subdev2
        pad0: Source
        [fmt:Y8_1X8/1024x1280 field:none colorspace:rec709
        crop.bounds:(0,0)/1080x1280
        crop:(0,0)/1024x1280]
        -> "csi2":0 [ENABLED,IMMUTABLE]

      • entity 18: rp1-cfe-csi2_ch0 (1 pad, 1 link)
        type Node subtype V4L flags 0
        device node name /dev/video0
        pad0: Sink
        <- "csi2":4 []

      • entity 22: rp1-cfe-embedded (1 pad, 1 link)
        type Node subtype V4L flags 0
        device node name /dev/video1
        pad0: Sink
        <- "csi2":5 []

      • entity 26: rp1-cfe-csi2_ch2 (1 pad, 1 link)
        type Node subtype V4L flags 0
        device node name /dev/video2
        pad0: Sink
        <- "csi2":6 []

      • entity 30: rp1-cfe-csi2_ch3 (1 pad, 1 link)
        type Node subtype V4L flags 0
        device node name /dev/video3
        pad0: Sink
        <- "csi2":7 []

      • entity 34: rp1-cfe-fe_image0 (1 pad, 1 link)
        type Node subtype V4L flags 1
        device node name /dev/video4
        pad0: Sink
        <- "pisp-fe":2 []

      • entity 38: rp1-cfe-fe_image1 (1 pad, 1 link)
        type Node subtype V4L flags 0
        device node name /dev/video5
        pad0: Sink
        <- "pisp-fe":3 []

      • entity 42: rp1-cfe-fe_stats (1 pad, 1 link)
        type Node subtype V4L flags 0
        device node name /dev/video6
        pad0: Sink
        <- "pisp-fe":4 []

      • entity 46: rp1-cfe-fe_config (1 pad, 1 link)
        type Node subtype V4L flags 0
        device node name /dev/video7
        pad0: Source
        -> "pisp-fe":1 []

      posted in CS MIPI camera
      M
      MJYC
    • 树莓派5b & 2个sc132 相机,拍照问题

      HZCU@raspberrypi:~ $ v4l2-ctl -L -d /dev/v4l-subdev2

      User Controls

                     trigger_mode 0x00981901 (int)    : min=0 max=2 step=1 default=1 value=0 flags=volatile, execute-on-write
                      trigger_src 0x00981902 (int)    : min=0 max=1 step=1 default=1 value=0 flags=volatile, execute-on-write
                      soft_trgone 0x00981903 (button) : value=0 flags=write-only, execute-on-write
                       frame_rate 0x00981904 (int)    : min=0 max=120 step=1 default=120 value=120 flags=volatile, execute-on-write
                            roi_x 0x00981905 (int)    : min=0 max=1016 step=8 default=0 value=0
                            roi_y 0x00981906 (int)    : min=0 max=1216 step=4 default=0 value=0
      

      Camera Controls

               camera_orientation 0x009a0922 (menu)   : min=0 max=2 default=2 value=2 (External) flags=read-only
      			0: Front
      			1: Back
      			2: External
           camera_sensor_rotation 0x009a0923 (int)    : min=0 max=0 step=1 default=0 value=0 flags=read-only
      

      Image Processing Controls

                   link_frequency 0x009f0901 (intmenu): min=0 max=0 default=0 value=0 (1500000000 0x59682f00)
      			0: 1500000000 (0x59682f00)
                       pixel_rate 0x009f0902 (int64)  : min=750000000 max=750000000 step=1 default=750000000 value=750000000 flags=read-only
      

      HZCU@raspberrypi:~ $ v4l2-ctl -d /dev/video0 --set-fmt-video=width=1024,height=1280,pixelformat=GREY --stream-mmap --stream-count=1 --stream-to=y8-1024x1280.raw
      VIDIOC_STREAMON returned -1 (Invalid argument)

      posted in CS MIPI camera
      M
      MJYC
    • RE: ESP32控制SC132相机硬件触发,通过树莓派保存图片到SD卡的一些问题

      @veye_xumm
      好的好的,感谢您的建议

      posted in CS MIPI camera
      M
      MJYC
    • RE: ESP32控制SC132相机硬件触发,通过树莓派保存图片到SD卡的一些问题

      @veye_xumm

      我觉得如果代码中,最开始能清楚所有占用设备的进程,然后开始拍照,这样不管是断电还是提前结束,都不影响下次代码运行。(我运行代码的时候,发现没有结束进程(比如没拍够,或者断电了)下次再拍,会报failed:Device or resource busy。

      posted in CS MIPI camera
      M
      MJYC
    • RE: ESP32控制SC132相机硬件触发,通过树莓派保存图片到SD卡的一些问题

      @veye_xumm
      我下午有空的,可否帮忙解决一下这个困扰我两周的问题吗

      posted in CS MIPI camera
      M
      MJYC
    • RE: ESP32控制SC132相机硬件触发,通过树莓派保存图片到SD卡的一些问题

      @veye_xumm 可以可以提供一下解决方案,实现自启动,4个相机硬件触发同步拍摄。真的很急,我的微信号YMJXIAOBAI

      posted in CS MIPI camera
      M
      MJYC
    • RE: ESP32控制SC132相机硬件触发,通过树莓派保存图片到SD卡的一些问题

      @veye_xumm said in ESP32控制SC132相机硬件触发,通过树莓派保存图片到SD卡的一些问题:

      手动执行你的这个python脚本

      手动执行这个python脚本,必须要拍满20张图片再次运行,才能继续拍摄。但是我如果用while(1):这种写法,运行一次,不ctrl c退出,也是不能继续拍摄的。
      报错为:VIDIOC_S_FMT:failed:Device or resource busy
      VIDIOC_REQBUFS returned -1(Device or resource busy)

      当然自启动问题更多,根本不会等待硬件触发,直接拍完20张。有一次,我试了一下while(1):这种写法,一直存零kb的空图。

      posted in CS MIPI camera
      M
      MJYC
    • RE: ESP32控制SC132相机硬件触发,通过树莓派保存图片到SD卡的一些问题

      @veye_xumm said in ESP32控制SC132相机硬件触发,通过树莓派保存图片到SD卡的一些问题:

      摄像头的工作模式

      摄像头的工作模式,是我paramsave保存的,每次上电v4l2-ctrl -L看到的都是一样的。

      posted in CS MIPI camera
      M
      MJYC
    • RE: ESP32控制SC132相机硬件触发,通过树莓派保存图片到SD卡的一些问题

      @veye_xumm
      您好,目前按照您所说的连续捕获的stream-count=-1的方式,没有办法捕获一次,保存一张不同名字的图片。
      我将我目前的情况详细的叙述一下:
      我将gpio-trigger.py 编写好,在Terimal中运行python nano gpio-trigger.py 能够正常的实现触发,存图
      0d72f9a2-0640-4f65-9f6d-cdd109c362be-屏幕截图 2023-11-17 164338.png
      于是,我将这个python文件作为开机启动程序
      d0d226fb-4253-4adc-b351-bd6829310b8b-屏幕截图 2023-11-17 164132.png
      3c2c2ad4-6b5e-4d5b-b131-3be6be43055b-屏幕截图 2023-11-17 164238.png

      但是每次重启后,都是没进行硬件触发,就在文件夹下产生了20张(指所有),且所有照片都是空的。于是我猜想是启动的太早了,于是我在gpio-trigger.py进入循环前,进行了60s的延迟。但是仍然没有解决,还是会出现延迟结束,没有硬件触发,直接生成20张空图片
      屏幕截图 2023-11-17 165806.png

      posted in CS MIPI camera
      M
      MJYC
    • RE: ESP32控制SC132相机硬件触发,通过树莓派保存图片到SD卡的一些问题

      @veye_xumm

      stream-count=-1,进程一直运行,我如何保存不同名字的图片。

      posted in CS MIPI camera
      M
      MJYC
    • ESP32控制SC132相机硬件触发,通过树莓派保存图片到SD卡的一些问题

      71a29d4de8bc95bfb862d8c73c9ec8c~1.jpg
      系统搭建:ESP32接受到拍照信息,GPIO12~15管脚分别触发4个相机。每个相机由树莓派保存图片到SD卡中。需要实现4个相机同步拍照,存图。上图只搭建1个相机+1个树莓派+1块ESP32。最终系统为4个相机+4个树莓派+1块ESP32。

      存在的问题:单独运行如下.py文件,ESP32收到信息后发出一个脉冲,拍照一次,存图正常。但是将.py文件加入到树莓派启动项中,每次启动后,存下来的图都为空的。发现问题是,相机进程占用sudo lsof /dev/video0 ,需要手动关掉进程sudo kill 1903。偶然间,在树莓派启动的时候发送命令给ESP32,ESP32触发相机。即能正常工作,且存图正常。于是我在ESP32在Setup中加入45s,频率5Hz的方波。还是存在启动的时候由方波触发的RAW文件一张有图一张无图(要么奇数有图偶数无图,要么相反)。而且这么做具有很大的局限性,即需要树莓派和ESP32同时上电,且当使用4个树莓派时,启动时间不能保证一样,代码中的num(即四个相机同一场景下的照片名字错位)不能保证是一致的。

      希望实现树莓派上电后自动运行代码,等待硬件触发,拍照存图。不知道贵公司有没有相关的开发案例或者函数接口供调用!!!

      以下为树莓派中的代码.py文件。
      import time
      import subprocess
      for num in range(0,20)://最后希望用while(1): 可以无限拍照,num来自本地文件
      time.sleep(0.5)
      print(num)
      cmd = "v4l2-ctl --set-fmt-video=width=1024,height=1280,pixelformat=GREY --stream-mmap --stream-count=1 --stream-to=./pic-trigger/y8-pic-{}.raw".format(num)
      subprocess.run(cmd,shell=True)

      已将相机触发改为硬件触发,普通模式
      trigger_mode = 1
      trigger_src = 1

      以下是ESP32初始化中的代码
      #define WAVE_INTERVAL 45000 // 45s raspberry boot
      void generateSquareWave() {
      unsigned long startTime = millis();
      while (millis() - startTime < WAVE_INTERVAL) {
      // Toggle the state every 100ms
      if ((millis() / 100) % 2 == 0) {
      digitalWrite(12, HIGH);
      digitalWrite(13, HIGH);
      digitalWrite(14, HIGH);
      digitalWrite(15, HIGH);
      } else {
      digitalWrite(12, LOW);
      digitalWrite(13, LOW);
      digitalWrite(14, LOW);
      digitalWrite(15, LOW);
      }
      delay(100);
      }
      }
      void setup(){
      pinMode(12, OUTPUT);
      pinMode(13, OUTPUT);
      pinMode(14, OUTPUT);
      pinMode(15, OUTPUT);
      digitalWrite(12, LOW);
      digitalWrite(13, LOW);
      digitalWrite(14, LOW);
      digitalWrite(15, LOW);
      generateSquareWave();
      }

      posted in CS MIPI camera
      M
      MJYC
    • RE: 树莓派Zero 2w开发板 识别不到SC132 设备

      @veye_xumm a7d0992c-3e13-49aa-b3a3-8367663a31b4-微信图片_20231105134415.jpg
      您好,我想按照您的方式make一下,但是报了两个错误。

      posted in CS MIPI camera
      M
      MJYC
    • RE: 树莓派Zero 2w开发板 识别不到SC132 设备

      @veye_xumm
      请问,你们树莓哦zero 2w开发板 有没有适配sc132的 方案,因为我们的设备受限于大小,只能用比较小的开发板,看到你们官网,有用zero系列接摄像头。麻烦您再帮忙看一下,谢谢啦

      posted in CS MIPI camera
      M
      MJYC
    • RE: 树莓派Zero 2w开发板 识别不到SC132 设备

      @mjyc a8dc107c-6d8a-4ed8-b261-1583febbeae5-微信图片_20231104231748.jpg
      我重新烧录了一个新系统,在安装veye_mvcam 的时候,报了上面那张两个文件找不到的错误(veye_mvcam.dtbo和veye_mvcam.ko的错误)

      posted in CS MIPI camera
      M
      MJYC
    • RE: 树莓派Zero 2w开发板 识别不到SC132 设备

      @mjyc said in 树莓派Zero 2w开发板 识别不到SC132 设备:

      1ac0a5ff-9499-497b-b4e0-4b926baf5939-微信图片_20231104205304.jpg
      树莓派4b能够识别到sc132相机,zero 2w在安装veye_mvcam时候,报了两个文件找不到,

      能不能更新一下驱动,

      posted in CS MIPI camera
      M
      MJYC
    • RE: 树莓派Zero 2w开发板 识别不到SC132 设备

      1ac0a5ff-9499-497b-b4e0-4b926baf5939-微信图片_20231104205304.jpg
      树莓派4b能够识别到sc132相机,zero 2w在安装veye_mvcam时候,报了两个文件找不到,

      posted in CS MIPI camera
      M
      MJYC