-
Notifications
You must be signed in to change notification settings - Fork 7
Raspberry Pi 2 3 Setup Guide
These instructions are for setting up an ARMv7 Raspberry Pi as a production display server. The autostart implementation is based in part off of this blog post.
Download the Raspbian Lite image and follow the installation guide to write it to a microSD card.
Log in as pi
with password raspberry
. Run sudo raspi-config
and make the following changes:
- Expand filesystem
- Change the password
- Under Internationalisation, change the locale/timezone/keyboard layout/Wi-Fi Country appropriately from the UK defaults.
- Under Advanced Options:
- Disable overscan
- Set hostname (Admin should assign a hostname for the device)
Upgrade installed packages:
sudo apt-get update
sudo apt-get upgrade
Open /boot/config.txt
as root and edit the following lines:
# Uncomment and edit these lines
hdmi_group=2 # Use DMT
hdmi_mode=82 # Set resolution to 1080p 60Hz
# Add this line
framebuffer_depth=32
Restart the Raspberry Pi when done.
Install the following packages:
# X11 things
sudo apt-get install xorg
sudo apt-get install --no-install-recommends lightdm
sudo apt-get install matchbox-window-manager
# Goodies
sudo apt-get install vim git htop
Create a user which will be automatically logged into on boot:
sudo adduser display
Download the latest ARM build of Electron from here:
cd
wget https://github.com/atom/electron/releases/download/v0.37.2/electron-v0.37.2-linux-arm.zip
unzip electron-v0.37.2-linux-arm.zip -d electron
Install nvm:
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.31.0/install.sh | bash
nvm install node
cd
git clone https://github.com/acm-uiuc/display.git
cd display
cp src/secrets.js.sample src/secrets.js
vim src/secrets.js
# Configure secrets.js with required API keys
npm install # This may take a long time the first time around to do some compilation
npm run build # Build JS and CSS files. This may take a minute or longer on the Pi.
Create file ~/.xsession
with the following contents:
xset s off
xset -dpms
matchbox-window-manager &
while true; do
$HOME/electron/electron $HOME/display >> $HOME/display.log 2>&1
done
Open /etc/lightdm/lightdm.conf
as root and uncomment and edit the following lines:
xserver-command=X -nocursor
autologin-user=display
Add user display
to the group autologin
:
sudo groupadd -r autologin
sudo gpasswd -a display autologin
Run sudo raspi-config
and go to Boot Options and select Desktop Autologin.
Open /etc/systemd/system/[email protected]
as root and comment the following line:
#ExecStart=-/sbin/agetty --autologin pi --noclear %I $TERM
cd display
git pull
npm run build
pkill electron # Electron will automatically restart