Giter Club home page Giter Club logo

ledcat's Introduction

ledcat

CI

Ledcat is simple utility that aims to provide a standard interface for driving LED-devices and such.

Simply create a program that outputs 3 bytes of RGB for each pixel in your setup.

Note Prior to v0.3.0, Ledcat supported driving LED-strips such as the WS28xx, APA102, etc. via the spidev interface of Linux. This functionality has been removed as it required too much effort to maintain and using an ESP32 with something like WLED will result in a much better experience.

Documentation

Install

The easiest way to install Ledcat is to download a binary from Github.

Note: Hzeller's LED Matrix driver is not available from CI builds.

Installing from Cargo

Install the Rust Language if you have not already.

Then, you can install ledcat directly using Cargo.

cargo install ledcat

Building Manually

Alternatively, you can build and install Ledcat manually:

git clone https://github.com/polyfloyd/ledcat.git
cd ledcat
cargo build --release
cp target/release/ledcat /usr/local/bin/ledcat

Usage Examples

# Make a strip of 30 leds all red.
perl -e 'print "\xff\x00\x00" x 30' | ledcat --geometry 30 show
# Receive frames over UDP.
nc -ul 1337 | ledcat --geometry 30 show
# Load an image named "image.png", resize it to fit the size of the display and
# send it to a ledstrip zigzagged over the Y-axis.
convert image.png -resize 75x8! -depth 8 RGB:- | \
    ledcat --geometry 75x8 --transpose zigzag_y show
# A clock on a zigzagged two dimensional display of 75x8 pixels
while true; do
    convert -background black -fill cyan -font Courier -pointsize 8 \
        -size 75x8 -gravity center -depth 8 caption:"$(date +%T)" RGB:-
    sleep 1;
done | ledcat --geometry 75x16 --transpose zigzag_y show
# Show random noise as ambient lighting or priority messages if there are any.
mkfifo /tmp/ambient
mkfifo /tmp/messages
cat /dev/urandom > /tmp/ambient &
./my_messages > /tmp/messages &
ledcat --input /tmp/ambient /tmp/messages --exit never --geometry 30 show

Supported Devices:

ledcat's People

Contributors

ben-alderson avatar dependabot[bot] avatar polyfloyd avatar raboof avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

ledcat's Issues

Race condition in select.rs

A race condition exists that causes a Reader to return data in the wrong order. In practice, this is not a problem, but it makes the CI build fail on occasion.

Simulator

For most LED-displays and stuff I've been writing OpenGL based simulators. Let's fix this issue once and for all and implement it in Ledcat.

RGB48 input support

The HexWS2811 supports 16 bit colors via temporal dithering. Ledcat could support this by making the input format configurable.

Flush input after a timeout

When using one or more fifo's as input and the sending program is killed, it is possible for ledcat to have received an incomplete frame. This causes the output of any new program connected to the fifo to be misaligned with the input counter, resulting in garbage.

This issue can be solved by discarding partially read frames when either:

  • Some timeout expires
  • A signal is received

Led matrix with HUB75 connector, 64x64, 1/32 scan, only A and B

Hi,

I am trying to use ledcat with a HUB75 led matrix, 64x64, 1/32 scan.
I found there was 1/32 scan panels that had ABCDE lines, but mine has only A, B lines, and a NC line.

I am trying to drive it with this script :

while true; do
    convert -background black -fill cyan -font Courier -pointsize 8 \
        -size 64x64 -gravity center -depth 8 caption:"$(date +%T)" RGB:-
    sleep 1;
done | target/release/ledcat --geometry 64x64 hub75 --level-select 22,23 --red 11,8 --green 27,9 --blue 7,10 --clock 17 --latch 4 --output-enable 18;

But all I have is :

pi@raspberrypi:~/ledcat $ sudo ./test.sh
thread 'main' panicked at 'Invalid bitfield returned by fcntl(F_GETFL)', /checkout/src/libcore/option.rs:819:4
stack backtrace:
   0: std::sys::imp::backtrace::tracing::imp::unwind_backtrace
             at /checkout/src/libstd/sys/unix/backtrace/tracing/gcc_s.rs:49
   1: std::sys_common::backtrace::_print
             at /checkout/src/libstd/sys_common/backtrace.rs:71
   2: std::panicking::default_hook::{{closure}}
             at /checkout/src/libstd/sys_common/backtrace.rs:60
             at /checkout/src/libstd/panicking.rs:380
   3: std::panicking::default_hook
             at /checkout/src/libstd/panicking.rs:396
   4: std::panicking::rust_panic_with_hook
             at /checkout/src/libstd/panicking.rs:611
   5: std::panicking::begin_panic_new
             at /checkout/src/libstd/panicking.rs:553
   6: std::panicking::begin_panic_fmt
             at /checkout/src/libstd/panicking.rs:521
   7: rust_begin_unwind
             at /checkout/src/libstd/panicking.rs:497
   8: core::panicking::panic_fmt
             at /checkout/src/libcore/panicking.rs:92
   9: core::option::expect_failed
             at /checkout/src/libcore/option.rs:819
  10: <&'a mut I as core::iter::iterator::Iterator>::next
  11: ledcat::main
  12: __rust_maybe_catch_panic
             at /checkout/src/libpanic_unwind/lib.rs:98
  13: std::rt::lang_start
             at /checkout/src/libstd/panicking.rs:458
             at /checkout/src/libstd/panic.rs:361
             at /checkout/src/libstd/rt.rs:59
  14: __libc_start_main

Can’t get more than 1 LED light activating on a 144 LED SK9822 strip

Not sure if this project is still being worked on, but the title is self explanatory. I’ve tried various commands below and I can only get the 1st LED to change color.

perl -e 'print "\xff\x00\x00" x 30' | ledcat --geometry 9 sk9822 > /dev/spidev0.1

perl -e 'print "\xff\x00\x00" x 30' | ledcat --geometry 144 sk9822 > /dev/spidev0.1

Configuration via environment variables

Reusing scripts across projects could become easier if the parameters that vary per output, like the display geometry, could be once configured instead of both in the script and ledcat.

Problem with arguments

I got the following error.
Error found argument:
--level-select wich was not expexted.

I have connected a 64x64 panel.

Is there support for hub75e panel?

High CPU usage

When using a FIFO as input, the --linger option and nothing is writing to said FIFO, CPU usage spikes to 100%.

Error on using HUB75 width a geometry of 64x16

Hi there,

I am currently trying to create a matrix display with ledcat but I am running in to this issue:

root@alarmpi ~ # cat text | ledcat --geometry 64x16 hub75 --level-select 22,23,24,25 --red 11,8 --green 27,9 --blue 1,10 --clock 17 --latch 4 --output-enable 18
thread '<unnamed>' panicked at 'index out of bounds: the len is 1024 but the index is 1024', src/device/hub75.rs:57:32
stack backtrace:

The display is not showing anything. Could anyone please help?

Thanks!

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.