Pixframe Installation and Configuration
Install Raspbian from current image using keyboard and mouse
- Set location (country, time zone etc)
- Change pi password
- Set boot option to logon automatically into GUI
- Chose Wifi network and password [can be configured later]
- Under Interface tab set to allow SSH connection.
- Update software and reboot
[The above parameters can be changed or revised later if needed using raspi-config]
Log on using pi password.
- Change root password:
- Amend /etc/ssh/sshd.config to
- Do sudo ifconfig and note IP addresses for Wlan (and Ethernet and if both are present).
- Open console and do:
- apt-get install xscreensaver
- apt-get install feh
- From GUI menu find the newly added screensaver and set it to disable (prevents monitor sleep)
- In directory: /etc/systemd/system/getty@ttyl.service.d verify or change autologin.conf for pi.
[Service]
ExecStart=
ExecStart=-/sbin/agetty --autologin pi --noclear %I $TERM
- Check noclear.conf. Should be:
[Service]
TTYVTDisallocate=no
- Verify or change WiFi configuration /etc/wpa_supplicant/wpa_supplicant.conf
[use appropriate SSID and password]:
network={
ssid="WifiNetworkName"
psk="wifipassword"
}
>
Thumb Drive Photo collection
The scripts described in the next section will look for pictures under /mnt/photos which is where the thumb drive gets mounted. The USB thumb drive should be formatted as FAT32. Windows may not allow large size FAT32 from GUI but it can be with other software such as EaseUS Partition Master or open source software. Pictures should be copied into a folder called /photos and videos into a folder called /videos on the usb drive. Start by copying folders directly from the computer to the thumb drive.
Copy photos and videos
Use windows command line robocopy. Adjust drive letters and paths below as necessary.
robocopy D:\photos *.* /S /XF:*.mov /r:1 K:photos
robocopy D:\videos *.mov /S /XF:*.mov /r:1 K:\videos.
The /S switch is coppy subdirectories recursively.
The /XF:*.mov switch skips over any .mov files.
The /r switch limits retries from any failure to one rather than the default million.
Automate mounting of thumb drive
Insert the thumb drive with photos (and posssibly videos) into a raspberry pi USB sockets and boot with keyboard and mouse attached.
From a console do
bslk
and
fdisk
to identify the location of the thumb drive. It should be dev/sda<#> .
Add a line similar to the one below using the sda number to /etc/fstab so that the USB drive gets mounted under /mnt:
/dev/sda1 /mnt vfat defaults, auto, umask=000, rw, user 0 0
A mismatch between drive designation in /etc/fstab and drive location may prevent boot and require “emergency” console logon.
Download and untar these two tarball files: panel.tar.gz and pibin.tar.gz .
they must be run from the top / folder in order to put the scripts in the right places.
root@pixiepi2:/# tar -xvf pibin.tar.gz
pibin is needed to put scripts into /home/pi/bin and home/pi/.bashrc to call them following autologon.
root@pixiepi2:/# tar -xvf panel.tar.gz
panel is needed to put the control panel scripts into the web server control panel
Control Panel
The set of scripts listed below run from web server software and allows the pixframe screen to be controlled remotely by a laptop or a phone using wifi by going to http://[ip address or name of pixframe].
Install apache2 web server.
Configure the Apache DocumentRoot as /var/www/html/pi. Look in etc/apache2/sites-enabled/000-default.conf.
Add following code to apache2.conf (allows showing thumbnails of photos not under Apache DocumentRoot) :
Alias "/image" "/mnt/photos"
</Directory "/mnt/photos">
Require all granted
</Directory>
Add apache to the sudoers file with this line using visudo:
www-data ALL=NOPASSWD ALL
These files should be in /var/www/html/pi:
blackscreen
BlackScreen.jpg
BlackScreen.png
boot.php
dirlist.php
dirlist.php.commented
eth0.txt
getip
getstartdir.php
keyboard.php
killphotos
killphotos.php
listfiles.php
makevarstore.php
newdirlist.php
newstart.php
pickthumbs.php
pickvid.php
pixdelay.php
PixFrameDoc.html
random.php
randomstart
reboot.php
rundelparms
runsubdir
runthumbs
runvid
runvid.php
setdelay.php
showip.php
shutdown.php
slidesubdir.php
style.css
thumbs.php
thumbsubdir.php
varstore
widescreen
widescreen.php
wlan0.txt
writedelay.php
These files should be in /home/pi/bin
BlackScreen.gif
BlackScreen.png
boxip
geteth0
getip
getwlan0
ipbox
killphotos
runphotos
Index.html contains the menu of actions. It calls php scripts which call various bash scripts most of which end up calling feh to send its output to the directly attached screen after setting parameters. A standard call on feh is a variation on the line below where $PIXDELAY is the time of each slide and $pdir is the directory to start from.
DISPLAY=:0.0 XAUTHORITY=/home/pi/.Xauthority feh --no-fehbg --auto-zoom --auto-rotate --fullscreen --recursive --quiet --hide-pointer --slideshow-delay $PIXDELAY "$pdir" &