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

Stretch Full #3

Closed
nickm324 opened this issue Aug 25, 2018 · 6 comments
Closed

Stretch Full #3

nickm324 opened this issue Aug 25, 2018 · 6 comments

Comments

@nickm324
Copy link

Any chance you are going to create a version that uses Stretch full version?
I have a 3.5 LCD on my PI and I am attempting to start the tiny-web interface on the LCD at boot but it requires a browser be installed and Stretch Lite does not have X11 or any other desktop or browsers to achieve what I am attempting to do.

Thanks.

@AustinSaintAubin
Copy link
Collaborator

AustinSaintAubin commented Aug 26, 2018

Web Kiosk is actually what I am working on at the moment, but still be be Stretch Light.
Here are my note (THESE ARE STILL BEING TESTED)

Setup a Raspberry Pi to run a Web Browser in Kiosk Mode

https://die-antwort.eu/techblog/2017-12-setup-raspberry-pi-for-kiosk-mode/
https://www.repetier-server.com/booting-into-touchscreen-mode-for-linux/

sudo apt-get update
sudo apt-get upgrade -y
###sudo apt-get install -y nano mc htop bmon parted hdparm iperf3 make cmake gcc  # Optional Tools

Minimum Environment for GUI Applications

# The bare minimum we need are X server and window manager.
sudo apt-get install -y --no-install-recommends xserver-xorg x11-xserver-utils xinit openbox
###sudo apt-get install -y xserver-xorg x11-xserver-utils xinit openbox
sudo apt-get install -y --no-install-recommends xserver-xorg-legacy

Web Browser

# We’ll use Chromium because it provides a nice kiosk mode:
sudo apt-get install -y --no-install-recommends chromium-browser
###sudo apt-get install -y --no-install-recommends chromium-browser rpi-chromium-mods

Openbox Configuration

First we disable screen blanking and power management (we don’t want our screen to go blank or even turn off completely after some time).

Then we allow to quit the X server by pressing Ctrl-Alt-Backspace. (Because we didn’t install a desktop environment there won’t be a “Log out” button or the like.)

Finally we tell Openbox to start Chromium in kiosk mode. This turns out to be a bit intricate because Chromium loves to show various tool bubbles for session restore etc. The simplest way to avoid all of these seems to be tricking Chromium into thinking it exited cleanly last time it was run (see this answer on Super User for details).

###cat > /etc/xdg/openbox/autostart << "EOF"
mkdir -p /home/pi/.config/openbox
cat > /home/pi/.config/openbox/autostart << "EOF"
# Disable any form of screen saver / screen blanking / power management
xset s off
xset s noblank
xset -dpms

# Allow quitting the X server with CTRL-ATL-Backspace
setxkbmap -option terminate:ctrl_alt_bksp

# Start Chromium in kiosk mode
sed -i 's/"exited_cleanly":false/"exited_cleanly":true/' ~/.config/chromium/'Local State'
sed -i 's/"exited_cleanly":false/"exited_cleanly":true/; s/"exit_type":"[^"]\+"/"exit_type":"Normal"/' ~/.config/chromium/Default/Preferences
###chromium-browser --disable-infobars --kiosk 'http://google.com'
###chromium-browser --incognito --noerrdialogs --disable-suggestions-service --disable-translate --disable-save-password-bubble --disable-session-crashed-bubble --disable-infobars --touch-events=enabled --disable-gesture-typing --kiosk http://127.0.0.1:3344/modules/front2/www/app.html
chromium-browser --noerrdialogs --disable-suggestions-service --disable-translate --disable-save-password-bubble --disable-session-crashed-bubble --disable-infobars --touch-events=enabled --disable-gesture-typing --kiosk 'http://xcarve/tinyweb'
EOF

User Permissions

https://www.raspberrypi.org/forums/viewtopic.php?t=171843

sudo usermod -a -G tty pi

TEST

That’s it! Time to give it a try:

startx -- -nocursor

Press Ctrl-Alt-Backspace to quite the X server, bringing you back into the text console.

Start X automatically on boot

cat > '/home/pi/.xinitrc' << "EOF"
exec openbox-session
EOF
cat >> '/home/pi/.bashrc' <<"EOF"
# Start Web Kiosk
[[ -z $DISPLAY && $XDG_VTNR -eq 1 ]] && startx -- -nocursor

Setup LCD-Show 3.5in Screen.

System Update & Add-ons

sudo apt-get update; sudo apt-get upgrade -y; sudo apt-get install -y git htop
###sudo apt-get install -y chromium-browser rpi-chromium-mods

LCD Screen

https://github.com/goodtft/LCD-show

Instal LCD-show

sudo rm -rf LCD-show
git clone https://github.com/goodtft/LCD-show.git
chmod -R 755 LCD-show
cd LCD-show/
sudo ./LCD35-show

startx

X11 Setup FIXES

sudo -i
# https://www.raspberrypi.org/forums/viewtopic.php?t=162323
# https://www.raspberrypi.org/forums/viewtopic.php?t=148678
cat > /etc/X11/xorg.conf.d/98-lcd-show.conf <<"EOF"
Section "Device" 
	# WaveShare SpotPear 3.5", framebuffer 1
	Identifier "uga" 
	driver 	"fbdev" 
	Option 	"fbdev" "/dev/fb1" 
	Option 	"ShadowFB" "off"
	###Option		"Rotate" "UD"  # Flip Upside Down
	Option		"SwapbuffersWait" "true"
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
EOF
# https://www.waveshare.com/wiki/7inch_HDMI_LCD_(C)
# https://github.com/notro/fbtft/issues/445
# https://codepen.io/GottZ/full/pWpNgK/
cat > /etc/X11/xorg.conf.d/99-calibration.conf <<"EOF"
Section "InputClass"
	Identifier      "calibration touchscreen default primary uga fbdev"
	MatchProduct    "ADS7846 Touchscreen"
	Option  "Calibration"   "3936 227 268 3880"
	#Option "CalibrationMatrix" "0 -1 1 1 0 0 0 0 1"  # 270 degree
	###Option "CalibrationMatrix" "0 1 0 -1 0 1 0 0 1"  # 90 degree, Flip Upside Down
	###Option	"SwapAxes"  "1"
	###Option	"SwapXY"	"1"
	###Option	"InvertX" "true"
	###Option	"InvertY" "true"
EndSection
EOF

Rotate LCD Screen

goodtft/LCD-show#34
https://raspberrypi.stackexchange.com/questions/55934/3-5-kuman-touchscreen-rotation

sudo nano /boot/config.txt

dtoverlay=tft35a:rotate=270
sudo nano /etc/X11/xorg.conf.d/99-calibration.conf

	Option	"SwapAxes"  "1"
	Option	"SwapXY"	"1"
	Option	"InvertX" "true"
	Option	"InvertY" "true"

How to calibrate the touch screen

https://github.com/goodtft/LCD-show/wiki/How-to-calibrate-the-touch-screen

DISPLAY=:0.0 xinput_calibrator
sudo nano /etc/X11/xorg.conf.d/99-calibration.conf

@nickm324
Copy link
Author

Literally exactly what I have done so far and I have it working.

@nickm324
Copy link
Author

nickm324 commented Aug 26, 2018

Couple notes, one thing I did have to do in order to get the touch screen calibration to match up to the screen after flipping was to add rotate to dtoverlay for ads7846.

dtoverlay=ads7846,cs=1,penirq=17,penirq_pull=2,speed=1000000,keep_vref_on=1,swapxy=1,pmax=255,xohms=60,xmin=200,xmax=3900,ymin=200,ymax=3900,rotate=270

Also have to move the starting chromium to a script and add a delay because there was an issue that chromium would try and start before CNCjs would actaully get started and the page would 404 not found.

Have one more issue to work out that is with when tinyweb starts is stops at the CONNECTION screen wanting me to select the USB port because its not detecting my X-Carve port even though it is present. But I have some info from mitch bradley that I think is going to resolve that issue but have not added it yet.

@AustinSaintAubin
Copy link
Collaborator

New version released, give it a try.
https://github.com/cncjs/cncjs-pi-raspbian/releases
Has the web kiosk built in, you will need to install your LCD Show drivers though for your small touch screen. Give it a try over HDMI first though.

@AustinSaintAubin
Copy link
Collaborator

@nickm324 You ok if I close this issue? You still have anything related to this issue that is unresolved?

@nickm324
Copy link
Author

Yea go ahead and close it, I have everything working now. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants