From 73eed6a4f1e1a0747e28d78f455cf2efd8df6d59 Mon Sep 17 00:00:00 2001 From: Cristian Pop Date: Sun, 22 Sep 2019 15:34:01 +0300 Subject: [PATCH 1/6] Fix chromium previous sessions removal Removing notes from previous sessions was filing due to path containing spaces (.config/chromium/Last Session) being passed to rm command. find with exec handles that case better --- home/.xsession | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/home/.xsession b/home/.xsession index 73cda67..760fa93 100755 --- a/home/.xsession +++ b/home/.xsession @@ -26,7 +26,7 @@ if [ -f .config/chromium/Default/Preferences ]; then fi # Remove notes of previous sessions, if any -find .config/chromium/ -name "Last *" | xargs rm +find .config/chromium/ -name "Last *" -exec rm {} + # Start and detach Chromium # http://peter.sh/experiments/chromium-command-line-switches/ From 73c59d41c9eaab82965b4f050623069f884e3d2b Mon Sep 17 00:00:00 2001 From: Patrick Rauscher Date: Wed, 30 Oct 2019 00:33:09 +0100 Subject: [PATCH 2/6] Add support for HDMI CEC by providing cec-{on,off}.sh in home-dir Using CEC may add support for better power saving (sending the monitor to standby instead of rendering "waiting for devices"). This commit adds separate cec-scripts, installs the necessary package and provides a note in the crontab --- docs/image-setup.sh | 2 +- home/cec-off.sh | 3 +++ home/cec-on.sh | 3 +++ home/crontab.example | 1 + 4 files changed, 8 insertions(+), 1 deletion(-) create mode 100755 home/cec-off.sh create mode 100755 home/cec-on.sh diff --git a/docs/image-setup.sh b/docs/image-setup.sh index 31f33b0..b527fe5 100755 --- a/docs/image-setup.sh +++ b/docs/image-setup.sh @@ -142,7 +142,7 @@ ssh "sudo rm /etc/profile.d/sshpwd.sh" ssh "echo | sudo tee /etc/motd" working "Installing packages" -ssh "sudo apt-get update && sudo apt-get install -y vim matchbox-window-manager unclutter mailutils nitrogen jq chromium-browser xserver-xorg xinit rpd-plym-splash xdotool" +ssh "sudo apt-get update && sudo apt-get install -y vim matchbox-window-manager unclutter mailutils nitrogen jq chromium-browser xserver-xorg xinit rpd-plym-splash xdotool cec-utils" # We install mailutils just so that you can check "mail" for cronjob output working "Setting home directory default content" diff --git a/home/cec-off.sh b/home/cec-off.sh new file mode 100755 index 0000000..1033e4f --- /dev/null +++ b/home/cec-off.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +echo 'standby 0' | cec-client -s > /dev/null diff --git a/home/cec-on.sh b/home/cec-on.sh new file mode 100755 index 0000000..cd4473f --- /dev/null +++ b/home/cec-on.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +echo 'on 0' | cec-client -s > /dev/null diff --git a/home/crontab.example b/home/crontab.example index 3ba1fcd..ea79d14 100644 --- a/home/crontab.example +++ b/home/crontab.example @@ -14,6 +14,7 @@ DISPLAY=:0.0 0 3 * * * sudo reboot # Example: Turn display on weekdays at 7 AM +# Note: You may exchange "display-on" / "display-off" with "cec-on" / "cec-off" in order to use HDMI CEC # 0 7 * * 1-5 ~/display-on.sh # Example: Turn display off weekdays at 7 PM (and after the nightly reboot) From db174ae74a808abdb7a4a466b0ccbd2be118ee9f Mon Sep 17 00:00:00 2001 From: Martin Date: Fri, 13 Mar 2020 11:53:43 +0100 Subject: [PATCH 3/6] Set URL before boot #31 --- README.md | 15 ++++++++++++--- home/.xsession | 14 +++++++++++++- 2 files changed, 25 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 550b861..bf282a9 100644 --- a/README.md +++ b/README.md @@ -28,9 +28,18 @@ Easy-to-use **Raspberry Pi** image for booting directly into **full-screen Chrom 2. Download the [latest image](https://github.com/futurice/chilipie-kiosk/releases). 3. Decompress it. 4. Flash the image onto your SD card. We recommend [Etcher](https://etcher.io/) for this: it's delightfully easy to use, cross platform, and will verify the result automatically. If you know what you're doing, you can of course also just `sudo dd bs=1m if=chilipie-kiosk-vX.Y.Z.img of=/dev/rdisk2`. -5. *Optional*: [Setup automatic WiFi](#automatic-wifi-setup) -6. Insert the SD card to your Pi and power it up. -7. You should land in the [first-boot document](docs/first-boot.md), for further instructions & ideas. +5. *Optional*: [Set URL before boot](#set-url-before-boot) +6. *Optional*: [Setup automatic WiFi](#automatic-wifi-setup) +7. Insert the SD card to your Pi and power it up. +8. You should land in the [first-boot document](docs/first-boot.md), for further instructions & ideas. + +### Set URL before boot + +1. After flashing remount your SD card. +2. Create a *chilipie_url.txt* in your SD cards boot folder or */home/pi*. +3. Write URL in **first** line of file. + +Note: You can user `${SERIAL}` to get Pi's serial number into URL. ### Automatic WiFi setup diff --git a/home/.xsession b/home/.xsession index 73cda67..c53ef76 100755 --- a/home/.xsession +++ b/home/.xsession @@ -28,10 +28,22 @@ fi # Remove notes of previous sessions, if any find .config/chromium/ -name "Last *" | xargs rm +# Get URL from file (if set) +URL="" +if [ -f /boot/chilipie_url.txt ]; then + URL="$(head -n 1 /boot/chilipie_url.txt)" +elif [ -f /home/pi/chilipie_url.txt ]; then + URL="$(head -n 1 /home/pi/chilipie_url.txt)" +fi +if [ -n "$URL" ]; then + SERIAL="$(cat /proc/cpuinfo | grep Serial | cut -d ' ' -f 2 | xargs)" # Get serial number + URL="$(echo $URL | SERIAL=$SERIAL envsubst '$SERIAL')" +fi + # Start and detach Chromium # http://peter.sh/experiments/chromium-command-line-switches/ # Note that under matchbox, starting in full-screen without a window size doesn't behave well when you try to exit full screen (see https://unix.stackexchange.com/q/273989) -chromium-browser --start-fullscreen --window-size=1920,1080 --disable-infobars & +chromium-browser --start-fullscreen --window-size=1920,1080 --disable-infobars $URL & # Hide Chromium while it's starting/loading the page wid=`xdotool search --sync --onlyvisible --class chromium` From 82823357540ccbb0e14df3d6fa5622da51635868 Mon Sep 17 00:00:00 2001 From: birdybro Date: Tue, 11 May 2021 12:59:56 -0600 Subject: [PATCH 4/6] Add Windows MicroSD common issue https://github.com/futurice/chilipie-kiosk/issues/89 <-- Adding a section that will help people who run into this problem. This still occurs on windows 10 and won't go away until the method of creating the archive is fixed to be fully compatible for Windows users. there's no reason to fix it if users have this instruction though, so this is easier for now. --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 75248ca..b417e23 100644 --- a/README.md +++ b/README.md @@ -66,6 +66,7 @@ The Pi needs a [2.5 Amp power source](https://www.raspberrypi.org/documentation/ - **I get a kernel panic on boot, or the image keeps crashing.** The Raspberry Pi is somewhat picky about about its SD cards. It's also possible the SD card has a bad sector in a critical place, and `dd` wasn't be able to tell you. Double-check that you're using [a blessed SD card](http://elinux.org/RPi_SD_cards), and try flashing the image again. - **I see a "rainbow square" or "yellow lightning" in the top right corner of the screen, and the device seems unstable.** This usually means the Pi isn't getting enough amps from your power supply. This is sometimes the case in more exotic setups (e.g. using the USB port of your display to power the Pi) or with cheap power supplies. Try another one. - **The [display control scripts](home/display-on.sh) don't turn off the display device.** Normal PC displays will usually power down when you cut off the signal, but this is not the case for many TV's. Please check if your TV has an option in its settings for enabling this, as some do. If not, you can [try your luck with HDMI CEC signals](http://raspberrypi.stackexchange.com/questions/9142/commands-for-using-cec-client), but the TV implementations of the spec are notoriously spotty. +- **The MicroSD card isn't flashing correctly, I don't see the boot partition.** This commonly happens on Windows computers and can be fixed by extracting the `chilipie*.img` file from the `tar.gz`. You will need to use an extraction tool that supports both gzip and tar archive formats, such as 7zip. Extract the contents of the `img.tar.gz` file, then extract the contents of the resulting `img.tar` file again. You should be left with an `.img` file, which you can then use with Etcher to flash your SD card. ## Acknowledgements From 5bf2b26fbee9b07eba819928b9cb08c1629a42b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Hou=C5=BEvi=C4=8Dka?= Date: Mon, 13 Sep 2021 20:05:11 +0200 Subject: [PATCH 5/6] Update display-on.sh --- home/display-on.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/home/display-on.sh b/home/display-on.sh index 6bdf0a6..794b064 100755 --- a/home/display-on.sh +++ b/home/display-on.sh @@ -1,3 +1,3 @@ #!/bin/bash -sudo tvservice -p > /dev/null && sudo chvt 2 && sudo chvt 1 # for whatever reason, cycling virtual terminals helps wake up the display in some cases +sudo vcgencmd display_power 1 > /dev/null From daeada85c987ec699b92fcd5166ce70fbe99c8fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Hou=C5=BEvi=C4=8Dka?= Date: Mon, 13 Sep 2021 20:05:24 +0200 Subject: [PATCH 6/6] Update display-off.sh --- home/display-off.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/home/display-off.sh b/home/display-off.sh index efb1962..90cf3a2 100755 --- a/home/display-off.sh +++ b/home/display-off.sh @@ -1,3 +1,3 @@ #!/bin/bash -sudo tvservice -o > /dev/null +sudo vcgencmd display_power 0 > /dev/null