Script to install Odroid LCD 3.5 Touchscreen Shield

Post Reply
Fourdee
Posts: 298
Joined: Fri Apr 03, 2015 5:01 am
languages_spoken: english
ODROIDs: C1 / C2 / XU4 + Cloudshell.
Has thanked: 0
Been thanked: 8 times
Contact:

Script to install Odroid LCD 3.5 Touchscreen Shield

Post by Fourdee »

This script will: Requires:
  • Debian Jessie or higher
  • Ubuntu 16.xx
  • Any Debian based OS with SystemD
See the scripts sourcecode: http://dietpi.com/downloads/misc/commun ... d_LCD35.sh

Download script:

Code: Select all

wget http://dietpi.com/downloads/misc/community/install_odroid_LCD35.sh -O install_odroid_LCD35.sh
chmod +x install_odroid_LCD35.sh
How to install for XU4:

Code: Select all

./install_odroid_LCD35.sh 0
How to install for C1+/C2

Code: Select all

./install_odroid_LCD35.sh 1
How do I disable the display?:

Code: Select all

systemctl disable odroid-lcd35
rm /etc/X11/xorg.conf.d/99-odroid-lcd35.conf

#+XU4
mv /etc/X11/exynos.conf /etc/X11/xorg.conf.d/exynos.conf
How do I calibrate the screen & inputs?:

Code: Select all

DISPLAY=:0 xinput_calibrator
Notes:
  • Many thanks to mad_ady for fix to power off screen during shutdown.
Last edited by Fourdee on Wed Dec 07, 2016 9:18 pm, edited 1 time in total.
These users thanked the author Fourdee for the post:
brickmaster (Sun Dec 19, 2021 10:15 pm)
http://DietPi.com - Lightweight justice for your Odroid.
DietPi web hosting is powered by http://MyVirtualServer.com

gkkpch
Posts: 336
Joined: Mon Feb 25, 2013 11:47 pm
languages_spoken: english, dutch, german
ODROIDs: Odroid N2+, Odroid C4,
Location: Switzerland
Has thanked: 4 times
Been thanked: 17 times
Contact:

Re: Script to install Odroid LCD 3.5 Touchscreen Shield

Post by gkkpch »

Thanks for sharing this, I will likely use parts of it for the C1/C2 Volumio images

-Gé-

User avatar
mad_ady
Posts: 11581
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4 (HC1, HC2), C1+, C2, C4 (HC4), N1, N2, N2L, H2, H3+, Go, Go Advance, M1
Location: Bucharest, Romania
Has thanked: 649 times
Been thanked: 1151 times
Contact:

Re: Script to install Odroid LCD 3.5 Touchscreen Shield

Post by mad_ady »

@odroid please move this in the accessories subforum to be easier to find

User avatar
odroid
Site Admin
Posts: 41542
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English, Korean
ODROIDs: ODROID
Has thanked: 3321 times
Been thanked: 1836 times
Contact:

Re: Script to install Odroid LCD 3.5 Touchscreen Shield

Post by odroid »

Has been moved. :)

phaseshifter
Posts: 3804
Joined: Fri May 08, 2015 9:12 am
languages_spoken: english
ODROIDs: U-2,U3+,,XU-3,,XU3-LITE,,XU-4
C1+,,C-2,,,n2+2G and n2 4G
cloudshell I and shell II
N-1,,N-2,...other odroid acc`s as well..vu7 etc..all sorts of sbc`s these days
Has thanked: 69 times
Been thanked: 52 times
Contact:

Re: Script to install Odroid LCD 3.5 Touchscreen Shield

Post by phaseshifter »

systemctl disable odroid-lcd35
rm /etc/X11/xorg.conf.d/99-odroid-lcd35.conf

to confirm running this code will give back the hdmi output..?? on my c1

ok i ran this code and now i got no display on the hdmi or lcd for that matter..
necessity the mother of all creation and invention..!!!..check out the world ...long live rock and roll.....

Fourdee
Posts: 298
Joined: Fri Apr 03, 2015 5:01 am
languages_spoken: english
ODROIDs: C1 / C2 / XU4 + Cloudshell.
Has thanked: 0
Been thanked: 8 times
Contact:

Re: Script to install Odroid LCD 3.5 Touchscreen Shield

Post by Fourdee »

phaseshifter wrote:ok i ran this code and now i got no display on the hdmi or lcd for that matter..
Bizzare, do you have an existing xorg.conf? Please paste contents.

Code: Select all

cat /etc/X11/xorg.conf
http://DietPi.com - Lightweight justice for your Odroid.
DietPi web hosting is powered by http://MyVirtualServer.com

phaseshifter
Posts: 3804
Joined: Fri May 08, 2015 9:12 am
languages_spoken: english
ODROIDs: U-2,U3+,,XU-3,,XU3-LITE,,XU-4
C1+,,C-2,,,n2+2G and n2 4G
cloudshell I and shell II
N-1,,N-2,...other odroid acc`s as well..vu7 etc..all sorts of sbc`s these days
Has thanked: 69 times
Been thanked: 52 times
Contact:

Re: Script to install Odroid LCD 3.5 Touchscreen Shield

Post by phaseshifter »

um sox i just reflashed my emmc i wil try give you the deatails of that cat..dont forget i am using a c1+ an 16.04..
necessity the mother of all creation and invention..!!!..check out the world ...long live rock and roll.....

phaseshifter
Posts: 3804
Joined: Fri May 08, 2015 9:12 am
languages_spoken: english
ODROIDs: U-2,U3+,,XU-3,,XU3-LITE,,XU-4
C1+,,C-2,,,n2+2G and n2 4G
cloudshell I and shell II
N-1,,N-2,...other odroid acc`s as well..vu7 etc..all sorts of sbc`s these days
Has thanked: 69 times
Been thanked: 52 times
Contact:

Re: Script to install Odroid LCD 3.5 Touchscreen Shield

Post by phaseshifter »

i will fire up my c1+ 4 you but give me 20 mins to bring it up to speed your code for install works fine ..the problem lies within getting bach to "normal " mode hdmi out.
necessity the mother of all creation and invention..!!!..check out the world ...long live rock and roll.....

Fourdee
Posts: 298
Joined: Fri Apr 03, 2015 5:01 am
languages_spoken: english
ODROIDs: C1 / C2 / XU4 + Cloudshell.
Has thanked: 0
Been thanked: 8 times
Contact:

Re: Script to install Odroid LCD 3.5 Touchscreen Shield

Post by Fourdee »

phaseshifter wrote:i will fire up my c1+ 4 you but give me 20 mins to bring it up to speed your code for install works fine ..the problem lies within getting bach to "normal " mode hdmi out.
No rush, thanks.

Also, if you could paste the contents of all files in /etc/modprobe.d/ aswell, would be great, eg:

Code: Select all

ls -lha /etc/modprobe.d/
cat /etc/modprobe.d/*
http://DietPi.com - Lightweight justice for your Odroid.
DietPi web hosting is powered by http://MyVirtualServer.com

phaseshifter
Posts: 3804
Joined: Fri May 08, 2015 9:12 am
languages_spoken: english
ODROIDs: U-2,U3+,,XU-3,,XU3-LITE,,XU-4
C1+,,C-2,,,n2+2G and n2 4G
cloudshell I and shell II
N-1,,N-2,...other odroid acc`s as well..vu7 etc..all sorts of sbc`s these days
Has thanked: 69 times
Been thanked: 52 times
Contact:

Re: Script to install Odroid LCD 3.5 Touchscreen Shield

Post by phaseshifter »

these are after i loaded your code but not before i reboot for your setup code to un...

Code: Select all

Section "Device"
        Identifier      "Mali-Fbdev"
        Driver          "mali"
        Option          "fbdev"         "/dev/fb0"
        Option          "DRI2"            "true"
        Option          "DRI2_PAGE_FLIP"  "false"
        Option          "DRI2_WAIT_VSYNC" "false"
        Option          "UMP_CACHED"      "true"
        Option          "UMP_LOCK"        "false"
        Option          "SWCursor"        "true"
        Option          "HWCursor"        "false"

EndSection

Section "ServerFlags"
        Option          "NoTrapSignals" "true"
        Option          "DontZap"       "false"
        Option          "BlankTime"     "0"
        Option          "StandbyTime"   "0"
        Option          "SuspendTime"   "0"
        Option          "OffTime"       "0"
EndSection

Section "DRI"
        Mode            0666
EndSection

Code: Select all

root@odroid:/home/odroid# ls -lha /etc/modprobe.d/
total 68K
drwxr-xr-x   2 root root 4.0K Oct 29 18:47 .
drwxr-xr-x 143 root root  12K Oct 29 18:39 ..
-rw-r--r--   1 root root 2.5K Jul 31  2015 alsa-base.conf
-rw-r--r--   1 root root  325 Mar 13  2016 blacklist-ath_pci.conf
-rw-r--r--   1 root root 1.6K Mar 13  2016 blacklist.conf
-rw-r--r--   1 root root  210 Mar 13  2016 blacklist-firewire.conf
-rw-r--r--   1 root root  697 Mar 13  2016 blacklist-framebuffer.conf
-rw-r--r--   1 root root  156 Jul 31  2015 blacklist-modem.conf
-rw-r--r--   1 root root   85 Jul 28 00:28 blacklist-odroid.conf
lrwxrwxrwx   1 root root   41 Jul 14 01:28 blacklist-oss.conf -> /lib/linux-sound-base/noOSS.modprobe.conf
-rw-r--r--   1 root root  583 Mar 13  2016 blacklist-rare-network.conf
-rw-r--r--   1 root root 1.1K Mar 13  2016 blacklist-watchdog.conf
-rw-r--r--   1 root root  390 May 12 08:39 fbdev-blacklist.conf
-rw-r--r--   1 root root  347 Mar 13  2016 iwlwifi.conf
-rw-r--r--   1 root root  104 Mar 13  2016 mlx4.conf
-rw-r--r--   1 root root   72 Oct 29 18:47 odroid-lcd35.conf

Code: Select all

root@odroid:/home/odroid# cat /etc/modprobe.d/*
# autoloader aliases
install sound-slot-0 /sbin/modprobe snd-card-0
install sound-slot-1 /sbin/modprobe snd-card-1
install sound-slot-2 /sbin/modprobe snd-card-2
install sound-slot-3 /sbin/modprobe snd-card-3
install sound-slot-4 /sbin/modprobe snd-card-4
install sound-slot-5 /sbin/modprobe snd-card-5
install sound-slot-6 /sbin/modprobe snd-card-6
install sound-slot-7 /sbin/modprobe snd-card-7

# Cause optional modules to be loaded above generic modules
install snd /sbin/modprobe --ignore-install snd $CMDLINE_OPTS && { /sbin/modprobe --quiet --use-blacklist snd-ioctl32 ; /sbin/modprobe --quiet --use-blacklist snd-seq ; }
#
# Workaround at bug #499695 (reverted in Ubuntu see LP #319505)
install snd-pcm /sbin/modprobe --ignore-install snd-pcm $CMDLINE_OPTS && { /sbin/modprobe --quiet --use-blacklist snd-pcm-oss ; : ; }
install snd-mixer /sbin/modprobe --ignore-install snd-mixer $CMDLINE_OPTS && { /sbin/modprobe --quiet --use-blacklist snd-mixer-oss ; : ; }
install snd-seq /sbin/modprobe --ignore-install snd-seq $CMDLINE_OPTS && { /sbin/modprobe --quiet --use-blacklist snd-seq-midi ; /sbin/modprobe --quiet --use-blacklist snd-seq-oss ; : ; }
#
install snd-rawmidi /sbin/modprobe --ignore-install snd-rawmidi $CMDLINE_OPTS && { /sbin/modprobe --quiet --use-blacklist snd-seq-midi ; : ; }
# Cause optional modules to be loaded above sound card driver modules
install snd-emu10k1 /sbin/modprobe --ignore-install snd-emu10k1 $CMDLINE_OPTS && { /sbin/modprobe --quiet --use-blacklist snd-emu10k1-synth ; }
install snd-via82xx /sbin/modprobe --ignore-install snd-via82xx $CMDLINE_OPTS && { /sbin/modprobe --quiet --use-blacklist snd-seq ; }

# Load saa7134-alsa instead of saa7134 (which gets dragged in by it anyway)
install saa7134 /sbin/modprobe --ignore-install saa7134 $CMDLINE_OPTS && { /sbin/modprobe --quiet --use-blacklist saa7134-alsa ; : ; }
# Prevent abnormal drivers from grabbing index 0
options bt87x index=-2
options cx88_alsa index=-2
options saa7134-alsa index=-2
options snd-atiixp-modem index=-2
options snd-intel8x0m index=-2
options snd-via82xx-modem index=-2
options snd-usb-audio index=-2
options snd-usb-caiaq index=-2
options snd-usb-ua101 index=-2
options snd-usb-us122l index=-2
options snd-usb-usx2y index=-2
# Ubuntu #62691, enable MPU for snd-cmipci
options snd-cmipci mpu_port=0x330 fm_port=0x388
# Keep snd-pcsp from being loaded as first soundcard
options snd-pcsp index=-2
# Keep snd-usb-audio from beeing loaded as first soundcard
options snd-usb-audio index=-2
# For some Atheros 5K RF MACs, the madwifi driver loads buts fails to
# correctly initialize the hardware, leaving it in a state from
# which ath5k cannot recover. To prevent this condition, stop
# madwifi from loading by default. Use Jockey to select one driver
# or the other. (Ubuntu: #315056, #323830)
blacklist ath_pci

# This file lists those modules which we don't want to be loaded by
# alias expansion, usually so some other driver will be loaded for the
# device instead.

# evbug is a debug tool that should be loaded explicitly
blacklist evbug

# these drivers are very simple, the HID drivers are usually preferred
blacklist usbmouse
blacklist usbkbd

# replaced by e100
blacklist eepro100

# replaced by tulip
blacklist de4x5

# causes no end of confusion by creating unexpected network interfaces
blacklist eth1394

# snd_intel8x0m can interfere with snd_intel8x0, doesn't seem to support much
# hardware on its own (Ubuntu bug #2011, #6810)
blacklist snd_intel8x0m

# Conflicts with dvb driver (which is better for handling this device)
blacklist snd_aw2

# causes failure to suspend on HP compaq nc6000 (Ubuntu: #10306)
blacklist i2c_i801

# replaced by p54pci
blacklist prism54

# replaced by b43 and ssb.
blacklist bcm43xx

# most apps now use garmin usb driver directly (Ubuntu: #114565)
blacklist garmin_gps

# replaced by asus-laptop (Ubuntu: #184721)
blacklist asus_acpi

# low-quality, just noise when being used for sound playback, causes
# hangs at desktop session start (Ubuntu: #246969)
blacklist snd_pcsp

# ugly and loud noise, getting on everyone's nerves; this should be done by a
# nice pulseaudio bing (Ubuntu: #77010)
blacklist pcspkr

# EDAC driver for amd76x clashes with the agp driver preventing the aperture
# from being initialised (Ubuntu: #297750). Blacklist so that the driver
# continues to build and is installable for the few cases where its
# really needed.
blacklist amd76x_edac
# Select the legacy firewire stack over the new CONFIG_FIREWIRE one.

blacklist ohci1394
blacklist sbp2
blacklist dv1394
blacklist raw1394
blacklist video1394

#blacklist firewire-ohci
#blacklist firewire-sbp2
# Framebuffer drivers are generally buggy and poorly-supported, and cause
# suspend failures, kernel panics and general mayhem.  For this reason we
# never load them automatically.
blacklist aty128fb
blacklist atyfb
blacklist bochs-drm
blacklist radeonfb
blacklist cirrusfb
blacklist cyber2000fb
blacklist cyblafb
blacklist gx1fb
blacklist hgafb
blacklist i810fb
blacklist intelfb
blacklist kyrofb
blacklist lxfb
blacklist matroxfb_base
blacklist neofb
blacklist nvidiafb
blacklist pm2fb
blacklist rivafb
blacklist s1d13xxxfb
blacklist savagefb
blacklist sisfb
blacklist sstfb
blacklist tdfxfb
blacklist tridentfb
#blacklist vesafb
blacklist vfb
blacklist viafb
blacklist vt8623fb
blacklist udlfb
# Uncomment these entries in order to blacklist unwanted modem drivers
# blacklist snd-atiixp-modem
# blacklist snd-intel8x0m
# blacklist snd-via82xx-modem
# Comment only what you need

# 1 Wire GPIO Support
blacklist w1_gpio
blacklist wire
blacklist ac97
blacklist ac97_codec
blacklist ac97_plugin_ad1980
blacklist ad1848
blacklist ad1889
blacklist adlib_card
blacklist aedsp16
blacklist ali5455
blacklist btaudio
blacklist cmpci
blacklist cs4232
blacklist cs4281
blacklist cs461x
blacklist cs46xx
blacklist emu10k1
blacklist es1370
blacklist es1371
blacklist esssolo1
blacklist forte
blacklist gus
blacklist i810_audio
blacklist kahlua
blacklist mad16
blacklist maestro
blacklist maestro3
blacklist maui
blacklist mpu401
blacklist nm256_audio
blacklist opl3
blacklist opl3sa
blacklist opl3sa2
blacklist pas2
blacklist pss
blacklist rme96xx
blacklist sb
blacklist sb_lib
blacklist sgalaxy
blacklist sonicvibes
blacklist sound
blacklist sscape
blacklist trident
blacklist trix
blacklist uart401
blacklist uart6850
blacklist via82cxxx_audio
blacklist v_midi
blacklist wavefront
blacklist ymfpci
blacklist ac97_plugin_wm97xx
blacklist ad1816
blacklist audio
blacklist awe_wave
blacklist dmasound_core
blacklist dmasound_pmac
blacklist harmony
blacklist sequencer
blacklist soundcard
blacklist usb-midi
# Many less commonly used network protocols have recently had various
# security flaws discovered. In an effort to reduce the scope of future
# vulnerability exploitations, they are being blacklisted here so that
# unprivileged users cannot use them by default. System owners can still
# either modify this file, or specifically modprobe any needed protocols.

# ax25
alias net-pf-3 off
# netrom
alias net-pf-6 off
# x25
alias net-pf-9 off
# rose
alias net-pf-11 off
# decnet
alias net-pf-12 off
# econet
alias net-pf-19 off
# rds
alias net-pf-21 off
# af_802154
alias net-pf-36 off
# Watchdog drivers should not be loaded automatically, but only if a
# watchdog daemon is installed.
blacklist acquirewdt
blacklist advantechwdt
blacklist alim1535_wdt
blacklist alim7101_wdt
blacklist booke_wdt
blacklist cpu5wdt
blacklist eurotechwdt
blacklist i6300esb
blacklist i8xx_tco
blacklist ib700wdt
blacklist ibmasr
blacklist indydog
blacklist iTCO_wdt
blacklist it8712f_wdt
blacklist it87_wdt
blacklist ixp2000_wdt
blacklist ixp4xx_wdt
blacklist machzwd
blacklist mixcomwd
blacklist mpc8xx_wdt
blacklist mpcore_wdt
blacklist mv64x60_wdt
blacklist pc87413_wdt
blacklist pcwd
blacklist pcwd_pci
blacklist pcwd_usb
blacklist s3c2410_wdt
blacklist sa1100_wdt
blacklist sbc60xxwdt
blacklist sbc7240_wdt
blacklist sb8360
blacklist sc1200wdt
blacklist sc520_wdt
blacklist sch311_wdt
blacklist scx200_wdt
blacklist shwdt
blacklist smsc37b787_wdt
blacklist softdog
blacklist twl4030_wdt
blacklist w83627hf_wdt
blacklist w83697hf_wdt
blacklist w83697ug_wdt
blacklist w83877f_wdt
blacklist w83977f_wdt
blacklist wafer5823wdt
blacklist wdt
blacklist wdt_pci
blacklist wm8350_wdt
# This file blacklists most old-style PCI framebuffer drivers.

blacklist arkfb
blacklist aty128fb
blacklist atyfb
blacklist radeonfb
blacklist cirrusfb
blacklist cyber2000fb
blacklist kyrofb
blacklist matroxfb_base
blacklist mb862xxfb
blacklist neofb
blacklist pm2fb
blacklist pm3fb
blacklist s3fb
blacklist savagefb
blacklist sisfb
blacklist tdfxfb
blacklist tridentfb
blacklist vt8623fb
# /etc/modprobe.d/iwlwifi.conf
# iwlwifi will dyamically load either iwldvm or iwlmvm depending on the
# microcode file installed on the system.  When removing iwlwifi, first
# remove the iwl?vm module and then iwlwifi.
remove iwlwifi \
(/sbin/lsmod | grep -o -e ^iwlmvm -e ^iwldvm -e ^iwlwifi | xargs /sbin/rmmod) \
&& /sbin/modprobe -r mac80211
# mlx4_core gets automatically loaded, load mlx4_en also (LP: #1115710)
softdep mlx4_core post: mlx4_en
options fbtft_device name=flexpfb rotate=90
options flexfb chip=ili9488
root@odroid:/home/odroid# 
in order of what you asked
necessity the mother of all creation and invention..!!!..check out the world ...long live rock and roll.....

phaseshifter
Posts: 3804
Joined: Fri May 08, 2015 9:12 am
languages_spoken: english
ODROIDs: U-2,U3+,,XU-3,,XU3-LITE,,XU-4
C1+,,C-2,,,n2+2G and n2 4G
cloudshell I and shell II
N-1,,N-2,...other odroid acc`s as well..vu7 etc..all sorts of sbc`s these days
Has thanked: 69 times
Been thanked: 52 times
Contact:

Re: Script to install Odroid LCD 3.5 Touchscreen Shield

Post by phaseshifter »

the bring back to hdmi code works..do you want any further results..um my c1+ is not exactly the best.
.i just put silly putty on top of the hdmi socket..
i need to get a new c1 and my c-2 i cannot use cuse it`s a sample one i got from odroid and it has different gpio`s
necessity the mother of all creation and invention..!!!..check out the world ...long live rock and roll.....

Fourdee
Posts: 298
Joined: Fri Apr 03, 2015 5:01 am
languages_spoken: english
ODROIDs: C1 / C2 / XU4 + Cloudshell.
Has thanked: 0
Been thanked: 8 times
Contact:

Re: Script to install Odroid LCD 3.5 Touchscreen Shield

Post by Fourdee »

Thanks for the results, looks fine.
the bring back to hdmi code works..
So just to confirm, you used the script in 1st post to install the LCD screen, then to return back to HDMI, you ran the code below and HDMI is working ok after a reboot?

Code: Select all

systemctl disable odroid-lcd35
rm /etc/X11/xorg.conf.d/99-odroid-lcd35.conf

#+XU4
mv /etc/X11/exynos.conf /etc/X11/xorg.conf.d/exynos.conf
um my c1+ is not exactly the best.
Don't tell my C1 that, hes the original (not a plus), gets a little edgy and doesn't take kindly to microUSB power lol ;)
http://DietPi.com - Lightweight justice for your Odroid.
DietPi web hosting is powered by http://MyVirtualServer.com

phaseshifter
Posts: 3804
Joined: Fri May 08, 2015 9:12 am
languages_spoken: english
ODROIDs: U-2,U3+,,XU-3,,XU3-LITE,,XU-4
C1+,,C-2,,,n2+2G and n2 4G
cloudshell I and shell II
N-1,,N-2,...other odroid acc`s as well..vu7 etc..all sorts of sbc`s these days
Has thanked: 69 times
Been thanked: 52 times
Contact:

Re: Script to install Odroid LCD 3.5 Touchscreen Shield

Post by phaseshifter »

Code: Select all

systemctl disable odroid-lcd35

Code: Select all

rm /etc/X11/xorg.conf.d/99-odroid-lcd35.conf
the above code i used
ok how do i restart the l.c.d now
after a reboot yes..
Last edited by phaseshifter on Sun Oct 30, 2016 6:05 am, edited 1 time in total.
necessity the mother of all creation and invention..!!!..check out the world ...long live rock and roll.....

phaseshifter
Posts: 3804
Joined: Fri May 08, 2015 9:12 am
languages_spoken: english
ODROIDs: U-2,U3+,,XU-3,,XU3-LITE,,XU-4
C1+,,C-2,,,n2+2G and n2 4G
cloudshell I and shell II
N-1,,N-2,...other odroid acc`s as well..vu7 etc..all sorts of sbc`s these days
Has thanked: 69 times
Been thanked: 52 times
Contact:

Re: Script to install Odroid LCD 3.5 Touchscreen Shield

Post by phaseshifter »

is this it

Code: Select all

systemctl enable odroid-lcd35
necessity the mother of all creation and invention..!!!..check out the world ...long live rock and roll.....

Fourdee
Posts: 298
Joined: Fri Apr 03, 2015 5:01 am
languages_spoken: english
ODROIDs: C1 / C2 / XU4 + Cloudshell.
Has thanked: 0
Been thanked: 8 times
Contact:

Re: Script to install Odroid LCD 3.5 Touchscreen Shield

Post by Fourdee »

phaseshifter wrote:is this it

Code: Select all

systemctl enable odroid-lcd35
Yes, but you'll also need the xorg conf (/etc/X11/xorg.conf.d/99-odroid-lcd35.conf) thats installed with the script. So the easiest method would be to simply run the install script again, then reboot.
http://DietPi.com - Lightweight justice for your Odroid.
DietPi web hosting is powered by http://MyVirtualServer.com

phaseshifter
Posts: 3804
Joined: Fri May 08, 2015 9:12 am
languages_spoken: english
ODROIDs: U-2,U3+,,XU-3,,XU3-LITE,,XU-4
C1+,,C-2,,,n2+2G and n2 4G
cloudshell I and shell II
N-1,,N-2,...other odroid acc`s as well..vu7 etc..all sorts of sbc`s these days
Has thanked: 69 times
Been thanked: 52 times
Contact:

Re: Script to install Odroid LCD 3.5 Touchscreen Shield

Post by phaseshifter »

so to get the l.c.d up and running again run
for which ever board you are running

i.e the c-series installer or the xu series installer

How to install for XU4:

Code: Select all

 ./install_odroid_LCD35.sh 0
How to install for C1+/C2

Code: Select all

 ./install_odroid_LCD35.sh 1
and reboot
necessity the mother of all creation and invention..!!!..check out the world ...long live rock and roll.....

phaseshifter
Posts: 3804
Joined: Fri May 08, 2015 9:12 am
languages_spoken: english
ODROIDs: U-2,U3+,,XU-3,,XU3-LITE,,XU-4
C1+,,C-2,,,n2+2G and n2 4G
cloudshell I and shell II
N-1,,N-2,...other odroid acc`s as well..vu7 etc..all sorts of sbc`s these days
Has thanked: 69 times
Been thanked: 52 times
Contact:

Re: Script to install Odroid LCD 3.5 Touchscreen Shield

Post by phaseshifter »

just got my new rev C-2 ran "fourdee`s" script on it seems to work fine but not all of the menus are showing in the gui mode

not shure if that is to do with the screen calibrator

my suggestion in gui mode go to the clock settings
remove the weather and date this will help give more room up the top of the screen length wise
necessity the mother of all creation and invention..!!!..check out the world ...long live rock and roll.....

User avatar
mad_ady
Posts: 11581
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4 (HC1, HC2), C1+, C2, C4 (HC4), N1, N2, N2L, H2, H3+, Go, Go Advance, M1
Location: Bucharest, Romania
Has thanked: 649 times
Been thanked: 1151 times
Contact:

Re: Script to install Odroid LCD 3.5 Touchscreen Shield

Post by mad_ady »

@Fourdee: I've used your script to activate my 3.5" LCD. Thanks for the quick setup procedure :)

However, I noticed a bug/feature. If you shutdown Ubuntu (e.g. from its menu) the odroid will power off, but the screen will keep displaying the last image (which in my case is gedit). This might be helpful for some, but I think you can turn off the LCD (echo 0 > /sys/devices/platform/pwm-ctrl/duty0) as part of odroid-lcd35.service as ExecStop.
These users thanked the author mad_ady for the post:
brickmaster (Sun Dec 19, 2021 10:15 pm)

Fourdee
Posts: 298
Joined: Fri Apr 03, 2015 5:01 am
languages_spoken: english
ODROIDs: C1 / C2 / XU4 + Cloudshell.
Has thanked: 0
Been thanked: 8 times
Contact:

Re: Script to install Odroid LCD 3.5 Touchscreen Shield

Post by Fourdee »

mad_ady wrote:@Fourdee: I've used your script to activate my 3.5" LCD. Thanks for the quick setup procedure :)

However, I noticed a bug/feature. If you shutdown Ubuntu (e.g. from its menu) the odroid will power off, but the screen will keep displaying the last image (which in my case is gedit). This might be helpful for some, but I think you can turn off the LCD (echo 0 > /sys/devices/platform/pwm-ctrl/duty0) as part of odroid-lcd35.service as ExecStop.
Nice one, thanks. I've updated the script with your changes :)
http://DietPi.com - Lightweight justice for your Odroid.
DietPi web hosting is powered by http://MyVirtualServer.com

User avatar
mad_ady
Posts: 11581
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4 (HC1, HC2), C1+, C2, C4 (HC4), N1, N2, N2L, H2, H3+, Go, Go Advance, M1
Location: Bucharest, Romania
Has thanked: 649 times
Been thanked: 1151 times
Contact:

Re: Script to install Odroid LCD 3.5 Touchscreen Shield

Post by mad_ady »

@Fourdee: I was trying to use the LCD shield as a second monitor inside the same X server. Can you take a look at this thread and see if you can spot my mistake? http://forum.odroid.com/viewtopic.php?f=145&t=25667 :)

User avatar
mad_ady
Posts: 11581
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4 (HC1, HC2), C1+, C2, C4 (HC4), N1, N2, N2L, H2, H3+, Go, Go Advance, M1
Location: Bucharest, Romania
Has thanked: 649 times
Been thanked: 1151 times
Contact:

Re: Script to install Odroid LCD 3.5 Touchscreen Shield

Post by mad_ady »

@FourDee: I've written a small script that sets the backlight on/off/to a specific percentage (useful to be run in cron jobs - e.g. at night turn off the LCD, or to map to a button to control brightness). It also remembers the previous value when you turn it off (so on restores that value).
Please include it in your installer script (as /usr/local/bin/lcd-backlight): https://pastebin.com/vwVTz99w
-- only for C series

Code: Select all

#!/bin/bash
 
LASTPWM=/dev/shm/lcd35
PWMFILE=/sys/devices/platform/pwm-ctrl/duty0
 
if [ -z "$1" ]; then
        echo "Usage $0 on|off|<0-100>"
        echo "Set the backlight of the LCD on/off or to a percent illumination"
        exit;
fi
 
if [ "$1" = "off" ]; then
        #save the current value
        cat $PWMFILE > $LASTPWM
        echo 0 > $PWMFILE
        echo "Turned off 3.5in LCD"
        exit;
fi
 
if [ "$1" = "on" ]; then
        #see if the old PWM value has been saved
        if [ -f "$LASTPWM" ]; then
                cat "$LASTPWM" > $PWMFILE
        else
                #no previous value, turn on full brightness
                echo 1023 > $PWMFILE
        fi
        echo "Turned on 3.5in LCD"
        exit;
fi
 
if [ "$1" -ge 0 -a "$1" -le 100 ]; then
        #set a percent of brightness
        value=$[1023*$1/100]
        echo $value > $PWMFILE
        echo "Set backlight to $1% ($value)"
fi

ColonelPanic
Posts: 17
Joined: Sun Apr 03, 2016 9:19 pm
languages_spoken: english
ODROIDs: Odroid C2
Has thanked: 0
Been thanked: 0
Contact:

Re: Script to install Odroid LCD 3.5 Touchscreen Shield

Post by ColonelPanic »

This script blacks out both inputs (HDMI and 3.5 LCD). When attempting to restart lightdm (service lightdm restart) from a different tty (CTRL+ALT+F2), it displays badly-formatted info about starting lightdm, but it never successfully displays the GUI correctly. Getting the following errors at boot time, regarding pwm:

Code: Select all

Feb 11 11:28:18 odroid64 kernel: [   15.082931] meson_pwm pwm: register pwm device.. meson_pwm_probe
Feb 11 11:28:18 odroid64 kernel: [   15.090203] pwm-ctrl pwm-ctrl: cannot export to PWM-1 : modprobe pwm-meson npwm=2
Feb 11 11:28:05 odroid64 kernel: [   31.512060] meson_pwm pwm: register pwm device.. meson_pwm_probe
Feb 11 11:28:05 odroid64 kernel: [   31.523281] pwm-ctrl pwm-ctrl: cannot export to PWM-1 : modprobe pwm-meson npwm=2

User avatar
mad_ady
Posts: 11581
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4 (HC1, HC2), C1+, C2, C4 (HC4), N1, N2, N2L, H2, H3+, Go, Go Advance, M1
Location: Bucharest, Romania
Has thanked: 649 times
Been thanked: 1151 times
Contact:

Re: Script to install Odroid LCD 3.5 Touchscreen Shield

Post by mad_ady »

Can you post a picture of the output/distortion?

It is normal for the output of HDMI to disappear and you get no signal and console shifts to the LCD shield.

The PWM messages are normal. I get them as well:

Code: Select all

[   18.525270] meson_pwm pwm: register pwm device.. meson_pwm_probe
[   18.526720] pwm-ctrl pwm-ctrl: cannot export to PWM-1 : modprobe pwm-meson npwm=2
You could try uninstalling the scripts and reinstalling them...
Can you also show us /var/log/Xorg.0.log?

Rushlight
Posts: 55
Joined: Mon Jun 06, 2016 3:15 pm
languages_spoken: English
ODROIDs: C-0(1)
C-0(2)
16GB-EMMC

RPI3B
Has thanked: 0
Been thanked: 0
Contact:

Re: Script to install Odroid LCD 3.5 Touchscreen Shield

Post by Rushlight »

I just ran this install script to use the display on my C0.
I do have a few problems though:
-the touch function is completely unresponsive.
-im seeing lines, tears, and colour artifacts indicative of GPU issues. It's impairing my use of the display.
:3

User avatar
mad_ady
Posts: 11581
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4 (HC1, HC2), C1+, C2, C4 (HC4), N1, N2, N2L, H2, H3+, Go, Go Advance, M1
Location: Bucharest, Romania
Has thanked: 649 times
Been thanked: 1151 times
Contact:

Re: Script to install Odroid LCD 3.5 Touchscreen Shield

Post by mad_ady »

Can you post a picture? The thing is - this display doesn't use GPU at all - it just uses GPIO pins and CPU. Maybe there's something wrong with the hardware. Can you test on a different device (C0/C1/C2)?

c2 shield newbie
Posts: 1
Joined: Sat Jun 02, 2018 12:54 am
languages_spoken: english
ODROIDs: c2
Has thanked: 0
Been thanked: 0
Contact:

Re: Script to install Odroid LCD 3.5 Touchscreen Shield

Post by c2 shield newbie »

is there any way to rotate the monitor? it doesnt work through the menus, i also tried

Code: Select all

xrandr -o 3
and that gave me this error

Code: Select all

odroid@odroid64:~$ xrandr -o 3
X Error of failed request:  BadMatch (invalid parameter attributes)
  Major opcode of failed request:  140 (RANDR)
  Minor opcode of failed request:  2 (RRSetScreenConfig)
  Serial number of failed request:  14
  Current serial number in output stream:  14
i cant save changes in the prefs with the current layout, hell i cant even see my ram in system monitor. what do i need to do to get a smartphone-esque layout?

EDIT: i also can't use the hdmi port anymore (i get sound but no image, except during boot-up & shut down).

User avatar
odroid
Site Admin
Posts: 41542
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English, Korean
ODROIDs: ODROID
Has thanked: 3321 times
Been thanked: 1836 times
Contact:

Re: Script to install Odroid LCD 3.5 Touchscreen Shield

Post by odroid »

When you load "fbtft_device" driver, change the rotate parameter to 0 from 270.
https://wiki.odroid.com/accessory/displ ... lcd_shield

annunaki
Posts: 2
Joined: Thu Jul 26, 2018 9:22 am
languages_spoken: english
ODROIDs: XU4
Has thanked: 2 times
Been thanked: 1 time
Contact:

Re: Script to install Odroid LCD 3.5 Touchscreen Shield

Post by annunaki »

root@odroid:/home/pigaming# ./install_odroid_LCD35.sh 0
mv: cannot stat '/etc/X11/xorg.conf.d/exynos.conf': No such file or directory


I'm not sure what I'm doing wrong, but I run into an exynos.conf file missing error. So, I'm assuming I should have a package installed where the exynos file is in place, yes? I'm also using a distribution of RetroPie on my OGST box where I'd like to set up the LCD and I'm hoping this script helps do the trick. But I get the following at least on the second time I ran the script. I've rebooted, yes.

Code: Select all

root@odroid:/home/pigaming#  ./install_odroid_LCD35.sh 0
mv: cannot stat '/etc/X11/xorg.conf.d/exynos.conf': No such file or directory

Installation completed, please reboot system to take effect.

root@odroid:/home/pigaming#

User avatar
odroid
Site Admin
Posts: 41542
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English, Korean
ODROIDs: ODROID
Has thanked: 3321 times
Been thanked: 1836 times
Contact:

Re: Script to install Odroid LCD 3.5 Touchscreen Shield

Post by odroid »

@annunaki,
Refer this link if your are an OGST(2.4inch LCD) console kit user with the ORA image.
viewtopic.php?f=156&t=31548#p228884

heavymetalme
Posts: 10
Joined: Thu Oct 08, 2020 12:06 am
languages_spoken: english
Has thanked: 0
Been thanked: 0
Contact:

Re: Script to install Odroid LCD 3.5 Touchscreen Shield

Post by heavymetalme »

Glad I found this. Thanks!

brickmaster
Posts: 3
Joined: Sun Dec 19, 2021 9:52 pm
languages_spoken: german, english
ODROIDs: C2 + 3,5 LCD
Has thanked: 3 times
Been thanked: 0
Contact:

Re: Script to install Odroid LCD 3.5 Touchscreen Shield

Post by brickmaster »

I'd like to try the script with my c2, but link to the sourcecode http://dietpi.com/downloads/misc/commun ... d_LCD35.sh seems to be down... Is it still available somewhere?

User avatar
mad_ady
Posts: 11581
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4 (HC1, HC2), C1+, C2, C4 (HC4), N1, N2, N2L, H2, H3+, Go, Go Advance, M1
Location: Bucharest, Romania
Has thanked: 649 times
Been thanked: 1151 times
Contact:

Re: Script to install Odroid LCD 3.5 Touchscreen Shield

Post by mad_ady »

I don't seem to have it anymore, but here's how I enable my lcd in ubuntu 18.04:

Code: Select all

$cat /etc/systemd/system/odroid- lcd35.service                                               
[Unit]
Description=Odroid LCD 3.5                                  
[Path]
PathExists=/dev/fb2

[Service]
Type=oneshot
RemainAfterExit=yes
StandardOutput=tty
ExecStart=/bin/bash -c 'echo 500000 > /sys/devices/pwm-ctrl/freq0'
ExecStart=/bin/bash -c 'echo 1 > /sys/devices/pwm-ctrl/enable0'                                                         ExecStart=/bin/bash -c 'echo 700 > /sys/devices/pwm-ctrl/duty0'                                                         ExecStart=/usr/bin/setterm -blank 0 -powersave off
ExecStart=/bin/con2fbmap 1 2                                ExecStop=/bin/bash -c 'echo 0 > /sys/devices/pwm-ctrl/enable0'

[Install]                                                   WantedBy=multi-user.target
$  cat /etc/modules                
# /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.                                                     
fbtft_device                                                
flexfb
sx865x
aml_i2c
pwm-meson
pwm-ctrl

Post Reply

Return to “3.5inch LCD Shield”

Who is online

Users browsing this forum: No registered users and 1 guest