5.5 KiB
RIP
Description
Rip is a dedicated playout system wich launch a video using a PIR sensor on a Raspberry Pi 400.
It's based on the great work of Alex Lubbock with vidlooper.
A really light apache webapp provide the ability to change the movie and the splashscreen. So the wifi interface of the raspberry pi 400 is turned into an access point.
setup
- setup hostname and basic raspbian setup
By default raspberry OS (aka raspbian) boot in graphical mode in it's full version.
I think that the lite version does not.
:~$ sudo raspi-config
In raspi-config change default password for security.
1 System Options > S3 Password
Then change hostname to the one you want.
1 System Options > S4 Hostname
Change default Boot to autologin console
1 System Options > S5 Autologin
Now for the display properties, if you have some issues with a black border and the picture in center of it, go to.
2 Display Options >> D2 Underscan >> Yes
Set the GPU memory amount to be enough for display HD video or more if you need. Be careful with this parameter because it's a fine tuned setting and may result in some performance issues.
4 Performance Options >> P2 Memory >> something like 512 Mo or 256 Mo will do.
You can hang around to see other parameters but for now we're done with those basics setup.
- update / upgrade raspbian
Raspbian has release a new version so --allow-releaseinfo-change option is important and need to be done 2 times.
:~$ sudo apt-get update --allow-releaseinfo-change
:~$ sudo apt-get update --allow-releaseinfo-change
:~$ sudo apt-get upgrade
:~$ sudo apt-get dist-upgrade
- Installing software
:~$ sudo apt-get install hostapd dnsmasq apache2 vsftpd php omxplayer fbi
:~$ sudo pip3 install vidlooper
- Configure Wifi AP, dnsmasq and IP settings
[found on this repo](https://github.co (https://github.com/a2mSystemes/wl-p2p-wifi)m/t2age/wl-p2p-wifi) and of course forked in mine own repo (https://github.com/a2mSystemes/wl-p2p-wifi) for the Wifi AP part.
Stop all services that we have just install.
:~$ sudo service dnsmasq stop
:~$ sudo service vsftpd stop
:~$ sudo service apache2 stop
:~$ sudo service hostapd stop
Save a copy of dhcpcd.conf and edit dhcpcd.conf
:~$ sudo mv /etc/dhcpcd.conf /etc/dhcpcd.conf.orig
:~$ sudo nano /etc/dhcpcd.conf
add these lines :
interface wlan0
static ip_address=192.168.50.1/24
nohook wpa_supplicant
and uncomment eth0 profile to enable dhcp fallback to a static IP
# define static profile
profile static_eth0
static ip_address=192.168.10.23/24
static routers=192.168.10.254
static domain_name_servers=8.8.8.8 8.8.4.4
# fallback to static profile on eth0
interface eth0
fallback static_eth0
You can just send a copy of the dhcpcd.conf in this folder with scp.
So close your remote session
:~$ exit
and then in the host command prompt do.
:~$ scp ./dhcpcd.conf pi@YOUR-PI-IP-ADDRESS:dhcpcd.conf
pi@YOUR-PI-IP-ADDRESS's password:
Replace YOUR-PI-IP-ADDRESS by the raspberry pi ip address. You will be ask to type your ssh password.
Then log back your pi with ssh and put the file in the right place.
:~$ sudo mv dhcpcd.conf /etc/dhcpcd.conf
Do the same for hostapd.conf and dnsmask.conf. of course replace YOUR-PI-IP-ADDRESS by your pi ip address. In host :
:~$ scp ./hostapd.conf pi@YOUR-PI-IP-ADDRESS:hostapd.conf
pi@YOUR-PI-IP-ADDRESS's password:
:~$ scp ./dnsmask.conf pi@YOUR-PI-IP-ADDRESS:dnsmask.conf
pi@YOUR-PI-IP-ADDRESS's password:
And back in the pi.
:~$ sudo mv hostapd.conf /etc/hostapd/hostapd.conf
:~$ sudo mv dnsmask.conf /etc/dnsmask.conf
Obviously, you have to change some configuration in /etc/hostapd/hostapd.conf to suite your needs. In fact adjust as minimal requirements the SSID and the PASSWORD on these lines.
ssid=AP-SSID
wpa_passphrase=AP-WIFI-PASSWORD
And we are not done yet with hostapd. you have to setup the default config file that hostapd will use. To do that, edit /etc/default/hostapd
:~$ sudo nano /etc/default/hostapd
And uncomment the line DAEMON_OPTS and put the path of the conf file we have copy. Ctrl-X to exit nano then yes to save changes again.
DAEMON_CONF="/etc/hostapd/hostapd.conf"
Unmask (unlock) hostapd service
sudo systemctl unmask hostapd.service
sudo systemctl enable hostapd.service
now we are ready to reboot and see if the access point is working properly.
:~$ sudo reboot
- Configure vsftpd, apache2 and php :
From host copy vsftpd.conf
:~$ scp ./vsftpd.conf pi@YOUR-PI-IP-ADDRESS:vsftpd.conf
pi@YOUR-PI-IP-ADDRESS's password:
:~$ cd
:~$ sudo mv vsftpd.conf /etc/vsftpd.conf
:~$ mkdir VidLooper
:~$ sudo chgrp -R www-data VidLooper
:~$ sudo chmod -G www-data ftp
:~$ sudo chmod -R g+rwx ./VidLooper
:~$ git clone https://github.com/a2msystemes/RIP
:~$ cd RIP
:~$ cp -R site/ ../VidLooper
- launch vidlooper at startup