• Stars
    star
    160
  • Rank 234,703 (Top 5 %)
  • Language
    C++
  • License
    GNU General Publi...
  • Created over 11 years ago
  • Updated about 4 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

PixelPusher protocol for LED matrix.

Controlling RGB LED display on Raspberry Pi GPIO via PixelPusher protocol

Example video

Code is (c) Henner Zeller [email protected], license: GNU General Public License, Version 3.0

For details of the RGB Matrix library used and how to connect, see the github over at Raspberry Pi RGB Matrix.

Compiling

Clone with --recursive to get the RGB matrix submodule when cloning this repository:

git clone --recursive https://github.com/hzeller/rpi-matrix-pixelpusher.git

(If you did a git pull to get the latest state, also make sure to get the latest matrix code: type git submodule update).

Wiring

For wiring, please have a look at the library documentation.

You can choose the wiring you are using with the option --led-gpio-mapping on the command line. E.g. if you are connected to an Adafruit HAT, then it is --led-gpio-mapping=adafruit-hat or --led-gpio-mapping=adafruit-hat-pwm depending on if you did the PWM modification (which you absolutely should to reduce flicker.

Running

Simply run the program as root (which is needed to access the GPIO pins). It will drop its privileges once it has set up the hardware.

 $ make
 $ sudo ./pixel-push

These are the available options

usage: ./pixel-push <options>
Options:
        -l            : Switch on logarithmic response (default: off)
        -i <iface>    : network interface, such as eth0, wlan0. Default eth0
        -G <group>    : PixelPusher group (default: 0)
        -C <controller> : PixelPusher controller (default: 0)
        -a <artnet-universe,artnet-channel>: if used with artnet bridge. Default 0,0
        -u <udp-size> : Max UDP data/packet (default 1460)
                        Best use the maximum that works with your network (up to 65507).
        -d            : Same as --led-daemon. Use this when starting in init scripts.
        --led-gpio-mapping=<name> : Name of GPIO mapping used. Default "regular"
        --led-rows=<rows>         : Panel rows. Typically 8, 16, 32 or 64. (Default: 32).
        --led-cols=<cols>         : Panel columns. Typically 32 or 64. (Default: 32).
        --led-chain=<chained>     : Number of daisy-chained panels. (Default: 1).
        --led-parallel=<parallel> : Parallel chains. range=1..3 (Default: 1).
        --led-multiplexing=<0..6> : Mux type: 0=direct; 1=Stripe; 2=Checkered; 3=Spiral; 4=ZStripe; 5=ZnMirrorZStripe; 6=coreman (Default: 0)
        --led-pixel-mapper        : Semicolon-separated list of pixel-mappers to arrange pixels.
                                    Optional params after a colon e.g. "U-mapper;Rotate:90"
                                    Available: "Rotate", "U-mapper". Default: ""
        --led-pwm-bits=<1..11>    : PWM bits (Default: 11).
        --led-brightness=<percent>: Brightness in percent (Default: 100).
        --led-scan-mode=<0..1>    : 0 = progressive; 1 = interlaced (Default: 0).
        --led-row-addr-type=<0..2>: 0 = default; 1 = AB-addressed panels; 2 = direct row select(Default: 0).
        --led-show-refresh        : Show refresh rate.
        --led-inverse             : Switch if your matrix has inverse colors on.
        --led-rgb-sequence        : Switch if your matrix has led colors swapped (Default: "RGB")
        --led-pwm-lsb-nanoseconds : PWM Nanoseconds for LSB (Default: 130)
        --led-no-hardware-pulse   : Don't use hardware pin-pulse generation.
        --led-slowdown-gpio=<0..2>: Slowdown GPIO. Needed for faster Pis/slower panels (Default: 1).
        --led-daemon              : Make the process run in the background as daemon.
        --led-no-drop-privs       : Don't drop privileges from 'root' after initializing the hardware.

This will advertise itself as a PixelPusher http://www.heroicrobotics.com/products/pixelpusher device on the network. Number of 'strips' will be number of rows, so 16 or 32 multiplied by the parallel panels (1 .. 3).

Network UDP packet size

The -u parameter specifies the size of the allowed UDP packets. Some network switches (and the original PixelPusher hardware) don't like large packets so the default is a conservative 1460 here.

But since we have a lot of pixels, using the highest number possible is desirable so ideally we can transmit a full frame-buffer with one packet (use something like 65507 here):

     sudo ./pixel-push -u 65507

Even if the network supports it, sometimes sending devices limit the packet size (e.g. iOS, 8192 seems to be the limit of packets to send; important if you use LED labs softare) so we have to change:

     sudo ./pixel-push -u 8192

Controlling Software

You can control these for instance with the Processing framework http://processing.org/. The processing framework already has a contrib library section that allows you to select PixelPusher supporting libs.

Another software supporting the PixelPusher support is L.E.D. Lab http://www.ledlabs.co/

Artnet / sACN

If you use the artnet bridge, you can specify the artnet-universe and the artnet-channel with the -a option:

sudo ./pixel-push -a1,1

Larger displays

Generally, if you want larger displays, it is suggested to first use the feature of connecting multiple parallel chains to one Raspberry Pi; the adapter in the underlying project provides three outputs.

If you have the Adafruit HAT, then you only can do one chain, but you can arrange them in a sideways 'U' shape to get a more square display. This then can be mapped correctly with --led-pixel-mapper="U-mapper".

Here are four panels arranged in a square on a single connector, typically something you might want do do if you want a 64x64 arrangement of four 32x32 displays on an Adafruit HAT (which only provides one chain):

   [<][<]  }--- Pi connector #1 (looking from the front)
   [>][>]

(--led-pixel-mapper="U-mapper" --led-chain=4 --led-parallel=1).

This is how it looks wired up from the back:

Chaining multiple displays

How about 6 panels ?

   [<][<][<]  }--- Pi connector #1
   [>][>][>]

(--led-pixel-mapper="U-mapper" --led-chain=6 --led-parallel=1).

This even works if you have multiple parallel chains. Here is an arrangement with two chains with 8 panels each:

   [<][<][<][<]  }--- Pi connector #1
   [>][>][>][>]
   [<][<][<][<]  }--- Pi connector #2
   [>][>][>][>]

(--led-pixel-mapper="U-mapper" --led-chain=8 --led-parallel=2).

The --led-pixel-mapper="U-mapper" option essentially gives you half the width of a panel, but double the height.

If you have a Raspberry Pi 2 or later consider assembling a display using parallel chains, for instance using the adapter that is provided in the RGB matrix project

More Repositories

1

rpi-rgb-led-matrix

Controlling up to three chains of 64x64, 32x32, 16x32 or similar RGB LED displays using Raspberry Pi GPIO
C++
3,229
star
2

timg

A terminal image and video viewer.
C++
1,889
star
3

gmrender-resurrect

Resource efficient UPnP/DLNA renderer, optimal for Raspberry Pi, CuBox or a general MediaServer. Fork of GMediaRenderer to add some features to make it usable.
C
841
star
4

txtempus

A DCF77, WWVB, JJY and MSF clock LF-band signal transmitter using the Raspberry Pi
C++
416
star
5

ldgraphy

Simple Laser Direct Lithography / Laser Direct Imaging for PCB manufacturing
PostScript
272
star
6

rpi-gpio-dma-demo

Performance writing to GPIO with CPU and DMA on the Raspberry Pi
C
196
star
7

flaschen-taschen

Noisebridge Flaschen Taschen display
C++
193
star
8

beagleg

G-code interpreter and stepmotor controller for crazy fast coordinated moves of up to 8 steppers. Uses the Programmable Realtime Unit (PRU) of the Beaglebone.
C++
114
star
9

augenmass

Measure relative sizes on background image.
JavaScript
93
star
10

upnp-display

Display state of UPnP/DNLA renderer in the network with a 16x2 LCD display (or 24x2, 40x2 ..) connected to the Raspberry Pi. Unicode support (UTF-8).
C++
69
star
11

gcode-cli

Simple command line tool to send gcode to serial 3D printer/CNC machine.
C++
39
star
12

spixels

Spixels - 16-SPI LED Raspberry Pi adapter with library (SPI - Pixels).
C++
39
star
13

rpt2pnp

Solder paste dispensing and Pick'n Placing
C++
34
star
14

stuff-org

Organize electronic components. Or other stuff.
Go
33
star
15

postscript-hacks

A collection of some useful PostScript programs.
PostScript
31
star
16

folve

Folve - seamlessly FIR convolving audio file fuse filesystem with gapless support.
C++
30
star
17

trs80-100-schematic

A transcript of the TRS80 Model 100 schematic
Nix
28
star
18

rpt2paste

Convert KiCAD rpt files to G-Code to dispense solder paste
C++
24
star
19

bumps

BeagleBone Universal Multi Pololu Steppers
KiCad Layout
21
star
20

blisplay

A tactile display for the blind.
OpenSCAD
19
star
21

pixelpusher-server

A simple library that allows to receive pixels via the PixelPusher protocol.
C++
17
star
22

otp-image

Optical One-Time Pad XOR encoding of images
C++
17
star
23

digi-spherometer

A digital spherometer, reading data from digital dial indicator and converting it to radius, displaying on OLED display.
C++
14
star
24

RedPitaya-Case

A case for the Red Pitaya scope/function generator
OpenSCAD
12
star
25

joystick-gcode-jog

Jogging a machine such as a 3D printer or CNC machine with a gampad. Mostly proof of concept.
C
12
star
26

gds2vec

A simple program to convert gdsII files to vector output formats. Currently used to create laser-cut models of standard cells.
C++
12
star
27

openscad-things

Things made with OpenSCAD. Mostly experimental right now.
OpenSCAD
9
star
28

quadrigotion

TMC2660 Four stepper motor drivers on a stick.
Python
9
star
29

tmc2660-breakout

Little breakout board to play with the TMC2660 stepper driver
Python
9
star
30

precise-pitch

Instrument tuner app. Mostly my playground to learn Android development.
Java
8
star
31

symbiflow-simple-sample

Using Symbiflow arch defs to get BASYS3 board entertained with logic
Makefile
8
star
32

bant

Bazel/Build Analysis and Navigation Tool
C++
8
star
33

bare-lsp

A language server protocol implementation
C++
6
star
34

jcxxgen

A schema compiler generating c++ structs with boilerplate to be serialized easily with nlohmann/json
C++
6
star
35

spixels-pixelpusher

A PixelPusher implementation using the Spixels hardware to control LED strips.
C++
6
star
36

bdfont.data

Generate C-structs from BDF fonts to be compiled into embedded programs.
C++
5
star
37

sound-cam

Simulation of using Microphones to pick up sound locations.
C++
5
star
38

pi-registerplex

GPIO multiplexer for Raspberry Pi
Python
3
star
39

makerspace-tag

Simple app keeping track of makerspace users and their capabilities
Go
3
star
40

ziplain

A plain, no-frills ZIP file writer.
C++
3
star
41

hot-snipper

A Hot-Knife cutting machine
OpenSCAD
3
star
42

simple-fasm

A simple parser for the FPGA Assembly format
C++
3
star
43

DerKnopf

Simple IR remote control of a volume knob
KiCad Layout
3
star
44

eda-tools

Small useful tools I use while doing stuff with electronics.
3
star
45

pitch-hero

C++
2
star
46

simple-spherometer

A simple analog spherometer made from simple hardware-store materials, laser cut acrylic and 3D printed parts.
PostScript
2
star
47

air-filter-box

Quad AirFilter using standard box-fan and standard aircon/furnace filters
OpenSCAD
2
star
48

microorb

A USB controlled 2.5W RGB LED
C++
2
star
49

FlaschenTaschen-PixelPusher-bridge

Receives FlaschenTaschen protocol and sends to a PixelPusher installation.
C++
2
star
50

rp2040-nix-template

Minimal rp2040 c++ template
Makefile
2
star
51

gaggia-pid

PID controller, useful for e.g. coffee machines.
C++
1
star
52

golang-pgp-test

Experiments with the golang OpenPGP implementation.
Go
1
star
53

cogsworth-viz

Visualization of data generated from Project-COGSWORTH
C
1
star
54

sneeze-guard

Sneeze-guard on working tables for reduced Viral spread.
G-code
1
star
55

flaschen-taschen-avr

Quick hack to make first FlaschenTaschen crates work.
C++
1
star
56

bidi-tee

A bidrectional `tee` program that passes through stdin/stdout/stderr and copies them colored coded to a file
C++
1
star
57

ear-saver

A laser-cuttable ear-saver for face masks.
OpenSCAD
1
star
58

threadless-server

select() event API experiment with c++11 closures.
C++
1
star
59

gstreamer-gapless-test

Sample source code to demonstrate a gstreamer issue.
C
1
star
60

din-rail-clip-mount

3D printed Din-Rail mount for PCB and other components
OpenSCAD
1
star
61

glowxels

Glow-in-the-dark canvas
C++
1
star