MagicMirror² v2.13.0 is available! For more information about this release, check out this topic.

4 inch RPi LCD displaying MM not working



  • I’ve looked everywhere I can and I am stuck. I have a Raspberry Pi Zero W that I’m using for Magic Mirror. Via HDMI, it works perfectly. All modules come up and it looks very clean. I was given a 4in LCD that plugs into the GPIO port. I thought, I could use that to build into a frame and have a small desktop MM. For the life of me, I can only get the cmd line to display on the LCD. Somewhere along the line, I did manage to get it to pull up the css page, but it was just black screen and it would flash every 20 seconds or so. The screen is a 4 inch RPi LCD (A) 320x480 XPT2046 Touch Controller

    I have installed LCD-show and and installed LCD35-show. Any help anyone can lend would be greatly appreciated.


  • Module Developer

    @aecandroid said in 4 inch RPi LCD displaying MM not working:

    LCD-show and and installed LCD35-show.

    THese “drivers” are honestly a mess and not very helpful.
    If the screen is connected via hdmi, installing LCD-Show might even set the wrong config options.
    Have you had a look on the website of waveshare who are distributing these?
    https://www.waveshare.com/wiki/4inch_HDMI_LCD

    I doubt your 4inch screen has a native resolution of 320*480.


  • Module Developer

    @lavolp3 Or this one

    https://www.waveshare.com/wiki/4inch_RPi_LCD_(A)

    Well they are using the LCD-show “drivers”.
    I might be preoccupied since I have had my own fight with these drivers.
    But at least they have a good wiki.



  • @lavolp3 thanks for taking the time to reply. Unfortunately, this site hasn’t helped much. When I plug in via HDMI to my tele, everything works perfectly. However the small LCD screen does not use HDMI. Instead, it plugs into the GPIO. As for the resolution, this is what’s printed on the back of the screen so, all I can go by. I think I’m missing something in the /boot/config.txt that changes the video display from HDMI. Still no luck just yet.


  • Module Developer

    @aecandroid said in 4 inch RPi LCD displaying MM not working:

    Have you tried the installation from here?
    https://www.waveshare.com/wiki/4inch_RPi_LCD_(A)
    It should work with the waveshare description.
    Can you post your config.txt here or at least the last 10 rows?



  • @lavolp3 Below is my /boot/config.txt I used the drivers for LCD-show from the waveshare link above.I’ve done a fresh install on a new SD got everything up an running on Magic Mirror using HDMI as normal on the Raspberry PI Zero W. Then I do the LCD-show install and ./LCD4-show command. The device reboots and the LCD goes from white backlight to showing the boot cmd line. From there, it almost appears to get stuck. instead of seeing the pi@raspberry: the last line displayed is [ ok ] Started OpenBSD Secure Shell Server.

    Thanks again for your help. Let me know if you need to see any other code.

    # For more options and information see
    # http://www.raspberrypi.org/documentation/configuration/config-txt.md
    # Some settings may impact device functionality. See link above for details
    
    # uncomment if you get no picture on HDMI for a default "safe" mode
    #hdmi_safe=1
    
    # uncomment this if your display has a black border of unused pixels visible
    # and your display can output without overscan
    #disable_overscan=1
    
    # uncomment the following to adjust overscan. Use positive numbers if console
    # goes off screen, and negative if there is too much border
    #overscan_left=16
    #overscan_right=16
    #overscan_top=16
    #overscan_bottom=16
    
    # uncomment to force a console size. By default it will be display's size minus
    # overscan.
    #framebuffer_width=1280
    #framebuffer_height=720
    
    # uncomment if hdmi display is not detected and composite is being output
    hdmi_force_hotplug=1
    
    # uncomment to force a specific HDMI mode (this will force VGA)
    #hdmi_group=1
    #hdmi_mode=1
    
    # uncomment to force a HDMI mode rather than DVI. This can make audio work in
    # DMT (computer monitor) modes
    #hdmi_drive=2
    
    # uncomment to increase signal to HDMI, if you have interference, blanking, or
    # no display
    #config_hdmi_boost=4
    
    # uncomment for composite PAL
    #sdtv_mode=2
    
    #uncomment to overclock the arm. 700 MHz is the default.
    #arm_freq=800
    
    # Uncomment some or all of these to enable the optional hardware interfaces
    dtparam=i2c_arm=on
    #dtparam=i2s=on
    dtparam=spi=on
    enable_uart=1
    # Uncomment this to enable the lirc-rpi module
    #dtoverlay=lirc-rpi
    
    # Additional overlays and parameters are documented /boot/overlays/README
    
    # Enable audio (loads snd_bcm2835)
    dtparam=audio=on
    dtoverlay=waveshare35a
    #dtoverlay=ads7846,cs=1,penirq=17,penirq_pull=2,speed=1000000,keep_vref_on=1,swapxy=0,pmax=255,xohms=60,xmin=200,xmax=3900,ymin=200,ymax=3900
    hdmi_force_hotplug=1
    #max_usb_current=1
    hdmi_group=2
    hdmi_mode=1
    hdmi_mode=87
    hdmi_cvt 480 320 60 6 0 0 0
    hdmi_drive=2
    display_rotate=0
    
    


  • @aecandroid @lavolp3 So Just as an update, I tried to run ./LCD-hdmi and then sudo reboot. Plugged into the HDMI, the Pi reboots, LCD in the GPIO goes white, Pi boots to pi@raspberry: and does not start MM. The only change is the install of LCD-show; change driver to LCD4-show; back to LCD-hdmi; and MagicMirror no longer works? I even tried doing npm start in /MagicMirror and got nothing. I also tried sh mm.sh and got nothing. I don’t get what happens in the LCD-show install but it kills MagicMirror. I have a backup image of when its working on HDMI, so that’s my reset point at the moment. Not sure what to do, may just need to go for an HDMI display in the end. Anyway, thanks again for your help and suggestions.



  • Having been in quarantine, I’ve had a chance to sit down and try to sus out the issue. Everything seems to work 100% fine right up until I install LCD-show. After installing LCD-show and doing a reboot, MM never auto starts. I tried to run ./mmstart.sh and the results are below.

    
    Linux raspberrypi 4.19.58+ #1245 Fri Jul 12 17:20:08 BST 2019 armv6l
    
    The programs included with the Debian GNU/Linux system are free software;
    the exact distribution terms for each program are described in the
    individual files in /usr/share/doc/*/copyright.
    
    Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
    permitted by applicable law.
    Last login: Sat Apr 11 19:25:01 2020
    
    SSH is enabled and the default password for the 'pi' user has not been changed.
    This is a security risk - please login as the 'pi' user and type 'passwd' to set a new password.
    
    pi@raspberrypi:~ $ ls
    chromium_start.sh  mmstart.sh                         package-lock.json
    LCD-show           node-v10.16.0-linux-armv6l
    MagicMirror        node-v10.16.0-linux-armv6l.tar.xz
    pi@raspberrypi:~ $ ./mmstart.sh
    Starting MagicMirror: v2.8.0
    Loading config ...
    Loading module helpers ...
    No helper found for module: alert.
    No helper found for module: clock.
    Initializing new module helper ...
    Module helper loaded: calendar
    No helper found for module: MMM-TFL.
    No helper found for module: currentweather.
    No helper found for module: weatherforecast.
    Initializing new module helper ...
    Module helper loaded: MMM-UKNationalRail
    All module helpers loaded.
    Starting server on port 8080 ... 
    Server started ...
    Connecting socket for: calendar
    Starting node helper for: calendar
    Connecting socket for: MMM-UKNationalRail
    MMM-UKNationalRail helper started ...
    Sockets connected & modules started ...
    
    Ready to go! Please point your browser to: http://localhost:8080
    Whoops! There was an uncaught exception...
    { Error: listen EADDRINUSE: address already in use 127.0.0.1:8080
        at Server.setupListenHandle [as _listen2] (net.js:1279:14)
        at listenInCluster (net.js:1327:12)
        at GetAddrInfoReqWrap.doListen [as callback] (net.js:1460:7)
        at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:61:10)
      code: 'EADDRINUSE',
      errno: 'EADDRINUSE',
      syscall: 'listen',
      address: '127.0.0.1',
      port: 8080 }
    MagicMirror will not quit, but it might be a good idea to check why this happened. Maybe no internet connection?
    If you think this really is an issue, please open an issue on GitHub: https://github.com/MichMich/MagicMirror/issues
    
    
    X.Org X Server 1.20.4
    X Protocol Version 11, Revision 0
    Build Operating System: Linux 4.15.0-48-generic armv8l Raspbian
    Current Operating System: Linux raspberrypi 4.19.58+ #1245 Fri Jul 12 17:20:08 BST 2019 armv6l
    Kernel command line: coherent_pool=1M 8250.nr_uarts=1 bcm2708_fb.fbwidth=480 bcm2708_fb.fbheight=320 bcm2708_fb.fbswap=1 smsc95xx.macaddr=B8:27:EB:B2:0B:D5 vc_mem.mem_base=0x1ec00000 vc_mem.mem_size=0x20000000  dwc_otg.lpm_enable=0 console=ttyS0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait fbcon=map:10 fbcon=font:ProFont6x11 logo.nologo
    Build Date: 05 June 2019  12:49:54PM
    xorg-server 2:1.20.4-1+rpt1 (https://www.debian.org/support) 
    Current version of pixman: 0.36.0
            Before reporting problems, check http://wiki.x.org
            to make sure that you have the latest version.
    Markers: (--) probed, (**) from config file, (==) default setting,
            (++) from command line, (!!) notice, (II) informational,
            (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
    (==) Log file: "/var/log/Xorg.0.log", Time: Sat Apr 11 19:27:57 2020
    (==) Using system config directory "/usr/share/X11/xorg.conf.d"
    (EE) 
    Fatal server error:
    (EE) no screens found(EE) 
    (EE) 
    Please consult the The X.Org Foundation support 
             at http://wiki.x.org
     for help. 
    (EE) Please also check the log file at "/var/log/Xorg.0.log" for additional information.
    (EE) 
    (EE) Server terminated with error (1). Closing log file.
    xinit: giving up
    xinit: unable to connect to X server: Connection refused
    xinit: server error
    pi@raspberrypi:~ $
    
    
    

    I’ve attached copy of the Xorg.0.log. It appears the main issue is there is no screen selection or default monitor. Any help is greatly appreciated.

      GNU nano 3.2                     Xorg.0.log                                
    [  1272.263]
    X.Org X Server 1.20.4
    X Protocol Version 11, Revision 0
    [  1272.264] Build Operating System: Linux 4.15.0-48-generic armv8l Raspbian
    [  1272.264] Current Operating System: Linux raspberrypi 4.19.58+ #1245 Fri $[  1272.264] Kernel command line: coherent_pool=1M 8250.nr_uarts=1 bcm2708_f$[  1272.265] Build Date: 05 June 2019  12:49:54PM
    [  1272.265] xorg-server 2:1.20.4-1+rpt1 (https://www.debian.org/support)
    [  1272.265] Current version of pixman: 0.36.0
    [  1272.265]    Before reporting problems, check http://wiki.x.org
    ��������to make sure that you have the latest version.
    [  1272.265] Markers: (--) probed, (**) from config file, (==) default setti$��������(++) from command line, (!!) notice, (II) informational,
    ��������(WW) warning, (EE) error, (NI) not implemented, (??) unknown.
    [  1272.267] (==) Log file: "/var/log/Xorg.0.log", Time: Sat Apr 11 19:45:42$[  1272.269] (==) Using system config directory "/usr/share/X11/xorg.conf.d"
    [  1272.279] (==) No Layout section.  Using the first Screen section.
    [  1272.283] (==) No screen section available. Using defaults.
    [  1272.284] (**) |-->Screen "Default Screen Section" (0)
    [  1272.284] (**) |   |-->Monitor ""
    [  1272.288] (==) No device specified for screen "Default Screen Section".
    ��������Using the first device section listed.
    [  1272.288] (**) |   |-->Device "Allwinner A10/A13 FBDEV"
    [  1272.288] (==) No monitor specified for screen "Default Screen Section".
    ��������Using a default monitor configuration.
    [  1272.289] (==) Automatically adding devices
    [  1272.289] (==) Automatically enabling devices
    [  1272.289] (==) Automatically adding GPU devices
    [  1272.289] (==) Max clients allowed: 256, resource mask: 0x1fffff
    [  1272.290] (WW) The directory "/usr/share/fonts/X11/cyrillic" does not exi$[  1272.290]    Entry deleted from font path.
    [  1272.290] (WW) The directory "/usr/share/fonts/X11/100dpi/" does not exis$[  1272.290]    Entry deleted from font path.
    [  1272.290] (WW) The directory "/usr/share/fonts/X11/75dpi/" does not exist.[  1272.291]    Entry deleted from font path.
    [  1272.291] (WW) The directory "/usr/share/fonts/X11/Type1" does not exist.
    ������������������������������[ Read 76 lines ]
    ^G Get Help    ^O Write Out   ^W Where Is    ^K Cut Text    ^J Justify
    ^X Exit��������^R Read File   ^\ Replace     ^U Uncut Text  ^T To Spell
    
    


  • @aecandroid the lcd is probably not DISPLAY :0… which mm.sh sets.

    Boot, open terminal window and dump the env looking for display



  • @sdetweil thank you for your help.

    I’ve checked my mm.sh file and it reads as follows. Not sure where to go from here?

    
    cd ~/MagicMirror
    node serveronly &
    sleep 30
    xinit /home/pi/chromium_start.sh
    
    

Log in to reply