User avatar
HermannSW
Posts: 1387
Joined: Fri Jul 22, 2016 9:09 pm
Location: Eberbach, Germany
Contact: Website Twitter YouTube

How to run raspiraw on Pi with 7" DPI display?

Sun Jul 21, 2019 6:41 pm

I did clone latest raspiraw repo on my Pi 3A+:
https://github.com/6by9/raspiraw

Raspberry v1 camera works without issues, as well as v2 camera.
But I cannot get "/dev/i2c*" showing up, and without that raspiraw does not work:

Code: Select all

[email protected]:~/raspiraw $ ./camera_i2c 
setting GPIO for board revsion: 9020e0
Raspberry Pi3B / Pi3B+ / 3A / 4B(1G/2G/4G)
Set state of 133 to 1
Error: Could not open file `/dev/i2c-0' or `/dev/i2c/0': No such file or directory
[email protected]:~/raspiraw $ 

I have enabled I2C and Camera in raspi-config.
And have i2c-dev appended here:

Code: Select all

[email protected]:~/raspiraw $ tail -3 /etc/modules-load.d/modules.conf
# at boot time, one per line. Lines beginning with "#" are ignored.

i2c-dev
[email protected]:~/raspiraw $ 

I have this in /boot/config.txt:

Code: Select all

[email protected]:~/raspiraw $ grep i2c_vc /boot/config.txt 
dtparam=i2c_vc=on
[email protected]:~/raspiraw $ 

But i2c does not show up under /dev:

Code: Select all

[email protected]:~/raspiraw $ ls -l /dev/ | grep i2c
[email protected]:~/raspiraw $ 

Questions:
  1. Why does raspivid work without issues?
  2. What do I need to do to make Pi 3A+ show /dev/i2c* and/or get raspiraw to work?

Image
Last edited by HermannSW on Sun Jul 21, 2019 7:21 pm, edited 3 times in total.
⇨https://stamm-wilbrandt.de/en/Raspberry_camera.html

https://github.com/Hermann-SW/Raspberry_v1_camera_global_external_shutter
https://gitlab.freedesktop.org/HermannSW/gst-template
https://github.com/Hermann-SW/fork-raspiraw
https://twitter.com/HermannSW

User avatar
HermannSW
Posts: 1387
Joined: Fri Jul 22, 2016 9:09 pm
Location: Eberbach, Germany
Contact: Website Twitter YouTube

Re: How to run raspiraw on Pi with 7" DPI display?

Sun Jul 21, 2019 6:48 pm

I did not think on my today's change of display.
Just commented out the 7" DPI display stuff in /boot/config.txt and rebooted:

Code: Select all

[email protected]:~ $ tail -8 /boot/config.txt 

#dtoverlay=dpi24
#enable_dpi_lcd=1
#display_default_lcd=1
#dpi_group=2
#dpi_mode=87
#dpi_output_format=0x6f005
#hdmi_cvt 1024 600 60 6 0 0 0
[email protected]:~ $ 

Now /dev/i2c* shows up:

Code: Select all

[email protected]:~ $ ls -l /dev/i2c*
crw-rw---- 1 root i2c 89, 0 Jul 21 20:44 /dev/i2c-0
crw-rw---- 1 root i2c 89, 1 Jul 21 20:44 /dev/i2c-1
[email protected]:~ $ 

Does that mean I cannot use raspiraw with DPI display in use?

P.S:
I just prepared Pi 3B for vacation and enabled DPI display.
After rebooting there is no match for "/dev/i2c*" as well, but raspivid works fine.

P.P.S:
Perhaps dmesg information can help?

Code: Select all

[email protected]:~ $ dmesg | grep -i i2c
[    2.996391] i2c /dev entries driver
[    4.149726] pinctrl-bcm2835 3f200000.gpio: pin gpio0 already requested by leds; cannot claim for 3f205000.i2c
[    4.149744] pinctrl-bcm2835 3f200000.gpio: pin-0 (3f205000.i2c) status -22
[    4.149764] i2c-bcm2835 3f205000.i2c: Error applying setting, reverse things back
[    4.149787] i2c-bcm2835: probe of 3f205000.i2c failed with error -22
[    4.149856] pinctrl-bcm2835 3f200000.gpio: pin gpio2 already requested by leds; cannot claim for 3f804000.i2c
[    4.149866] pinctrl-bcm2835 3f200000.gpio: pin-2 (3f804000.i2c) status -22
[    4.149885] i2c-bcm2835 3f804000.i2c: Error applying setting, reverse things back
[    4.149899] i2c-bcm2835: probe of 3f804000.i2c failed with error -22
[email protected]:~ $ 

P.P.P.S:
The error messages do not appear after commenting out /boot/config.txt lines and rebooting:

Code: Select all

[email protected]:~ $ dmesg | grep -i i2c
[    2.737715] i2c /dev entries driver
[email protected]:~ $ 
⇨https://stamm-wilbrandt.de/en/Raspberry_camera.html

https://github.com/Hermann-SW/Raspberry_v1_camera_global_external_shutter
https://gitlab.freedesktop.org/HermannSW/gst-template
https://github.com/Hermann-SW/fork-raspiraw
https://twitter.com/HermannSW

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 7131
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: How to run raspiraw on Pi with 7" DPI display?

Sun Jul 21, 2019 9:14 pm

You need to tell linux via device tree to use gpios 44&45 for i2c0, rather than let it try to initialise on 0&1 and then use camera_i2c to change it.
Memory says that the i2c0-bcm2708 overlay allows you to change the pin mixing request via dt. Check the readme for details.

Raspivid is all done via the gpu, so it knows to remux the i2c gpios, and has no qualms over changing it underneath Linux's feet.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

Return to “Camera board”