Skip to content

Repository files navigation

FrameSync Client

A universal client for displaying images from a FrameSync server on various display devices. Supports e-paper displays, desktop monitors, tablets, smart displays, and more through a modular display handler system.

Features

  • Universal Display Support - Works with any display through configurable handlers
  • Automatic Updates - Periodically fetches and displays new images
  • Modular Architecture - Easy to add support for new display types
  • Systemd Integration - Runs as a service with auto-start on boot
  • Robust - Automatic reconnection and error recovery
  • Lightweight - Minimal dependencies and resource usage

Supported Display Types

  • E-Paper Displays - Waveshare and compatible e-ink screens
  • X11 Desktops - Using feh image viewer
  • Chromium Kiosk - For tablets and smart displays
  • Linux Framebuffer - For headless LCD displays
  • Custom Handlers - Easy to add your own

Quick Start

1. Installation

# Clone or copy the repository
git clone <repository-url>
cd framesync-client

# Install dependencies
pip3 install requests python-dotenv
# Or on Debian/Ubuntu:
sudo apt install python3-requests python3-dotenv

# Copy environment template
cp .env.example .env

2. Configuration

Edit .env with your settings:

nano .env

Required settings:

  • FRAMESYNC_SERVER_URL - URL of your FrameSync server
  • FRAMESYNC_DEVICE_ID - Unique identifier for this display
  • FRAMESYNC_DISPLAY_HANDLER - Command to display images

See .env.example for all available options.

3. Test

# Test connection and display one image
python3 client.py --once

4. Install as Service

# Copy the systemd service file (modify paths as needed)
sudo cp framesync-client.service /etc/systemd/system/
sudo systemctl daemon-reload
sudo systemctl enable framesync-client
sudo systemctl start framesync-client

Display Handlers

The client uses configurable display handlers to support different hardware. Set FRAMESYNC_DISPLAY_HANDLER in your .env file:

E-Paper Display

FRAMESYNC_DISPLAY_HANDLER=python3 {script_dir}/display_image.py {image_path}

Requires: Waveshare e-paper library

X11 Desktop (feh)

FRAMESYNC_DISPLAY_HANDLER={script_dir}/display_handlers/feh_fullscreen.sh {image_path}

Requires: sudo apt install feh

Chromium Kiosk Mode

FRAMESYNC_DISPLAY_HANDLER={script_dir}/display_handlers/chromium_kiosk.sh {image_path}

Requires: sudo apt install chromium-browser

Linux Framebuffer

FRAMESYNC_DISPLAY_HANDLER={script_dir}/display_handlers/framebuffer.sh {image_path}

Requires: sudo apt install fbi

Custom Handler

FRAMESYNC_DISPLAY_HANDLER=/path/to/your/script.sh {image_path}

Configuration Reference

All configuration is stored in .env:

Variable Description Default
FRAMESYNC_SERVER_URL FrameSync server URL http://localhost:5000
FRAMESYNC_DEVICE_ID Unique device identifier display-001
FRAMESYNC_DEVICE_NAME Human-readable device name Display Device
FRAMESYNC_UPDATE_INTERVAL Update interval in seconds 3600 (1 hour)
FRAMESYNC_DISPLAY_HANDLER Command to display images See above

Usage

Interactive Configuration

python3 client.py --configure

Test Single Update

python3 client.py --once

Run Continuously

python3 client.py

Service Management

# Start service
sudo systemctl start framesync-client

# Stop service
sudo systemctl stop framesync-client

# Restart service
sudo systemctl restart framesync-client

# View status
sudo systemctl status framesync-client

# View logs
sudo journalctl -u framesync-client -f

Deployment Examples

Raspberry Pi with E-Paper Display

  1. Install e-paper library (follow manufacturer's instructions)
  2. Configure .env:
FRAMESYNC_SERVER_URL=http://your-server:5000
FRAMESYNC_DEVICE_ID=epaper-display-001
FRAMESYNC_DISPLAY_HANDLER=python3 {script_dir}/display_image.py {image_path}
  1. Install as service (see above)

Desktop/Laptop

  1. Install feh: sudo apt install feh
  2. Configure .env using the feh handler
  3. Run: python3 client.py

Tablet/Smart Display

  1. Install Chromium
  2. Configure .env using the Chromium kiosk handler
  3. Install as service for auto-start

Creating Custom Display Handlers

Display handlers are simple scripts that take an image path and display it:

#!/bin/bash
IMAGE_PATH="$1"

# Your display logic here
# Example: copy to a specific location
cp "$IMAGE_PATH" /path/to/display/

exit 0  # Return 0 on success

Make it executable and reference it in .env:

chmod +x my_handler.sh
FRAMESYNC_DISPLAY_HANDLER=/path/to/my_handler.sh {image_path}

Troubleshooting

Client can't connect to server

  • Verify FRAMESYNC_SERVER_URL is correct
  • Test connectivity: curl http://your-server:5000
  • Check firewall rules

No images available

  • Ensure images are uploaded to the server
  • Verify images are assigned to your device ID
  • Check device registration on server

Images not displaying

  • Test handler manually: ./display_handlers/your_handler.sh /path/to/test.jpg
  • Check logs: sudo journalctl -u framesync-client -f
  • Verify handler dependencies are installed

Service won't start

  • Check service status: sudo systemctl status framesync-client
  • Verify paths in service file
  • Check file permissions

Architecture

┌─────────────────────┐
│  FrameSync Server   │
│  (Remote/Local)     │
└──────────┬──────────┘
           │ HTTP API
           │
┌──────────▼──────────┐
│  FrameSync Client   │
│  - Register device  │
│  - Fetch images     │
│  - Download         │
└──────────┬──────────┘
           │
┌──────────▼──────────┐
│  Display Handler    │
│  - E-Paper          │
│  - feh              │
│  - Chromium         │
│  - Custom           │
└─────────────────────┘

Requirements

  • Python 3.7+
  • requests library
  • python-dotenv library
  • Display-specific dependencies (varies by handler)

License

MIT License - See LICENSE file for details

Contributing

Contributions welcome! Please:

  1. Fork the repository
  2. Create a feature branch
  3. Test your changes
  4. Submit a pull request

Security

  • Never commit .env files (already in .gitignore)
  • Use HTTPS for remote servers when possible
  • Restrict network access to trusted sources
  • Use unique device IDs to prevent conflicts

Support

For issues or questions:

  • Check the troubleshooting section
  • Review logs: sudo journalctl -u framesync-client -f
  • Test manually: python3 client.py --once

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages