Skip to content

Commit 61977a2

Browse files
committed
Merge branch 'master' into raspbian-bullseye
2 parents 7897b3a + 799e1b3 commit 61977a2

8 files changed

+37
-8
lines changed

README.md

+13-3
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,18 @@ Easy-to-use **Raspberry Pi** image for booting directly into **full-screen Chrom
2828
2. Download the [latest image](https://github.com/futurice/chilipie-kiosk/releases).
2929
3. Decompress it.
3030
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`.
31-
5. *Optional*: [Setup automatic WiFi](#automatic-wifi-setup)
32-
6. Insert the SD card to your Pi and power it up.
33-
7. You should land in the [first-boot document](docs/first-boot.md), for further instructions & ideas.
31+
5. *Optional*: [Set URL before boot](#set-url-before-boot)
32+
6. *Optional*: [Setup automatic WiFi](#automatic-wifi-setup)
33+
7. Insert the SD card to your Pi and power it up.
34+
8. You should land in the [first-boot document](docs/first-boot.md), for further instructions & ideas.
35+
36+
### Set URL before boot
37+
38+
1. After flashing remount your SD card.
39+
2. Create a *chilipie_url.txt* in your SD cards boot folder or */home/pi*.
40+
3. Write URL in **first** line of file.
41+
42+
Note: You can user `${SERIAL}` to get Pi's serial number into URL.
3443

3544
### Automatic WiFi setup
3645

@@ -66,6 +75,7 @@ The Pi needs a [2.5 Amp power source](https://www.raspberrypi.org/documentation/
6675
- **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.
6776
- **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.
6877
- **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.
78+
- **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.
6979

7080
## Acknowledgements
7181

docs/image-setup.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ ssh "touch .hushlogin" # https://scribles.net/silent-boot-on-raspbian-stretch-in
216216
ssh "sudo perl -i -p0e 's#--autologin pi#--skip-login --noissue --login-options \"-f pi\"#g' /etc/systemd/system/getty@tty1.service.d/autologin.conf" # "perl" is more cross-platform than "sed -i"
217217

218218
working "Installing packages"
219-
ssh "sudo apt-get update && DEBIAN_FRONTEND=noninteractive sudo apt-get install -y vim matchbox-window-manager unclutter mailutils nitrogen jq chromium-browser xserver-xorg xinit rpd-plym-splash xdotool rng-tools xinput-calibrator"
219+
ssh "sudo apt-get update && DEBIAN_FRONTEND=noninteractive sudo apt-get install -y vim matchbox-window-manager unclutter mailutils nitrogen jq chromium-browser xserver-xorg xinit rpd-plym-splash xdotool rng-tools xinput-calibrator cec-utils"
220220
# We install mailutils just so that you can check "mail" for cronjob output
221221

222222
working "Setting home directory default content"

home/.xsession

+14-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,19 @@ if [ -f .config/chromium/Default/Preferences ]; then
2626
fi
2727

2828
# Remove notes of previous sessions, if any
29-
find .config/chromium/ -name "Last *" | xargs rm
29+
find .config/chromium/ -name "Last *" -exec rm {} +
30+
31+
# Get URL from file (if set)
32+
URL=""
33+
if [ -f /boot/chilipie_url.txt ]; then
34+
URL="$(head -n 1 /boot/chilipie_url.txt)"
35+
elif [ -f /home/pi/chilipie_url.txt ]; then
36+
URL="$(head -n 1 /home/pi/chilipie_url.txt)"
37+
fi
38+
if [ -n "$URL" ]; then
39+
SERIAL="$(cat /proc/cpuinfo | grep Serial | cut -d ' ' -f 2 | xargs)" # Get serial number
40+
URL="$(echo $URL | SERIAL=$SERIAL envsubst '$SERIAL')"
41+
fi
3042

3143
# Start and detach Chromium
3244
# http://peter.sh/experiments/chromium-command-line-switches/
@@ -36,7 +48,7 @@ chromium-browser \
3648
--window-position=9000,9000 \
3749
--disable-infobars \
3850
--check-for-update-interval=1 --simulate-critical-update \
39-
&
51+
$URL &
4052
# See https://github.com/futurice/chilipie-kiosk/issues/99#issuecomment-597119842 for the need for the fishy-sounding "--check-for-update-interval=1 --simulate-critical-update" switches; TODO: remove when not needed
4153

4254
# Hide Chromium while it's starting/loading the page

home/cec-off.sh

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/bash
2+
3+
echo 'standby 0' | cec-client -s > /dev/null

home/cec-on.sh

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/bash
2+
3+
echo 'on 0' | cec-client -s > /dev/null

home/crontab.example

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ DISPLAY=:0.0
1414
0 3 * * * sudo reboot
1515

1616
# Example: Turn display on weekdays at 7 AM
17+
# Note: You may exchange "display-on" / "display-off" with "cec-on" / "cec-off" in order to use HDMI CEC
1718
# 0 7 * * 1-5 ~/display-on.sh
1819

1920
# Example: Turn display off weekdays at 7 PM (and after the nightly reboot)

home/display-off.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
#!/bin/bash
22

3-
sudo tvservice -o > /dev/null
3+
sudo vcgencmd display_power 0 > /dev/null

home/display-on.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
#!/bin/bash
22

3-
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
3+
sudo vcgencmd display_power 1 > /dev/null

0 commit comments

Comments
 (0)