-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: aNullValue <[email protected]>
- Loading branch information
1 parent
a958da5
commit eb5bfdd
Showing
6 changed files
with
192 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,92 @@ | ||
# rpi-pictureframe-slideshow-config | ||
# rpi-slideshow-config | ||
My crappy little config to have an rpi 3b act as a "picture frame" | ||
|
||
## What | ||
|
||
this is woefully insecure. i don't recommend using it. use at your own risk. etc. etc. i've spent like 5 minutes on this. | ||
|
||
these are my notes-to-self as to how i got this rpi working as a picture frame, that would self-update from a gdrive file share | ||
|
||
last performed 2019-06-26 | ||
|
||
rpi 3b | ||
|
||
Dell UltraSharp LCD | ||
|
||
HDMI -> DVI adapter | ||
|
||
## Instructions | ||
|
||
0a. set up an account on a web file sharing doohickey like google drive. | ||
|
||
0b. create folders "picturesync" and "configsync" and note where in the path you put them. | ||
|
||
0c. put all of the files from this repo in the "configsync" folder. | ||
|
||
0c. edit wpa_supplicant.conf to ensure that it's correct for you (it's not by default). refer to wpa_supplicant on a real working rpi3b to get a feel for what it should be like. or google it, i'm not your boss, i'm you. | ||
|
||
0d. of course you should also review the rest of the files for accuracy because lord only knows what typos there might be | ||
|
||
0e. adjust "cron_frequent.sh" so that your preferred times are used for when the display should be put to sleep | ||
|
||
1. download noobs | ||
|
||
2. follow the instructions on the rpi official website to get noobs running | ||
|
||
3. | ||
```bash | ||
sudo nano /etc/lightdm/lightdm.conf | ||
``` | ||
|
||
Now in here add the following line anywhere beneath the [SeatsDefaults] line. | ||
|
||
``` | ||
xserver-command=X -s 0 | ||
``` | ||
|
||
4. | ||
```bash | ||
sudo nano /etc/rc.local | ||
``` | ||
|
||
Add just before exit 0: | ||
```bash | ||
bash /home/pi/rclocal_startup.sh & | ||
``` | ||
|
||
5. | ||
```bash | ||
sudo apt-get install feh | ||
curl https://rclone.org/install.sh | sudo bash | ||
rclone configure # Use the knowledge you obtained during step 0 to properly configure rclone. in this doc the remote is called "remoteside" | ||
mkdir /home/pi/picturesync | ||
mkdir /home/pi/configsync | ||
rclone sync remoteside:/configsync /home/pi/configsync | ||
cp /home/pi/configsync/periodic_sync.sh /home/pi/periodic_sync.sh | ||
chmod +x /home/pi/periodic_sync.sh | ||
sudo /home/pi/periodic_sync.sh | ||
sudo su - | ||
mkdir /root/.config | ||
mkdir /root/.config/rclone | ||
cp /home/pi/.config/rclone/rclone.conf /root/.config/rclone/rclone.conf | ||
``` | ||
|
||
6. | ||
```bash | ||
crontab -e | ||
``` | ||
|
||
Add these lines: | ||
|
||
``` | ||
0/15 * * * * sudo /home/pi/periodic_sync.sh | ||
* * * * * /home/pi/cron_frequent.sh | ||
``` | ||
|
||
7. | ||
```bash | ||
sudo /home/pi/periodic_sync.sh | ||
reboot | ||
``` | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/bin/bash | ||
currenttime=$(date +%H:%M) | ||
if [[ "$currenttime" > "21:00" ]] || [[ "$currenttime" < "06:30" ]]; then | ||
# monitor should be off | ||
vcgencmd display_power 0 | ||
else | ||
# monitor should be on | ||
vcgencmd display_power 1 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
#!/bin/bash | ||
rclone sync farside:/configsync /home/pi/configsync | ||
|
||
if test -f "/home/pi/configsync/start_picture_frame.sh" | ||
then | ||
file1md5=$(md5sum < /home/pi/start_picture_frame.sh) | ||
file2md5=$(md5sum < /home/pi/configsync/start_picture_frame.sh) | ||
if [ "$file1md5" = "$file2md5" ] | ||
then | ||
: # do nothing | ||
else | ||
rm -f /home/pi/start_picture_frame.sh | ||
cp /home/pi/configsync/start_picture_frame.sh /home/pi/start_picture_frame.sh | ||
chmod +x /home/pi/start_picture_frame.sh | ||
fi | ||
fi | ||
|
||
if test -f "/home/pi/configsync/rclocal_startup.sh" | ||
then | ||
file1md5=$(md5sum < /home/pi/rclocal_startup.sh) | ||
file2md5=$(md5sum < /home/pi/configsync/rclocal_startup.sh) | ||
if [ "$file1md5" = "$file2md5" ] | ||
then | ||
: # do nothing | ||
else | ||
rm -f /home/pi/rclocal_startup.sh | ||
cp /home/pi/configsync/rclocal_startup.sh /home/pi/rclocal_startup.sh | ||
chmod +x /home/pi/rclocal_startup.sh | ||
fi | ||
fi | ||
|
||
if test -f "/home/pi/configsync/periodic_sync.sh" | ||
then | ||
file1md5=$(md5sum < /home/pi/periodic_sync.sh) | ||
file2md5=$(md5sum < /home/pi/configsync/periodic_sync.sh) | ||
if [ "$file1md5" = "$file2md5" ] | ||
then | ||
: # do nothing | ||
else | ||
rm -f /home/pi/periodic_sync.sh | ||
cp /home/pi/configsync/periodic_sync.sh /home/pi/periodic_sync.sh | ||
chmod +x /home/pi/periodic_sync.sh | ||
fi | ||
fi | ||
|
||
if test -f "/home/pi/configsync/cron_frequent.sh" | ||
then | ||
file1md5=$(md5sum < /home/pi/cron_frequent.sh) | ||
file2md5=$(md5sum < /home/pi/configsync/cron_frequent.sh) | ||
if [ "$file1md5" = "$file2md5" ] | ||
then | ||
: # do nothing | ||
else | ||
rm -f /home/pi/cron_frequent.sh | ||
cp /home/pi/configsync/cron_frequent.sh /home/pi/cron_frequent.sh | ||
chmod +x /home/pi/cron_frequent.sh | ||
fi | ||
fi | ||
|
||
if test -f "/home/pi/configsync/wpa_supplicant.conf" | ||
then | ||
file1md5=$(md5sum < /etc/wpa_supplicant/wpa_supplicant.conf) | ||
file2md5=$(md5sum < /home/pi/configsync/wpa_supplicant.conf) | ||
if [ "$file1md5" = "$file2md5" ] | ||
then | ||
: # do nothing | ||
else | ||
sudo cat /home/pi/configsync/wpa_supplicant.conf > /etc/wpa_supplicant/wpa_supplicant.conf | ||
fi | ||
fi | ||
|
||
rclone sync farside:/picturesync /home/pi/picturesync |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/bash | ||
sleep 30 | ||
/home/pi/start_picture_frame.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#!/bin/bash | ||
DISPLAY=:0.0 XAUTHORITY=/home/pi/.Xauthority /usr/bin/feh -q -K . -z -Z -F -R 60 -Y -D 15.0 /home/pi/picturesync |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev | ||
update_config=1 | ||
country=US | ||
|
||
network={ | ||
ssid="myssid1" | ||
psk="somepassword" | ||
} | ||
|
||
network={ | ||
ssid="myssid2" | ||
psk="anotherpassword" | ||
} | ||
|