Config Raspberry Pi As Picture Frame
Here is a guide to set up your Raspberry Pi as a picture frame to show pictures stored on your local Raspberry pi's disk.
Disable Low Voltage Warning
1.To disable the low voltage warning, we will need to modify the boot config file.
You can begin modifying this file by running the following command on your device.
This config file is available on the boot partition when you plug the SD Card on your Raspberry Pi.
2. Within this file, you will need to add the following line to the bottom of the file. By setting this value to 1
, we are telling it to disable all warning overlays.
Please note this means you will no longer receive any more warnings about your Pi not receiving enough voltage.
3. Once you have added this line, save the file by pressing CTRL + X, then Y, followed by the ENTER key.
4. We also need to remove the “battery monitor” plugin. This plugin is responsible for showing the notification you may see in the top-right corner of your screen.
You can remove this LXPanel plugin by using the following command on your device.
5. For this change to take effect, you will need to restart your Raspberry Pi.
You can restart by using the following command in the terminal.
Fix Raspberry Pi Apt update issue
1.Let’s begin modifying this file by running the following command on the Raspberry Pi.
2. Within this file, you will see the following text.
This text defines which repository the package manager will connect to when updating.
uncomment last line will allow apt update to get source list.
Turn Off Screen Blaning
Click on the Menu button
on the upper right (Raspberry Pi Icon) >> Preferences
>> Raspberry Pi Configuration
.
In Raspberry Pi Configuration Window, click on Display
Tab.
Look for the Screen Blanking
row, click Disable
.
Then click OK
.
Apt Update and Install Package
pi@raspberrypi:~ $ sudo -i
root@raspberrypi:~# apt update
Feh can show different size photos to your LCD.
1. To install the package, use the following line:
2. Now to test that it works enter the following line. Replace /media/NASHDD1/test
with the directory that contains all your image (/home/pi/Pictures).
3. Now we can use short tags to make this command a lot shorter. You can read more about all the flags you can use over at the feh manual page.
4. Now as you will notice this locks up the command line bar. To fix this, add the & after the command and the script/process will launch in the background.
5. So now let’s store this in a simple script file. This way you can add or change it later. To make the file enter the following command:
6. In here, enter the following lines.
7. Now that’s done you can test it by running the following command.
8. Finally, let’s have it start at boot. Now it is important that you have SSH enabled so you can access the Pi remotely as you will lose access to the GUI/Screen. So make sure you have done this before setting it to launch at boot up.
9. To do this open up the rc.local file by entering the following command.
10. Add the following before the exit 0 line in this folder.
11. If you ever need to kill the process as you may want to be able to access the desktop, simply enter the following line.
You should now have your very own slideshow of pictures going. If you end up with any troubles, then double check all the steps and look for any errors. If you’re still having trouble, then be sure to seek help on our forums.
Autostart Slideshow
Depend on your LCD screen resolution, image size will be vary. For my LCD screen 3.5 inch, it is 480 x 320 pixels.
Autostart is the best way to run GUI-based Raspberry Pi programs on startup. It works by ensuring that both the X Window system and the LXDE desktop environment are available before the system runs any of the scheduled programs.
If you have a script that runs in the windowed mode, or you want to run any of the GUI-based programs/applications at startup on your Raspberry Pi, you should schedule them to run using autostart. Here are the steps to do this.
- First, open the terminal and enter the following command to create a .desktop file in the autostart directory: sudo nano /etc/xdg/autostart/display.desktop. We've used display.desktop as file name, but you can name your desktop file anything you want.
- In the .desktop file, add the following lines of code:
[Desktop Entry]
Name=Slideshow
Exec=bash /home/pi/start-picture-frame.sh - In this file, replace the value for the Name field with your project/script name. Similarly, we've added our display.py program to run every time the Raspberry Pi boots up.
- However, you can replace it with any program that you want to run. In fact, you can even schedule to run a third-party program, like the Chrome browser; in which case, the .desktop file should include the following code:
[Desktop Entry]
Name=Chrome
Exec=chromium-browser - After that, hit CTRL + O to save the file, and then enter sudo reboot to restart the Pi
As soon as your Pi boots up, your GUI program should automatically start as well. In case you'd like to stop your program from running at startup anymore, simply go to the autostart folder and remove the .desktop file you just created.
共有 0 条评论