Giter VIP home page Giter VIP logo

lichtkrant's Introduction

lichtkrant

A Chinese Hub75 LED panel reincarnated as a fancy marquee used at DJO.

Installation

# clone the git repo
git clone https://github.com/djoamersfoort/lichtkrant
cd lichtkrant

# automatic installation for a new device
# this will create a systemctl service!
chmod +x *.sh
./setup.sh

Usage

usage: index.py [-h] [-m MODULE] [-s STATE_DIR] [-r RECURSIVE] [-d] [-o]

A driver for the DJO Lichtkrant project.

optional arguments:
  -h, --help            show this help message and exit
  -m MODULE, --module MODULE
                        load a specific module by name
  -s STATE_DIR, --state-dir STATE_DIR
                        path to the states directory
  -r RECURSIVE, --recursive RECURSIVE
                        whether to search recursively
  -d, --dry             do not spew out pixel data
  -o, --offline         disable MQTT connectivity

Since the display makes use of the protocol Hub75, ledcat will be used. Conveniently, ledcat also has a previewing option which prints the display in your terminal, since I'm not too fond of carrying around a bulky led panel.

# use preview mode for testing purposes
./debug.sh # [extra arguments]

# driving the display using rpi-led-matrix
./run.sh # [extra arguments]

# see run.py for a 'finetuned' configuration

State Modules

The system works based on state modules. These are Python files ending in .mod.py

An example state file:

import sys
from time import sleep
from states.base import BaseState

# The state class must be called 'State' and extend BaseState for things to work
class State(BaseState):
    # give the state a name
    # this name should be unique!
    name = "example"

    # the state with the highest index is shown
    # if multiple states have the same index it will be randomly selected
    index = 0

    # delay in seconds to wait until the next update
    delay = 60

    # this function decides if the module will be shown
    # the check function must return a boolean
    # the spacestate is available as the first argument
    def check(self, states):
        return states['djo'] is False

    # a function that is called when running the module
    # in this case it just fills the screen with white
    def run(self):
        while not self.killed:
            sys.stdout.buffer.write(bytes([0xFF] * 3072))

        sleep(1)

By default, all state files are included, even in subdirectories. If you don't want this, set the flag -r, --recursive to false.

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

License

MIT

lichtkrant's People

Contributors

wipeautcrafter avatar iloveandlikepizza avatar rmoesbergen avatar jelmerro avatar sverben avatar dependabot[bot] avatar agent-kwabbel avatar deepdesk-github-ci avatar flawake 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.