-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathfeh-pi-picture-frame
175 lines (121 loc) · 5.53 KB
/
feh-pi-picture-frame
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
1. Install Raspberry Pi OS using Raspberry Pi Imager
Use advanced options to enable ssh, wifi, etc.
https://www.raspberrypi.org/software/
https://www.tomshardware.com/news/raspberry-pi-imager-now-comes-with-advanced-options
2. Install unattended upgrades
sudo apt install unattended-upgrades -y
sudo nano /etc/apt/apt.conf.d/50unattended-upgrades
add to
Unattended-Upgrade::Origins-Pattern {
"origin=Raspbian,codename=${distro_codename},label=Raspbian";
"origin=Raspberry Pi Foundation,codename=${distro_codename},label=Raspberry Pi Foundation";
"o=Syncthing";
run sed
sudo sed -i 's/^\/\/Unattended-Upgrade::Automatic-Reboot "false";/Unattended-Upgrade::Automatic-Reboot "true";/g' /etc/apt/apt.conf.d/50unattended-upgrades
sudo sed -i 's/^\/\/Unattended-Upgrade::Automatic-Reboot-Time "02:00";/Unattended-Upgrade::Automatic-Reboot-Time "02:00";/g' /etc/apt/apt.conf.d/50unattended-upgrades
sudo sed -i 's/^\/\/Unattended-Upgrade::Remove-Unused-Dependencies "false";/Unattended-Upgrade::Remove-Unused-Dependencies "true";/g' /etc/apt/apt.conf.d/50unattended-upgrades
sudo tee /etc/apt/apt.conf.d/20auto-upgrades > /dev/null <<EOF
APT::Periodic::Update-Package-Lists "1";
APT::Periodic::Unattended-Upgrade "1";
EOF
# You could also create this file by running "dpkg-reconfigure -plow unattended-upgrades"
check w/
sudo unattended-upgrade -v -d --dry-run
tail -n 4 /var/log/unattended-upgrades/unattended-upgrades.log
https://raspberrypi.stackexchange.com/questions/72022/configuring-unattended-upgrades-on-raspbian-stretch
https://unix.stackexchange.com/questions/273969/why-is-unattended-upgrades-not-sending-emails
https://askubuntu.com/questions/326156/how-to-customize-unattended-upgrades-notification-emails
https://unix.stackexchange.com/questions/342663/who-starts-unattended-upgrades
2. update system
sudo apt update && sudo apt dist-upgrade -y
3. Install feh
install the dependencies:
sudo apt install libcurl4-openssl-dev libx11-dev libxt-dev libimlib2-dev libxinerama-dev libjpeg-progs libexif-dev libheif-dev libimlib2-dev libde265-dev -y
check out the git version:
git clone https://git.finalrewind.org/feh
cd feh
Now, compile and install feh:
make -j4 curl=1 xinerama=1 verscmp=1 exif=1
sudo make install
https://feh.finalrewind.org/
4. enable HEIC support
git clone https://github.com/vi/imlib2-heic.git
make
sudo make install
https://github.com/vi/imlib2-heic
3. Setup Wireless
place wpa_supplicant.conf in boot with EOL in unix style
country=US
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
https://core-electronics.com.au/tutorials/raspberry-pi-zerow-headless-wifi-setup.html
https://wiki.brewpi.com/getting-started/raspberry-pi-docker-install
https://raspberrypi.stackexchange.com/questions/67649/raspberry-pi-zero-w-headless-using-wpa-supplicant-conf-not-working
https://www.raspberrycoulis.co.uk/hints-tips/raspberry-pi-multiple-wifi-networks/
4. Create directories
mkdir -p /home/pi/photos-copy
5b. setup ssh-copy-id
Copy your public key to your Raspberry Pi
ssh-copy-id <USERNAME>@<IP-ADDRESS>
https://www.raspberrypi.org/documentation/remote-access/ssh/passwordless.md
6. Install Syncthing
wget -O - https://syncthing.net/release-key.txt | sudo apt-key add -
echo "deb http://apt.syncthing.net/ syncthing release" | sudo tee -a /etc/apt/sources.list.d/syncthing-release.list
sudo apt update
sudo apt install syncthing -y
Create config files by running 'syncthing"
then Kill the syncthing process with Ctrl+C in the Terminal
create systemd entry (look @ pimylifeup)
sudo nano /lib/systemd/system/syncthing.service
[Unit]
Description=Syncthing - Open Source Continuous File Synchronization
Documentation=man:syncthing(1)
After=network.target
[Service]
User=pi
ExecStart=/usr/bin/syncthing -no-browser -no-restart -logflags=0
Restart=on-failure
RestartSec=5
SuccessExitStatus=3 4
RestartForceExitStatus=3 4
# Hardening
ProtectSystem=full
PrivateTmp=true
SystemCallArchitectures=native
MemoryDenyWriteExecute=true
NoNewPrivileges=true
[Install]
WantedBy=multi-user.target
autostart syncthing
sudo systemctl enable [email protected]
go to webpage to setup everything else
http://xxxxx:8384
https://pimylifeup.com/raspberry-pi-syncthing/
4. Setup .xsession / feh
.xsession
# disable screensaver
xset s noblank
xset s off
xset -dpms
# use PIR sensor to turn on/off display
# /home/pi/pir-control.py &
# start slideshow
feh --auto-rotate -d -F -r -Z -z -R 3600 -D 30 photos-copy/
https://www.splitbrain.org/blog/2018-05/12-diy_digital_picture_frame
run raspi-config to adjust locales and boot into desktop (must auto-login) by default
5. Turn the monitor on and off automatically (optional)
wget https://gist.githubusercontent.com/SirCrocker/937d06f8f2c1227a83802b9b77f60ba0/raw/3f9c9558d7d15dfdb035e77bc6a77ad0d1abd5ea/rpi-hdmi-tv.sh
sudo apt-get install cec-utils -y
To turn the monitor on/off on a daily schedule, grab this script and put it in /home/pi/rpi-hdmi.sh. Next, make it executable:
chmod +x /home/pi/rpi-hdmi-tv.sh
Add a cron entry to call this script at the desired time
crontab -e
And add the following lines at the bottom of the file:
# Turn HDMI Off (21:30)
30 21 * * * /home/pi/rpi-hdmi.sh off >/dev/null 2>&1
# Turn HDMI On (9:00/9:00am)
0 9 * * * /home/pi/rpi-hdmi.sh on >/dev/null 2>&1
vcgencmd works. the other will turn off the monitor but wont show anything when turning it back on
https://www.screenly.io/blog/2017/07/02/how-to-automatically-turn-off-and-on-your-monitor-from-your-raspberry-pi/
https://raspberrypi.stackexchange.com/questions/52042/turning-tvservice-on-and-off-leaves-screen-blank
apt-get update --allow-releaseinfo-change