Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Screen rotation with: RaspberryPi 4 & OctoDash & Waveshare 5inch DSI Display & PiCam v3 #4101

Open
maximweb opened this issue Jan 21, 2024 · 2 comments
Labels
support Something isn't working with the users setup

Comments

@maximweb
Copy link

What doesn't work?
I am currently setting up OctoPi & OctoDash for the first time. It took me some hours to figure out how to rotate my screen and simultaneously use my camera. So this is more of a small guide rather than an issue. Maybe this would be relevant information for the Wiki?

General Information:

  • Hardware
    • Raspberry Pi 4B 2GB
    • Waveshare 5inch DSI LCD with Capacitive Touch (Shop / Wiki)
    • Raspberry Pi Camera 3
  • OS Info: Build 2023.10.09.154319 with "camera-streamer", based on OctoPi 1.0.0
  • OctoDash Version: v2.3.1
  • OctoPrint Version: 1.9.3

What did you already try?
Out of the box, the camera was found and OctoDash started without any issues. But due to my setup, I wanted to rotate the screen and obviously touch by 180 degrees.

There are so many different information out there, some official, some on reddit or other interesting forums. So my initial solution consisted of the dislay's wiki information using

# in /boot/config.txt
dtoverlay=vc4-kms-v3d
dtoverlay=vc4-kms-dsi-7inch

But then display_lcd_rotate does not work anymore. So I could go down the rabbit hole of changing the X-Server configuration.

Another option that (partially) worked, was NOT using above commands, but rather:

# in /boot/config.txt
display_auto_detect=1
display_lcd_rotate=2
dtoverlay=rpi-ft5406,touchscreen-inverted-x=1,touchscreen-inverted-y=1
#dtoverlay=vc4-kms-v3d
#dtoverlay=vc4-kms-dsi-7inch

This worked well for the screen and touch rotation, but then my camera stopped working. (It was detected by libcamera-hello --list-cameras, but the camera streamer logged: [0:03:06.873025556] [1566] ERROR V4L2 v4l2_videodevice.cpp:1906 /dev/video1[25:cap]: Failed to start streaming: Input/output error

So i finally got it to work following the official Pi documentation (which unfortunately was not in the top Google search results):

# in /boot/config.txt
#display_auto_detect=1
#display_lcd_rotate=2
dtoverlay=vc4-kms-v3d
dtoverlay=vc4-kms-dsi-7inch,invx,invy

The options for vc4-kms-dsi-7inch (invx,invy) rotate the touch, NOT the screen.

Rotating the screen itself: Add video=DSI-1:800x480@60,rotate=180 to /boot/cmdline.txt at the end of the line, separated by space.

This is nice, because I do not need to fiddle with X-server settings. Maybe this is helpful for others.

PS: Can anybody point me to a comprehensive and reliable documentation of Pi video settings, including

  • what are the differences between the different dtoverly drivers/modules(?), e.g. vc4-kms-v3d, vc4-fkms-v3d, vc4-kms-dsi-7inch, rpi-ft5406, ...
  • how do additional options in config.txt interact with theres modules, e.g. display_auto_detect=1, display_lcd_rotate=2, etc.

I set up a Pi every other years or so. And every single time it turns out to be a pain to get everything just right.

@maximweb maximweb added the support Something isn't working with the users setup label Jan 21, 2024
@quattroerik
Copy link

Having since 2 years the same issue, my printer was running with
dtoverlay=rpi-ft5406,touchscreen-inverted-x=1,touchscreen-inverted-y=1
-> but no camera.
Now i decided to change that and found your post.

I have changed everything, but following happens:
With dtoverlay=vc4-kms-v3d the touch screen stops working, but then the campera works. If i disable it, camera dissapears and the screen can not be roatated.

@maximweb
Copy link
Author

Hi @quattroerik ,

it's been a while since I wrote my initial findings. I am not sure why or at what point I made more changes, but my current configuration (rotated screen and touch + camera working) looks like this:

These are all uncommented entries in my /boot/config.txt. Only the first block should be related to screen and camera.

dtoverlay=imx708
dtoverlay=vc4-kms-v3d-pi4,cma-256
dtoverlay=vc4-kms-dsi-7inch,invx,invy
max_framebuffers=2
disable_overscan=1
[pi4]
arm_boost=1
[all]
start_x=1
gpu_mem=256
dtoverlay=gpio-fan,gpiopin=14,temp=60000

And my /boot/cmdline.txt:

console=serial0,115200 console=tty1 root=PARTUUID=5cb012f8-02 rootfstype=ext4 fsck.repair=yes rootwait cfg80211.ieee80211_regdom=DE video=DSI-1:800x480@60,rotate=180

But I still have no clue what most of it means :/

I hope this helps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
support Something isn't working with the users setup
Projects
None yet
Development

No branches or pull requests

2 participants