Coder Social home page Coder Social logo

digital-picture-frame-webdav's Introduction

Python Scripts to Use for a Digital Frame

This is a simple Python scripts which connects to a WebDAV folder and iteratively show the images within. It thereby prints the images directly to the screen buffer without requiring an installed desktop environment. My use case is to use it as a digital frame for showing my pictures stored in a Nextcloud folder. It runs on a Raspberry Pi Zero 2W.

Attention: The script is a bit rough and makes many assumptions. For my use case it works, but there is no guarantee. Use with caution.

Requirements

  • Pygame - to display the images
  • webdavclient3 - to download the images from a WebDAV repository

The concrete packages and versions are listed in the requirements.txt.

Installation

The installation consist of the following steps:

  • Installation of the Python dependencies, e.g. by using the requirements.txt and pip
  • Installation of the OS dependencies
    • Pygame uses SDL2 to write the images into the buffer
    • SDL2 needs to be installed, e.g. for Debian sudo apt install libsdl2-2.0-0 libsdl2-ttf-2.0-0

Configuration

The webdav server connection is configured by configuration file. This uses the default syntax from the webdav3.client By default, it expects a config.json in the current working directory. The path can be adapted within the variable config_file_path. An example configuration looks like:

{
    "webdav_hostname": "test-url/folder/diashow",
    "webdav_login":    "test-user",
    "webdav_password": "test-password",
    "webdav_timeout": 60,
    "online_check_address" : "http://test-url",
    "image_duration" : 30,
    "width" : 1024,
    "height" : 600
}
Field value Description
webdav_hostname path to the diashowfolder. A folder called diashow is expected
webdav_login Webdav username
webdav_password Password of the webdav user
webdav_timeout Timeout for the webdav connection
online_check_address Address which the scripts uses to check whether the network connection is up
image_duration the time in seconds each image is shown
width the screen width in pixels
height the screen height in pixels

digital-picture-frame-webdav's People

Contributors

majuwa avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.