{"id":13586642,"url":"https://github.com/peterdolenc/rpy-frame","last_synced_at":"2025-04-07T18:34:32.505Z","repository":{"id":222374937,"uuid":"125703261","full_name":"peterdolenc/rpy-frame","owner":"peterdolenc","description":"RPy-Frame is a python software made for Raspberry PI that enables you to make your own awesome-looking budget digital photo frame.","archived":false,"fork":false,"pushed_at":"2020-12-20T15:16:38.000Z","size":26562,"stargazers_count":18,"open_issues_count":2,"forks_count":7,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-02-13T21:36:48.857Z","etag":null,"topics":["digital-photo-frame","frame","photo-frame","python","raspberry-pi","raspi","rpy-frame","slideshow"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/peterdolenc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-03-18T07:47:20.000Z","updated_at":"2024-08-01T16:32:39.398Z","dependencies_parsed_at":null,"dependency_job_id":"2f8c1f70-6813-4869-94f7-d3385bbdc025","html_url":"https://github.com/peterdolenc/rpy-frame","commit_stats":null,"previous_names":["peterdolenc/rpy-frame"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peterdolenc%2Frpy-frame","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peterdolenc%2Frpy-frame/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peterdolenc%2Frpy-frame/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peterdolenc%2Frpy-frame/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/peterdolenc","download_url":"https://codeload.github.com/peterdolenc/rpy-frame/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247707759,"owners_count":20982844,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["digital-photo-frame","frame","photo-frame","python","raspberry-pi","raspi","rpy-frame","slideshow"],"created_at":"2024-08-01T15:05:42.343Z","updated_at":"2025-04-07T18:34:32.486Z","avatar_url":"https://github.com/peterdolenc.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"# RPy-Frame\nRPy-Frame is a python software made for Raspberry PI that enables you to make your own awesome-looking budget digital photo frame.\n\n![](screens/photo-frame-front.jpg)\n\n### Screens\n![](screens/screen1.jpg)\n![](screens/screen2.jpg)\n![](screens/screen3.jpg)\n\n### Highlights \u0026 features\n- Makes a slideshow of your photos, where each image is displayed for a configured amount of time\n- Photos are played in random order, however, once a photo is played a few images that were taken at about the same time will be played after it. The aim was to see a part of the event.\n- Photos are either scaled down so that they fit the screen or enlarged and scrolled during the playback. Since I find this behaviour tricky to get right, there are quite a few configuration rules available to tweak it.\n- When photo does not take the full screen, a background will be generated with a pattern that will use the dominant colors of the current photo.\n- There's also support for a GPIO push button, that can do the following at the moment:\n\t- short press: advance to next photo\n\t- long press: show previous photo\n- You can also use keyboard keys: left, right, space, ESC\n- Almost everything is configurable - have a look at src/settings.py\n\n### Running the slideshow\n\nYou can run the presentation by executing the following:\n```bash\npython3 main.py /path/to/your/images/dir\n```\nYou can always press Q or Esc during the presentation to stop it (to quit the app). If you don't specify the path to the images, then samples dir will be used.\n\nIf you want to explore configuration options of the app, then edit settings.py file. Currently there's no other documentation of all the settings but the settings.py, which is heavily commented.\n\nYou can run the program on your PC/Mac as well. Then you can use Q key to exit presentation or space to simulate the phisical button. On PC it's suggested to run it in dev/demo mode:\n```bash\npython3 main.py dev\n```\n\n# Installation\n### Python 3\nrpy-frame needs Python 3 to run. If you are using Raspberry PI, chances are you don’t have it yet and it might not be available through the apt package. Follow this guide to install it:\nhttps://gist.github.com/dschep/24aa61672a2092246eaca2824400d37f\n\n### Clone the repository\n\nClone rpy-frame repository:\n```bash\ngit clone https://github.com/peterdolenc/rpy-frame.git\n```\n\nTry running it\n```bash\ncd rpy-frame/src\npython3 main.py\n```\n\n### Install python packages\nProbably you will need to install all the missing python packages first. For most of pip packages you could instead make a global package installation with \"sudo apt-get install python3-package-name\" For me the recipe was the following:\n\n```bash\nsudo apt-get update\nsudo apt install libsdl2-dev libsdl2-image-dev libsdl2-mixer-dev libsdl2-ttf-dev libfreetype6-dev python3-setuptools python3-dev python3 libportmidi-dev\nsudo apt-get install python3-numpy libsdl1.2-dev libsdl-image1.2-dev libsdl-mixer1.2-dev libsdl-ttf2.0-dev libsmpeg-dev libavformat-dev libswscale-dev libjpeg-dev\nsudo pip install --upgrade pip\nsudo pip install pygame-ce\nsudo pip install pillow\nsudo pip install numpy\nsudo pip install matplotlib\nsudo pip install six\nsudo pip install fast_colorthief\nsudo pip install rpi-lgpio\nsudo pip install aiohttp\n```\n\n# Optional setup\nThere are two extra optional setup steps that you might want to configure.\n\n### Auto start presentation on boot\nCreate an sh file in your home directory called \"slideshow.sh\". This is the script that will get executed on startup. Set the path to your photos as desired. I also like to keep a log of last run somewhere.\n\n```bash\n/home/pi/rpy-frame/src/main.py /home/pi/photos/ \u003e\u003e lastrun.log \u0026\n```\n\nThere are multiple ways to configure auto start of an app when UI starts. I found this one to work best. Edit \"/.config/lxsession/LXDE-pi/autostart\" and add:\n\n```bash\n@/home/pi/slideshow.sh\n```\n\nFor bookworm or newer add this file instead - /etc/xdg/autostart/rpy.desktop:\n\n```bash\n[Desktop Entry]\nType=Application\nExec=/home/peter/slideshow.sh\nHidden=false\nNoDisplay=false\n```\n\nAlso don't forget to setup your raspi to boot to desktop and configure that \"start bar\" to auto.hide. This will give you the full \"kiosk mode\" experience.\n\n### Add API port redirect\n\nRaspbian linux probably comes with security restriction that only allows apps executed by the root to bind to ports bellow 1024. If you want the API to be served from default HTTP port 80, then the most flexible resolution is to actually run the API on another port, say 3000, and make a permanent redirect from 80 to 3000.\n\n```bash\nsudo apt-get install iptables iptables-persistent\nsudo iptables -t nat -I PREROUTING -p tcp --dport 80 -j REDIRECT --to-ports 3000\nsudo su\niptables-save -c \u003e /etc/iptables/rules.v4\nexit\n```\n\n### Turn off the display during the night to save energy\nI used crontab for that. The commands handle raspi's video out and basically get the screen to go to standby. Here are the two crontab commands that will add a schedule to turn off the display every day at 22.30 and turn it back up at 05:15 in the morning. Feel free to adjust to your needs.\n\n```bash\ncrontab 30 22 * * * vcgencmd display_power 0 \u003e/dev/null 2\u003e\u00261\ncrontab 15 5 * * * vcgencmd display_power 1 \u003e/dev/null 2\u003e\u00261\n```\n\nOn bookworm or newer you can use these instead:\n\n```bash\ncrontab 30 22 * * * xrandr --output HDMI-1 --off \u003e/dev/null 2\u003e\u00261\ncrontab 15 5 * * * xrandr --output HDMI-1 --auto \u003e/dev/null 2\u003e\u00261\n```\n\nOr use the script posted by p1r473 here:\nhttps://forums.raspberrypi.com/viewtopic.php?p=2193330\u0026hilit=ddcontrol#p2193326\n\n### Setting up the phisical button\nGenerally any pull-up button will work as long as it will read 1 when pressed and 0 when idle. By default the app will expect the button to be connected to GPIO header pin nr. 23. But it can be configured in settings.py.\n\nYou can use this little snippet to debug and test your button prior to using it with your app:\n\n```bash\nimport RPi.GPIO as GPIO\n\n# use P1 header pin numbering convention\nGPIO.setmode(GPIO.BOARD)\nGPIO.setup(23, GPIO.IN)\nprint(GPIO.input(23))\n```\n\n# Building the picture frame hardware\nIt's not too difficult or expensive. In any case you will need:\n- Rasperry Pi (any as long as it has HDMI)\n- power adaptor downto 5V for raspi; can be combined with whateve the monitor uses, but it of course depends\n- a nice wooden picture frame; it has to be larger than the screen so that you have some space on the edges to fit the components\n- optional: phisical button\n\nMissing component is the screen. There are generally two approaches.\n1. You buy used PC screen: this is the best and by far the simplest approach. The screen will already come with the panel, the driver board, backlighting and power adaptor. Be careful to find one that uses slim components (most of them do). This is suitable, if you are building a large photo frame. I really like my 24\" inch photo frame. And one more tip: you must go for LED IPS screen if you value your photos. You will thank me later.\n2. You have a spare screen from an old laptop you would like to use. This is going to be more difficult as you will have to source the backlighting driver, power adaptor and the driver-board yourself. Search ebay for a good board where your EXACT model of the screen panel is listed as supported. Universal boards only gave me TONS of headaches.\n\n![](screens/photo-frame-back.jpg)\n\n# Credits:\n\nCode for the patterns taken and adapted from:\nhttps://github.com/eleanorlutz/AnimatedPythonPatterns/blob/master/PatternMaker.ipynb\n\nOriginal idea and some base concepts for pygame photo frame:\nhttps://github.com/gitajt/PGslideshow\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpeterdolenc%2Frpy-frame","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpeterdolenc%2Frpy-frame","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpeterdolenc%2Frpy-frame/lists"}