mrmrmrmr
Posts: 7
Joined: Fri Dec 07, 2018 12:31 pm

Raspberry Pi 3 B+ Reverting back to HDMI display

Fri Dec 07, 2018 12:40 pm

Hi,

I've installed a 3.5" LCD screen on my Raspberry Pi B4 board.
To activate the screen I used the "LCD-show" scripts and driver from:
https://github.com/goodtft/LCD-show/wiki

It works fine. But I don't know how to revert back to HDMI display from LCD and I could not find any information on this.

I tried the dual screen method described here:
https://www.youtube.com/watch?v=d2ouG1VmD88

But when I do that, both screens fail.
If I copy the original 99-fbturbo-conf from LCD-show , I can go to the LCD setup and it works.
But how can I make HDMI work again ?

thanks.

Andyroo
Posts: 2978
Joined: Sat Jun 16, 2018 12:49 am
Location: Lincs U.K.

Re: Raspberry Pi 3 B+ Reverting back to HDMI display

Fri Dec 07, 2018 2:23 pm

I do not think you can on that copy of your OS.

Going by the comments on this thread https://github.com/goodtft/LCD-show/issues/91 core config files are changed with no backups being made!

You could try picking through the source code to see what’s added, changed and deleted :o :shock: :o
Need Pi spray - these things are breeding in my house...

mrmrmrmr
Posts: 7
Joined: Fri Dec 07, 2018 12:31 pm

Re: Raspberry Pi 3 B+ Reverting back to HDMI display

Fri Dec 07, 2018 9:08 pm

ok but what are the default config files to make HDMI primary for display ?
there must be some defaults.

DirkS
Posts: 9807
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: Raspberry Pi 3 B+ Reverting back to HDMI display

Fri Dec 07, 2018 9:23 pm

If you're using the 'goodtft' stuff from https://github.com/goodtft/LCD-show can't you just run LCD-hdmi?

Andyroo
Posts: 2978
Joined: Sat Jun 16, 2018 12:49 am
Location: Lincs U.K.

Re: Raspberry Pi 3 B+ Reverting back to HDMI display

Fri Dec 07, 2018 9:29 pm

Have you looked at https://github.com/goodtft/LCD-show/blo ... /README.md ? As there seems to be a command to reset it back:

Code: Select all

sudo ./LCD-hdmi
Looking at the code for this https://github.com/goodtft/LCD-show/blo ... r/LCD-hdmi there are only a few files altered so you may be able to unpick the changes.. Crulest thing is that it would have taken seconds to add a backup to the commands.

Note though this has only been updated to support Raspbian March 2018 (Release date:2018-03-13) in v1.7-20180320 so it may not work on your version if newer. Files in the repository will be very basic and may not match what yours where so this is a real use with care! What makes it worse is that any changes made since using the new display will be lost aswell :roll:

Last point - the restore does a reboot without telling you it’s needed at the start of the script.
Need Pi spray - these things are breeding in my house...

mrmrmrmr
Posts: 7
Joined: Fri Dec 07, 2018 12:31 pm

Re: Raspberry Pi 3 B+ Reverting back to HDMI display

Sat Dec 08, 2018 5:56 am

ok. I will try the LCD-hmi command.
But if goodtft is not a good way, what is the best practice for using LCD and then choosing between LCD /HDMI ?
Since I've installed Raspbian on this board just yesterday, I don't really care what I will lose when I reinstall. I just want to have a working setup for choosing between screens or making both display at the same time.

btw, is there a way to use the LCD screen just for one window output ? I mean, for example I want to run a Python code and it opens a window displaying a camera flow. Can I just point the LCD screen to show that window while HDMI displays full screen ?

mrmrmrmr
Posts: 7
Joined: Fri Dec 07, 2018 12:31 pm

Re: Raspberry Pi 3 B+ Reverting back to HDMI display

Sat Dec 08, 2018 12:59 pm

LCD-hdmi worked fine for reverting.
Now I am trying to mirror the screen (clone HDMI to LCD) and with the following X11 conf I am able to make both screens work.

However, since their screen size & resolution are different, I am not able to control anything on the LCD screen. If the HDMI is not connected I can not manage anything on desktop.
How can I scale the screen to be identical on both screens (HDMI and LCD)
Smaller icons and menu bars/items on LCD ?

My Xorg log file is also below.

Code: Select all

Section "Device"
        Identifier      "fb0"
        Driver          "fbturbo"
        Option          "fbdev" "/dev/fb0"

        Option          "SwapbuffersWait" "true"
EndSection

Section "Device"
        Identifier      "fb1"
        Driver          "fbturbo"
        Option          "fbdev" "/dev/fb1"

        Option          "SwapbuffersWait" "true"
EndSection

Section "Monitor"
    Identifier             "MonitorLCD"
    DisplaySize             76 48    # In millimeters
EndSection
Section "Monitor"
    Identifier             "MonitorHDMI"
   DisplaySize             950 600
EndSection

Section "Screen"
        Identifier      "HDMI"
        Device          "fb0"
        Monitor         "MonitorHDMI"
        Option          "Xinerama" "1"
        DefaultDepth 24
        SubSection "Display"
                # Viewport   0 0
                Depth     24
                Modes   "1920x1080" "1280x720"
                #Virtual 480 320
        EndSubSection
EndSection

Section "Screen"
        Identifier      "LCD"
        Device          "fb1"
        Monitor         "MonitorLCD"
        Option          "Xinerama" "1"
        DefaultDepth 16
        SubSection "Display"
                # Viewport   0 0
                Depth     16
                Modes   "480x320"
#               Modes   "1280x1024" "1024x768" "800x600"
                #Virtual 480 320
        EndSubSection
        SubSection "Display"
                # Viewport   0 0
                Depth     24
#               Modes   "480x320"
#               Modes   "1280x1024" "1024x768" "800x600"
        EndSubSection
EndSection

Section "ServerLayout"
        Identifier      "Default Layout"
        Screen          0 "HDMI"
        Screen          1 "LCD"
        Option       "Clone" "on"
        Option          "Xinerama" "off"
EndSection

logs:
root@raspberrypi:/var/log# cat Xorg.0.log
[ 2991.261]
X.Org X Server 1.19.2
Release Date: 2017-03-02
[ 2991.261] X Protocol Version 11, Revision 0
[ 2991.261] Build Operating System: Linux 4.9.41-v7+ armv7l Raspbian
[ 2991.261] Current Operating System: Linux raspberrypi 4.14.79-v7+ #1159 SMP Sun Nov 4 17:50:20 GMT 2018 armv7l
[ 2991.261] Kernel command line: 8250.nr_uarts=1 bcm2708_fb.fbwidth=1824 bcm2708_fb.fbheight=984 bcm2708_fb.fbswap=1 vc_mem.mem_base=0x3ec00000 vc_mem.mem_size=0x40000000 dwc_otg.lpm_enable=0 console=tty1 console=ttyS0,115200 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait fbcon=map:10 fbcon=font:ProFont6x11 logo.nologo
[ 2991.261] Build Date: 18 October 2017 04:55:30PM
[ 2991.261] xorg-server 2:1.19.2-1+rpt1+deb9u2 (https://www.debian.org/support)
[ 2991.261] Current version of pixman: 0.34.0
[ 2991.261] Before reporting problems, check http://wiki.x.org
to make sure that you have the latest version.
[ 2991.261] Markers: (--) probed, (**) from config file, (==) default setting,
(++) from command line, (!!) notice, (II) informational,
(WW) warning, (EE) error, (NI) not implemented, (??) unknown.
[ 2991.262] (==) Log file: "/var/log/Xorg.0.log", Time: Sat Dec 8 15:50:31 2018
[ 2991.262] (==) Using config directory: "/etc/X11/xorg.conf.d"
[ 2991.262] (==) Using system config directory "/usr/share/X11/xorg.conf.d"
[ 2991.263] (==) ServerLayout "Default Layout"
[ 2991.263] (**) |-->Screen "HDMI" (0)
[ 2991.263] (**) | |-->Monitor "MonitorHDMI"
[ 2991.264] (**) | |-->Device "fb0"
[ 2991.264] (**) |-->Screen "LCD" (1)
[ 2991.264] (**) | |-->Monitor "MonitorLCD"
[ 2991.264] (**) | |-->Device "fb1"
[ 2991.264] (**) Option "Xinerama" "off"
[ 2991.264] (==) Automatically adding devices
[ 2991.264] (==) Automatically enabling devices
[ 2991.264] (==) Automatically adding GPU devices
[ 2991.264] (==) Max clients allowed: 256, resource mask: 0x1fffff
[ 2991.264] (WW) The directory "/usr/share/fonts/X11/misc" does not exist.
[ 2991.264] Entry deleted from font path.
[ 2991.264] (WW) The directory "/usr/share/fonts/X11/cyrillic" does not exist.
[ 2991.264] Entry deleted from font path.
[ 2991.265] (WW) The directory "/usr/share/fonts/X11/75dpi/" does not exist.
[ 2991.265] Entry deleted from font path.
[ 2991.265] (WW) The directory "/usr/share/fonts/X11/Type1" does not exist.
[ 2991.265] Entry deleted from font path.
[ 2991.265] (WW) The directory "/usr/share/fonts/X11/75dpi" does not exist.
[ 2991.265] Entry deleted from font path.
[ 2991.265] (==) FontPath set to:
/usr/share/fonts/X11/100dpi/:unscaled,
/usr/share/fonts/X11/100dpi,
built-ins
[ 2991.265] (==) ModulePath set to "/usr/lib/xorg/modules"
[ 2991.265] (II) The server relies on udev to provide the list of input devices.
If no devices become available, reconfigure udev or disable AutoAddDevices.
[ 2991.265] (II) Loader magic: 0x1fbf40
[ 2991.265] (II) Module ABI versions:
[ 2991.265] X.Org ANSI C Emulation: 0.4
[ 2991.265] X.Org Video Driver: 23.0
[ 2991.265] X.Org XInput driver : 24.1
[ 2991.265] X.Org Server Extension : 10.0
[ 2991.267] (++) using VT number 7

[ 2991.268] (II) systemd-logind: logind integration requires -keeptty and -keeptty was not provided, disabling logind integration
[ 2991.268] (II) no primary bus or device found
[ 2991.268] (II) LoadModule: "glx"
[ 2991.269] (II) Loading /usr/lib/xorg/modules/extensions/libglx.so
[ 2991.273] (II) Module glx: vendor="X.Org Foundation"
[ 2991.273] compiled for 1.19.2, module version = 1.0.0
[ 2991.273] ABI class: X.Org Server Extension, version 10.0
[ 2991.274] (II) LoadModule: "fbturbo"
[ 2991.274] (II) Loading /usr/lib/xorg/modules/drivers/fbturbo_drv.so
[ 2991.274] (II) Module fbturbo: vendor="X.Org Foundation"
[ 2991.274] compiled for 1.19.2, module version = 0.5.1
[ 2991.274] Module class: X.Org Video Driver
[ 2991.274] ABI class: X.Org Video Driver, version 23.0
[ 2991.274] (II) FBTURBO: driver for framebuffer: fbturbo
[ 2991.275] (WW) Falling back to old probe method for fbturbo
[ 2991.275] (II) Loading sub module "fbdevhw"
[ 2991.275] (II) LoadModule: "fbdevhw"
[ 2991.275] (II) Loading /usr/lib/xorg/modules/libfbdevhw.so
[ 2991.275] (II) Module fbdevhw: vendor="X.Org Foundation"
[ 2991.275] compiled for 1.19.2, module version = 0.0.2
[ 2991.275] ABI class: X.Org Video Driver, version 23.0
[ 2991.275] (II) FBTURBO(0): using /dev/fb0
[ 2991.275] (II) FBTURBO(1): using /dev/fb1
[ 2991.275] (WW) VGA arbiter: cannot open kernel arbiter, no multi-card support
[ 2991.275] (**) FBTURBO(0): Depth 24, (--) framebuffer bpp 32
[ 2991.275] (==) FBTURBO(0): RGB weight 888
[ 2991.275] (==) FBTURBO(0): Default visual is TrueColor
[ 2991.276] (==) FBTURBO(0): Using gamma correction (1.0, 1.0, 1.0)
[ 2991.276] (II) FBTURBO(0): hardware: BCM2708 FB (video memory: 7011kB)
[ 2991.276] (**) FBTURBO(0): Option "fbdev" "/dev/fb0"
[ 2991.276] (**) FBTURBO(0): Option "SwapbuffersWait" "true"
[ 2991.276] (II) FBTURBO(0): processor: Unknown
[ 2991.276] (II) FBTURBO(0): checking modes against framebuffer device...
[ 2991.276] (II) FBTURBO(0): mode "1920x1080" ok
[ 2991.276] (II) FBTURBO(0): mode "1280x720" not found
[ 2991.276] (II) FBTURBO(0): checking modes against monitor...
[ 2991.276] (--) FBTURBO(0): Virtual size is 1824x984 (pitch 1824)
[ 2991.276] (**) FBTURBO(0): Built-in mode "current"
[ 2991.276] (**) FBTURBO(0): Display dimensions: (950, 600) mm
[ 2991.276] (**) FBTURBO(0): DPI set to (48, 41)
[ 2991.276] (II) Loading sub module "fb"
[ 2991.276] (II) LoadModule: "fb"
[ 2991.277] (II) Loading /usr/lib/xorg/modules/libfb.so
[ 2991.277] (II) Module fb: vendor="X.Org Foundation"
[ 2991.277] compiled for 1.19.2, module version = 1.0.0
[ 2991.277] ABI class: X.Org ANSI C Emulation, version 0.4
[ 2991.277] (**) FBTURBO(1): Depth 16, (--) framebuffer bpp 16
[ 2991.277] (==) FBTURBO(1): RGB weight 565
[ 2991.277] (==) FBTURBO(1): Default visual is TrueColor
[ 2991.277] (==) FBTURBO(1): Using gamma correction (1.0, 1.0, 1.0)
[ 2991.277] (II) FBTURBO(1): hardware: fb_ili9486 (video memory: 300kB)
[ 2991.277] (**) FBTURBO(1): Option "fbdev" "/dev/fb1"
[ 2991.277] (**) FBTURBO(1): Option "SwapbuffersWait" "true"
[ 2991.277] (II) FBTURBO(1): processor: Unknown
[ 2991.277] (II) FBTURBO(1): checking modes against framebuffer device...
[ 2991.278] (II) FBTURBO(1): mode "480x320" not found
[ 2991.278] (II) FBTURBO(1): checking modes against monitor...
[ 2991.278] (--) FBTURBO(1): Virtual size is 480x320 (pitch 480)
[ 2991.278] (**) FBTURBO(1): Built-in mode "current"
[ 2991.278] (**) FBTURBO(1): Display dimensions: (76, 48) mm
[ 2991.278] (**) FBTURBO(1): DPI set to (160, 169)
[ 2991.278] (II) Loading sub module "fb"
[ 2991.278] (II) LoadModule: "fb"
[ 2991.278] (II) Loading /usr/lib/xorg/modules/libfb.so
[ 2991.278] (II) Module fb: vendor="X.Org Foundation"
[ 2991.278] compiled for 1.19.2, module version = 1.0.0
[ 2991.278] ABI class: X.Org ANSI C Emulation, version 0.4
[ 2991.278] (==) Depth 24 pixmap format is 32 bpp
[ 2991.279] (II) FBTURBO(0): using backing store heuristics
[ 2991.285] (II) FBTURBO(0): can't load 'g2d_23' kernel module
[ 2991.285] (II) FBTURBO(0): failed to enable the use of sunxi display controller
[ 2991.285] (II) FBTURBO(0): No sunxi-g2d hardware detected (check /dev/disp and /dev/g2d)
[ 2991.285] (II) FBTURBO(0): G2D hardware acceleration can't be enabled
[ 2991.285] (II) FBTURBO(0): enabled fbdev copyarea acceleration
[ 2991.285] (==) FBTURBO(0): Backing store enabled
[ 2991.286] (==) FBTURBO(0): DPMS enabled
[ 2991.286] (II) FBTURBO(0): failed to enable hardware cursor
[ 2991.286] (II) FBTURBO(0): no 3D acceleration because the driver has been compiled without libUMP
[ 2991.286] (II) FBTURBO(0): if this is wrong and needs to be fixed, please check ./configure log
[ 2991.286] (==) RandR enabled
[ 2991.286] (II) FBTURBO(1): FBIOBLANK: Invalid argument (Screen blanking not supported by kernel - disabling)
[ 2991.287] (II) FBTURBO(1): using backing store heuristics
[ 2991.292] (II) FBTURBO(1): can't load 'g2d_23' kernel module
[ 2991.292] (II) FBTURBO(1): failed to enable the use of sunxi display controller
[ 2991.292] (II) FBTURBO(1): No sunxi-g2d hardware detected (check /dev/disp and /dev/g2d)
[ 2991.292] (II) FBTURBO(1): G2D hardware acceleration can't be enabled
[ 2991.292] (II) FBTURBO(1): enabled VFP/NEON optimizations
[ 2991.293] (==) FBTURBO(1): Backing store enabled
[ 2991.293] (==) FBTURBO(1): DPMS enabled
[ 2991.293] (II) FBTURBO(1): failed to enable hardware cursor
[ 2991.293] (II) FBTURBO(1): no 3D acceleration because the driver has been compiled without libUMP
[ 2991.293] (II) FBTURBO(1): if this is wrong and needs to be fixed, please check ./configure log
[ 2991.293] (==) RandR enabled
[ 2991.314] (II) SELinux: Disabled on system
[ 2991.317] (II) AIGLX: Screen 0 is not DRI2 capable
[ 2991.317] (EE) AIGLX: reverting to software rendering
[ 2991.419] (II) IGLX: enabled GLX_MESA_copy_sub_buffer
[ 2991.421] (II) IGLX: Loaded and initialized swrast
[ 2991.421] (II) GLX: Initialized DRISWRAST GL provider for screen 0
[ 2991.421] (II) AIGLX: Screen 1 is not DRI2 capable
[ 2991.421] (EE) AIGLX: reverting to software rendering
[ 2991.424] (II) IGLX: enabled GLX_MESA_copy_sub_buffer
[ 2991.426] (II) IGLX: Loaded and initialized swrast
[ 2991.426] (II) GLX: Initialized DRISWRAST GL provider for screen 1
[ 2991.560] (II) config/udev: Adding input device ADS7846 Touchscreen (/dev/input/event0)
[ 2991.561] (**) ADS7846 Touchscreen: Applying InputClass "evdev touchscreen catchall"
[ 2991.561] (**) ADS7846 Touchscreen: Applying InputClass "libinput touchscreen catchall"
[ 2991.561] (**) ADS7846 Touchscreen: Applying InputClass "evdev touchscreen catchall"
[ 2991.561] (**) ADS7846 Touchscreen: Applying InputClass "calibration"
[ 2991.561] (II) LoadModule: "evdev"
[ 2991.561] (II) Loading /usr/lib/xorg/modules/input/evdev_drv.so
[ 2991.562] (II) Module evdev: vendor="X.Org Foundation"
[ 2991.562] compiled for 1.19.0, module version = 2.10.5
[ 2991.562] Module class: X.Org XInput Driver
[ 2991.562] ABI class: X.Org XInput driver, version 24.1
[ 2991.562] (II) Using input driver 'evdev' for 'ADS7846 Touchscreen'
[ 2991.562] (**) ADS7846 Touchscreen: always reports core events
[ 2991.562] (**) evdev: ADS7846 Touchscreen: Device: "/dev/input/event0"
[ 2991.563] (--) evdev: ADS7846 Touchscreen: Vendor 0 Product 0
[ 2991.563] (--) evdev: ADS7846 Touchscreen: Found absolute axes
[ 2991.563] (--) evdev: ADS7846 Touchscreen: Found x and y absolute axes
[ 2991.563] (--) evdev: ADS7846 Touchscreen: Found absolute touchscreen
[ 2991.563] (**) Option "SwapAxes" "1"
[ 2991.563] (II) evdev: ADS7846 Touchscreen: Configuring as touchscreen
[ 2991.563] (**) evdev: ADS7846 Touchscreen: YAxisMapping: buttons 4 and 5
[ 2991.563] (**) evdev: ADS7846 Touchscreen: EmulateWheelButton: 4, EmulateWheelInertia: 10, EmulateWheelTimeout: 200
[ 2991.563] (**) Option "config_info" "udev:/sys/devices/platform/soc/3f204000.spi/spi_master/spi0/spi0.1/input/input0/event0"
[ 2991.563] (II) XINPUT: Adding extended input device "ADS7846 Touchscreen" (type: TOUCHSCREEN, id 6)
[ 2991.563] (II) evdev: ADS7846 Touchscreen: initialized for absolute axes.
[ 2991.564] (**) ADS7846 Touchscreen: (accel) keeping acceleration scheme 1
[ 2991.564] (**) ADS7846 Touchscreen: (accel) acceleration profile 0
[ 2991.564] (**) ADS7846 Touchscreen: (accel) acceleration factor: 2.000
[ 2991.564] (**) ADS7846 Touchscreen: (accel) acceleration threshold: 4
[ 2991.566] (II) config/udev: Adding input device ADS7846 Touchscreen (/dev/input/mouse0)
[ 2991.566] (**) ADS7846 Touchscreen: Applying InputClass "calibration"
[ 2991.566] (II) No input driver specified, ignoring this device.
[ 2991.566] (II) This device may have been added with another device file.


User avatar
MeneerJansen
Posts: 21
Joined: Sat May 14, 2016 1:51 pm

Re: Raspberry Pi 3 B+ Reverting back to HDMI display

Sun Apr 07, 2019 12:50 pm

mrmrmrmr wrote:
Mon Dec 10, 2018 6:07 am
any ideas ?
After successfully installing the LCD screen on my Pi I can't switch back to HDMI either. The script named "LCD-hdmi" that should enable this does NOT work. :(

Andyroo
Posts: 2978
Joined: Sat Jun 16, 2018 12:49 am
Location: Lincs U.K.

Re: Raspberry Pi 3 B+ Reverting back to HDMI display

Sun Apr 07, 2019 5:34 pm

I would assume something in the files have changed. My original post did note no backup of them where made before the code tramples all over them.

The simplest thing if the owner of the code is not keeping it up to date would be to make a new SD card with plain old HDMI support, take the files of this and move them over to the normal card you use with new names. Then backup the ones with the working small display and you can then copy the files over as needed.

Sorry - did I say simple :o Seems a daft solution and one that is liable to break again the next time these files get updated!

Maybe you could folk the code and change it to make backups? You then only have to worry about updates though...
Need Pi spray - these things are breeding in my house...

User avatar
MeneerJansen
Posts: 21
Joined: Sat May 14, 2016 1:51 pm

Re: Raspberry Pi 3 B+ Reverting back to HDMI display

Mon Apr 08, 2019 11:24 am

Andyroo wrote:
Sun Apr 07, 2019 5:34 pm
I would assume something in the files have changed. My original post did note no backup of them where made before the code tramples all over them.

The simplest thing if the owner of the code is not keeping it up to date would be to make a new SD card with plain old HDMI support, take the files of this and move them over to the normal card you use with new names. Then backup the ones with the working small display and you can then copy the files over as needed.

Sorry - did I say simple :o Seems a daft solution and one that is liable to break again the next time these files get updated!

Maybe you could folk the code and change it to make backups? You then only have to worry about updates though...
I'm going to look at the script that starts the LCD screen (LCD35-show) to determine what it changes. Then copy those files from an other Raspbian SD card. Maybe that'll help.

User avatar
MeneerJansen
Posts: 21
Joined: Sat May 14, 2016 1:51 pm

Re: Raspberry Pi 3 B+ Reverting back to HDMI display

Mon Apr 08, 2019 3:13 pm

Okay, here's what I did to get my HDMI screen working again. At first I tried to use the script LCD-hdmi which is the script that one is supposed to use to switch back to HDMI from the 3.5" LCD screen. It's one of the files from https://github.com/goodtft/LCD-show you have to download to your Pi and use in combination w/ the 3.5" screen. That wretched script does not "undo" all the work done by LCD35-show (used to activate the 3.5" LCD screen) and it also copies a file it shouldn't (/etc/modules). So I deleted from my Pi:

  • /etc/modules
  • /usr/share/X11/xorg.conf.d/99-fbturbo.conf
  • /etc/X11/xorg.conf.d/99-calibration.conf
Delete those! Reboot, startx and you might be fine if you're lucky. I rewrote the scripts that switch back and forth to the 3.5" screen for myself. As some of you might know the LCD35-show script doesn't work either because it creates an incomplete file called /etc/X11/xorg.conf.d/99-calibration.conf. That file should (also) contain the following text (also notice the added line "Option "TransformationMatrix" "0 -1 1 1 0 0 0 0 1"", else touch screen pen works inverted):

Code: Select all

# This is the file /etc/X11/xorg.conf.d/99-calibration.conf

Section "InputClass"
        Identifier      "calibration"
        MatchProduct    "ADS7846 Touchscreen"
        Option  "Calibration"   "3936 227 268 3880"
        Option  "SwapAxes"      "1"
         # Hat trick to get the pen to work properly on the touch screen:
        Option "TransformationMatrix" "0 -1 1 1 0 0 0 0 1"
EndSection

Section "Device" 
   # WaveShare SpotPear 3.5", framebuffer 1
   Identifier "uga" 
   driver "fbdev" 
   Option "fbdev" "/dev/fb1" 
   Option "ShadowFB" "off"
EndSection 

Section "Monitor" 
   # Primary monitor. WaveShare SpotPear 480x320
   Identifier "WSSP" 
EndSection 

Section "Screen" 
   Identifier "primary" 
   Device "uga" 
   Monitor "WSSP" 
EndSection 

Section "ServerLayout" 
   Identifier "default" 
   Screen 0 "primary" 0 0 
EndSection

Anyway, here are the scripts and files that I use to switch back and forth from HDMI to my 3.5" LCD screen on Raspbian 9.8 (code name Stretch). I'm afraid it won't work on older and newer Raspbian versions.!

  1. Pastebin link to LCD35-show (place in /home/pi/LCD-show/)
  2. Pastebin link to LCD-hdmi (place in /home/pi/LCD-show/)
  3. Pastebin link to 99-calibration.conf-35 (place in: /home/pi/LCD-show/usr/)

Replace the ones that came from Github w/ those and don't forget to make them executable. Then pray it works. ;)

P.S. If you deleted your /etc/modules file then replace it with this one:

Code: Select all

# /etc/modules: kernel modules to load at boot time.
#
# This file contains the names of kernel modules that should be loaded
# at boot time, one per line. Lines beginning with "#" are ignored.

i2c-dev

User avatar
MeneerJansen
Posts: 21
Joined: Sat May 14, 2016 1:51 pm

Re: Raspberry Pi 3 B+ Reverting back to HDMI display

Fri Apr 12, 2019 1:46 pm

Most recent version of my procedure, scripts etc. here: viewtopic.php?f=45&t=238060

Bye :)

Return to “Troubleshooting”