SOLVED cs-mipi-sc132 landscape-portrait orientation, cs_mipi_i2c.sh Permission denied
-
I am trying to set the SC132 Camera in an landscape orientation. With resolution 1280x1080.
Sadly i am not able to read or write from the camera via the cs_mipi_i2c script. I have to cameras connekted to a Jetson Nano B01 and have verified that the Cameras are connektet and even read images from them.dmesg | grep cssc132 [ 1.848018] cssc132 7-003b: probing v4l2 sensor [ 1.848579] cssc132 7-003b: tegracam sensor driver:cssc132_v2.0.6 [ 1.849221] cssc132 7-003b: read sensor id 0132 [ 1.853871] cssc132 7-003b: camera id is cs-mipi-sc132 [ 1.859165] cssc132 7-003b: Detected CS_MIPI_SC132 camera [ 1.859242] cssc132 8-003b: probing v4l2 sensor [ 1.859700] cssc132 8-003b: tegracam sensor driver:cssc132_v2.0.6 [ 1.860309] cssc132 8-003b: read sensor id 0132 [ 1.864963] cssc132 8-003b: camera id is cs-mipi-sc132 [ 1.870246] cssc132 8-003b: Detected CS_MIPI_SC132 camera [ 2.030421] vi 54080000.vi: subdev cssc132 7-003b bound [ 2.031276] vi 54080000.vi: subdev cssc132 8-003b bound
sudo i2cdetect -r 8 WARNING! This program can confuse your I2C bus, cause data loss and worse! I will probe file /dev/i2c-8 using receive byte commands. I will probe address range 0x03-0x77. Continue? [Y/n] y 0 1 2 3 4 5 6 7 8 9 a b c d e f 00: -- -- -- -- -- -- -- -- -- -- -- -- -- 10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 30: -- -- -- -- -- -- -- -- -- -- -- UU -- -- -- -- 40: UU -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 70: -- -- -- -- -- -- -- --
sudo i2cdetect -r 7 [sudo] password for schubert: WARNING! This program can confuse your I2C bus, cause data loss and worse! I will probe file /dev/i2c-7 using receive byte commands. I will probe address range 0x03-0x77. Continue? [Y/n] y 0 1 2 3 4 5 6 7 8 9 a b c d e f 00: -- -- -- -- -- -- -- -- -- -- -- -- -- 10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 30: -- -- -- -- -- -- -- -- -- -- -- UU -- -- -- -- 40: UU -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 60: -- -- -- -- -- -- -- -- -- -- 6a -- -- -- -- -- 70: -- -- -- -- -- -- -- --
But I keep getting erros like :
sudo ./cs_mipi_i2c.sh -w -f videofmt -p1 1280 -p2 1080 -p3 45 -b 7 ./cs_mipi_i2c.sh: 495: ./cs_mipi_i2c.sh: ./i2c_write: Permission denied ./cs_mipi_i2c.sh: 496: ./cs_mipi_i2c.sh: ./i2c_write: Permission denied ./cs_mipi_i2c.sh: 499: ./cs_mipi_i2c.sh: ./i2c_write: Permission denied ./cs_mipi_i2c.sh: 500: ./cs_mipi_i2c.sh: ./i2c_write: Permission denied ./cs_mipi_i2c.sh: 515: ./cs_mipi_i2c.sh: ./i2c_write: Permission denied ./cs_mipi_i2c.sh: 518: ./cs_mipi_i2c.sh: ./i2c_write: Permission denied ./cs_mipi_i2c.sh: 519: ./cs_mipi_i2c.sh: ./i2c_write: Permission denied w old videofmt width 1280 height 1080 framerate 45 sudo ./cs_mipi_i2c.sh -r -f videofmt -b 7 ./cs_mipi_i2c.sh: 444: ./cs_mipi_i2c.sh: ./i2c_read: Permission denied ./cs_mipi_i2c.sh: 446: ./cs_mipi_i2c.sh: ./i2c_read: Permission denied ./cs_mipi_i2c.sh: 450: ./cs_mipi_i2c.sh: ./i2c_read: Permission denied ./cs_mipi_i2c.sh: 452: ./cs_mipi_i2c.sh: ./i2c_read: Permission denied ./cs_mipi_i2c.sh: 456: ./cs_mipi_i2c.sh: ./i2c_read: Permission denied ./cs_mipi_i2c.sh: 466: ./cs_mipi_i2c.sh: ./i2c_read: Permission denied ./cs_mipi_i2c.sh: 468: ./cs_mipi_i2c.sh: ./i2c_read: Permission denied r new type videofmt width 32382 height 32382 framerate 323.82
I have tried all combinations with -b 7, -b 8 , -d 0x3b, -d 3b, -d 003b, with and without sudo priviledges.
Do you have an idea?Thankyou in advance
-
@ess
Hi,
As the system suggests, your program lacks execution privileges.chmod +x *
-
@ess
Hi,
As the system suggests, your program lacks execution privileges.chmod +x *
-
@veye_xumm
Thank you so much! -
I am sorry, but I have a further question.
I wanted to rotate the image from the sensor, from portrait to landscape.
The data sheet mentions the possibility to specify a resolution of 1280x1080@max45fps which is what I need but the images are 1080x1280.
How do you set the rotation?
I have tried it via specifying the resolution's as mentioned in my first post (this time without the Permission denied error), and tried the flipping and mirroring described in 3.33 imagedir.Greetings and thanks in advance
-
@ess said in cs-mipi-sc132 landscape-portrait orientation, cs_mipi_i2c.sh Permission denied:
How do you set the rotation?
Use videofmt cmd, for example./cs_mipi_i2c.sh -w -f videofmt -p1 1080 -p2 1280 -p3 45 -b [your bus number]
I have tried it via specifying the resolution's as mentioned in my first post (this time without the Permission denied error), and tried the flipping and mirroring described in 3.33 imagedir.
This cannot be rotated by 90° or 270°.
-
@veye_xumm I am sorry but I still have issues.
It seems to me like the videofmt function is not working properly. I can change the UYVY to YUYV and back with:
$ ./cs_mipi_i2c.sh -w -f yuvseq -p1 UYVY -b 8 $ ./cs_mipi_i2c.sh -w -f yuvseq -p1 YUYV -b 8
but with vodepfmt in different versions
$ ./cs_mipi_i2c.sh -w -f videofmt -p1 1080 -p2 1280 -p3 45 -b 8 $ ./cs_mipi_i2c.sh -w -f videofmt -p1 1280 -p2 1080 -p3 45 -b 8
or even
$ ./cs_mipi_i2c.sh -w -f videofmt -p1 480 -p2 640 -p4 45 -b 8
the resolution allays stays 1080 in width and 1280 in height. It is not affected by the function.
I am grabbing and saving the images with a python script:import cv2 cam =0 # and 1 vid = cv2.VideoCapture(cam) ret, frame = vid.read() cv2.imwrite(f'cam{cam}.png',frame) vid.release() cv2.destroyAllWindows()
I also tried
$ v4l2-ctl --device /dev/video0 --stream-mmap --stream-to=frame_0.raw --stream-count=1 $ convert -size 1080x1280 -depth 8 uyvy:frame_0.raw frame_0.png
and
$ convert -size 1280x1080 -depth 8 uyvy:frame_0.raw frame_0.png
but I get wrongly interpreted images.
Do you have an idea? Can I provide you with more Information?
-
@ess
How did you determine that it was not effective after performing the following operation?./cs_mipi_i2c.sh -w -f videofmt -p1 1080 -p2 1280 -p3 45 -b 8
Did you try reading the parameters back?
./cs_mipi_i2c.sh -r -f videofmt -b 8
Please try this operation above.
When you try to get the image, the driver will be called and the driver will modify the working resolution of the camera according to the parameters passed down from the application layer, so you need to configure the resolution when you get the image.
For example:gst-launch-1.0 nvv4l2camerasrc ! "video/x-raw(memory:NVMM),format=(string)UYVY, width=(int)1280, height=(int)1080, framerate=(fraction)45/1" ! nvvidconv ! "video/x-raw(memory:NVMM),format=(string)I420" ! nvoverlaysink sync=false