Navigation

    VEYE IMAGING Forum

    • Register
    • Login
    • Search
    • Categories
    • Tags
    • Recent
    • Popular
    • Users
    • WIKI
    • veye.cc

    SOLVED Install camera to rpi4

    Raspberry Pi App Software
    3
    14
    1782
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • V
      Viktor @Viktor last edited by

      Here is rpi boot contents:

      number@number:/boot$ ls
      config-5.11.0-1008-raspi  dtb-5.11.0-1008-raspi  grub                          
      System.map-5.11.0-1008-raspi
      config.txt                
      dtbs                  
      initrd.img                    
      vmlinuz-5.11.0-1008-raspi
      dtb                       
      firmware               
      initrd.img-5.11.0-1008-raspi
      
      V 1 Reply Last reply Reply Quote 0
      • V
        Viktor @Viktor last edited by Viktor

        I tried installing veye327 to rpiOs.

        I have 5.10.36 firmware. veye drivers don't have this version.

        I tried build from source, but failed.
        Copied built zImage and veye327.dtbo to rpi and got load kernel modules failed on startup.

        Updated: i did modules_install and veye327 works on rpiOs now.

        Can you help build kernel for Ubuntu Desktop Rpi?

        V 1 Reply Last reply Reply Quote 0
        • V
          Viktor @Viktor last edited by Viktor

          I did it.

          crosscompile kinux image veye327 driver for Ubuntu Desktop 21.04 Rpi4

          on rpi4

          uname -r
          5.11.0-1008-raspi
          
          uname -a
          Linux number 5.11.0-1008-raspi #8-Ubuntu SMP PREEMPT Thu May 6 17:46:38 UTC 2021 aarch64 aarch64 aarch64 GNU/Linux
          

          on host

          sudo apt install git bc bison flex libssl-dev make libc6-dev libncurses5-dev crossbuild-essential-arm64
          
          mkdir rpi_ubuntu_source
          cd rpi_ubuntu_source
          
          git clone --depth=1 git://git.launchpad.net/~ubuntu-kernel/ubuntu/+source/linux-raspi/+git/hirsute linux
          
          git clone https://github.com/veyeimaging/raspberrypi_v4l2.git
          
          
          cp raspberrypi_v4l2/driver_source/cam_drv_src/rpi-5.x_all/veye327.c linux/drivers/media/i2c
          

          edit linux/drivers/media/i2c/Kconfig

          find section imx219 and after it add:

          config VIDEO_VEYE327
          	tristate "VEYE VEYE327 sensor support"
          	depends on I2C && VIDEO_V4L2
          	select MEDIA_CONTROLLER
          	select VIDEO_V4L2_SUBDEV_API
          	select V4L2_FWNODE
          	help
          	  This is a Video4Linux2 sensor driver for the VEYE
          	  IMX327 camera.
          
          	  To compile this driver as a module, choose M here: the
          	  module will be called veye327.
          

          edit linux/drivers/media/i2c/Makefile

          find line imx219 and after it add:

          obj-$(CONFIG_VIDEO_VEYE327)	+= veye327.o
          
          
          cp raspberrypi_v4l2/driver_source/dts/rpi-5.10.y/veye327-overlay.dts linux/arch/arm64/boot/dts/overlays
          

          edit linux/arch/arm64/boot/dts/overlays/Makefile

          find line imx219 and after it add:

          veye327.dtbo \
          

          build kernel

          cd linux
          
          KERNEL=kernel8
          make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- bcm2711_defconfig
          
          make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- menuconfig
          

          go to Device Drivers --> Multimedia Support --> Media ancillary drivers --> Camera sensor devices

          select veye327 and save

          make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- Image modules dtbs -j4
          

          mount sd to host

          mkdir mnt
          mkdir mnt/fat32
          mkdir mnt/ext4
          sudo mount /dev/sdd1 mnt/fat32
          sudo mount /dev/sdd2 mnt/ext4
          

          copy modules

          sudo env PATH=$PATH make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- INSTALL_MOD_PATH=mnt/ext4 modules_install
          

          copy kernel and dtb

          sudo cp mnt/fat32/vmlinuz mnt/fat32/vmlinuz.old
          sudo cp arch/arm64/boot/Image mnt/fat32/vmlinuz
          sudo cp arch/arm64/boot/dts/broadcom/*.dtb mnt/fat32/
          sudo cp arch/arm64/boot/dts/overlays/*.dtb* mnt/fat32/overlays/
          sudo cp arch/arm64/boot/dts/overlays/README mnt/fat32/overlays/
          sudo umount mnt/fat32
          sudo umount mnt/ext4
          

          on rpi4

          edit /boot/firmware/config.txt

          add lines

          gpu_mem=400
          dtparam=i2c_vc=on
          cma=128M
          dtoverlay=veye327.dtbo
          start_x=1
          
          sudo reboot
          
          dmesg | grep veye
          
          veye327 probed
          

          preview

          gst-launch-1.0 v4l2src device=/dev/video0 ! "video/x-raw,format=(string)UYVY, width=(int)1920, height=(int)1080,framerate=(fraction)30/1" ! videoconvert ! autovideosink sync=false text-overlay=false -v
          

          success

          V F 2 Replies Last reply Reply Quote 0
          • V
            Viktor @Viktor last edited by

            Add to /etc/modules

            i2c-dev
            

            i2c bus 10,11 for sensor control

            veye_xumm 1 Reply Last reply Reply Quote 0
            • veye_xumm
              veye_xumm @Viktor last edited by

              @viktor
              Great! Thank you for trying and sharing.

              V 1 Reply Last reply Reply Quote 0
              • V
                Viktor @veye_xumm last edited by

                😎

                1 Reply Last reply Reply Quote 0
                • F
                  fire @Viktor last edited by

                  @viktor
                  Thanks very much.
                  I wonder how did you set camera parameters, I found that the cs_mipi_i2c.sh not working.

                  V 1 Reply Last reply Reply Quote 0
                  • V
                    Viktor @fire last edited by

                    @fire Veye327 i2c fully works.

                    F 1 Reply Last reply Reply Quote 0
                    • F
                      fire @Viktor last edited by

                      @viktor
                      Can you use the original pi commands (e.g. raspistill raspivid), instead of using gst-launch?

                      V 1 Reply Last reply Reply Quote 0
                      • V
                        Viktor @fire last edited by Viktor

                        @fire Yes, raspivid and raspistill works too on Ubuntu.

                        1 Reply Last reply Reply Quote 0
                        • First post
                          Last post