Giter Club home page Giter Club logo

rpi-rgb-led-matrix's Introduction

Controlling RGB LED display with Raspberry Pi GPIO

A library to control commonly available 64x64, 32x32 or 16x32 RGB LED panels with the Raspberry Pi. Can support PWM up to 11Bit per channel, providing true 24bpp color with CIE1931 profile.

Supports 3 chains with many panels each on a regular Pi. On a Raspberry Pi 2 or 3, you can easily chain 12 panels in that chain (so 36 panels total), but you can theoretically stretch that to up to 96-ish panels (32 chain length) and still reach around 100Hz refresh rate with full 24Bit color (theoretical - never tested this; there might likely be timing problems with the panels that will creep up then).

With fewer colors or so-called 'outdoor panels' you can control even more, faster.

The LED-matrix library is (c) Henner Zeller [email protected], licensed with GNU General Public License Version 2.0 (which means, if you use it in a product somewhere, you need to make the source and all your modifications available to the receiver of such product so that they have the freedom to adapt and improve).

Discourse discussion group

If you'd like help, please do not file a bug, use the discussion board instead: https://rpi-rgb-led-matrix.discourse.group/

Overview

The RGB LED matrix panels can be scored at Sparkfun, AdaFruit or eBay and Aliexpress. If you are in China, I'd try to get them directly from some manufacturer, Taobao or Alibaba.

The RGBMatrix class provided in include/led-matrix.h does what is needed to control these. You can use this as a library in your own projects or just use the demo binary provided here which provides some useful examples.

Check out utils/ directory for some ready-made tools to get started using the library, or the examples-api-use/ directory if you want to get started programming your own utils.

All Raspberry Pi versions supported

This supports the old Raspberry Pi's Version 1 with 26 pin header and also the B+ models, the Pi Zero, Raspberry Pi 2 and 3 with 40 pins, as well as the Compute Modules which have 44 GPIOs. The 26 pin models can drive one chain of RGB panels, the 40 pin models up to three chains in parallel (each chain 12 or more panels long). The Compute Module can drive up to 6 chains in parallel. The Raspberry Pi 2 and 3 are faster and generally perferred to the older models (and the Pi Zero). With the faster models, the panels sometimes can't keep up with the speed; check out this troubleshooting section what to do.

A lightweight, non-GUI, distribution such as DietPi is recommended. Raspbian Lite is a bit easier to get started with and is a good second choice.

Types of Displays

There are various types of displays that come all with the same Hub75 connector. They vary in the way the multiplexing is happening so this library supports options to choose that. All these are configured by flags (or, programmatically, in an Options struct).

If you have a 64x32 display, you need to supply the flags --led-cols=64 --led-rows=32 for instance.

Depending on the Matrix, there are various configuration options that you might need to set for it to work. See further below in the README for the detailed description of these. While the --led-rows and --led-cols can be derived from simply looking at the panels, the other options might require some experimenting to find the right setting if there is no description provided by the manufacturer of the panel. Going through these options for experiments would typically not do harm, so you're free to experiment to find your setting.

Flag                                 Description
--led-cols Columns in the LED matrix, the 'width'.
--led-rows Rows in the LED matrix, the 'height'.
--led-multiplexing In particular bright outdoor panels with small multiplex ratios require this. Often an indicator: if there are fewer address lines than expected: ABC (instead of ABCD) for 32 high panels and ABCD (instead of ABCDE) for 64 high panels.
--led-row-addr-type Adressing of rows; in particular panels with only AB address lines might indicate that this is needed.
--led-panel-type Chipset of the panel. In particular if it doesn't light up at all, you might need to play with this option because it indicates that the panel requires a particular initialization sequence.

Panels can be chained by connecting the output of one panel to the input of the next panel. You can chain quite a few together, but the refresh rate will reduce with longer chains.

The 64x64 matrixes typically come in two kinds: with 5 address lines (A, B, C, D, E), or (A, B); the latter needs a --led-row-addr-type=1 parameter. So-called 'outdoor panels' are typically brighter and allow for faster refresh-rate for the same size, but do some multiplexing internally of which there are a few types out there; they can be chosen with the --led-multiplexing parameter.

There are some panels that have a different chip-set than the default HUB75. These require some initialization sequence. The current supported types are --led-panel-type=FM6126A and --led-panel-type=FM6127.

Generally, the higher scan-rate (e.g. 1:8), a.k.a. outdoor panels generally allow faster refresh rate, but you might need to figure out the multiplexing mapping if one of the three provided does not work.

Some 32x16 outdoor matrixes with 1:4 scan (e.g. Qiangli Q10(1/4) or X10(1/4)) have 4 address line (A, B, C, D). For such matrices is necessary to use --led-row-addr-type=2 parameter. Also the matrix Qiangli Q10(1/4) have "Z"-stripe pixel mapping and in this case, you'd use two parameters at the same time --led-row-addr-type=2 --led-multiplexing=4.

Let's do it

This documentation is split into parts that help you through the process

  1. Wire up the matrix to your Pi. This document describes what goes where. You might also be interested in breakout boards for that. If you have an Adafruit HAT or Adafruit Bonnet, you can choose that with a command line option described below
  2. Run a demo. You find that in the examples-api-use/ directory:
make -C examples-api-use
sudo examples-api-use/demo -D0
  1. Use the utilities. The utils directory has some ready-made useful utilities to show content. Go there to see how to compile and run these.
  2. Write your own programs using the Matrix in C++ or one of the bindings such as Python or C#.

Utilities

The utils directory is meant for ready utilities to show images or animated gifs or videos. Read the README there for instructions how to compile.

There are external projects that use this library and provide higher level network protocols, such as the

API

The library comes as an API that you can use for your own utilities and use-cases.

Changing parameters via command-line flags

For the programs in this distribution and also automatically in your own programs using this library, there are a lot of parameters provided as command line flags, so that you don't have to re-compile your programs to tweak them. Some might need to be changed for your particular kind of panel.

Here is a little run-down of what these command-line flags do and when you'd like to change them.

First things first: if you have a different wiring than described in wiring, for instance if you have an Adafruit HAT/Bonnet, you can choose these here:

--led-gpio-mapping=<gpio-mapping>: Name of GPIO mapping used. Default "regular"

This can have values such as

  • --led-gpio-mapping=regular The standard mapping of this library, described in the wiring page.
  • --led-gpio-mapping=adafruit-hat The Adafruit HAT/Bonnet, that uses this library or
  • --led-gpio-mapping=adafruit-hat-pwm Adafruit HAT with the anti-flicker hardware mod described below.
  • --led-gpio-mapping=compute-module Additional 3 parallel chains can be used with the Compute Module.

Learn more about the mappings in the wiring documentation.

GPIO speed

--led-slowdown-gpio=<0..4>: Slowdown GPIO. Needed for faster Pis and/or slower panels (Default: 1).

The Raspberry Pi starting with Pi2 are putting out data too fast for almost all LED panels I have seen. In this case, you want to slow down writing to GPIO. Zero for this parameter means 'no slowdown'.

The default 1 (one) typically works fine, but often you have to even go further by setting it to 2 (two). If you have a Raspberry Pi with a slower processor (Model A, A+, B+, Zero), then a value of 0 (zero) might work and is desirable.

A Raspberry Pi 3 or Pi4 might even need higher values for the panels to be happy.

Panel Connection

The next most important flags describe the type and number of displays connected

--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>: For A/B+ models or RPi2,3b: parallel chains. range=1..3 (Default: 1, 6 for Compute Module).

These are the most important ones: here you choose how many panels you have connected and how many rows are in each panel. Panels can be chained (each panel has an input and output connector, see the wiring documentation) -- the --led-chain flag tells the library how many panels are chained together. The newer Raspberry Pi's allow to connect multiple chains in parallel, the --led-parallel flag tells it how many there are.

This illustrates what each of these parameters mean:

Panel Type

Typically, panels should just work out of the box, but some panels use a different chip-set that requires some initialization. If you don't see any output on your panel, try setting:

--led-panel-type=FM6126A

Some panels have the FM6127 chip, which is also an option.

Multiplexing

If you have some 'outdoor' panels or panels with different multiplexing, the following will be useful:

--led-multiplexing=<0..17> : Mux type: 0=direct; 1=Stripe; 2=Checkered...

The outdoor panels have different multiplexing which allows them to be faster and brighter, but by default their output looks jumbled up. They require some pixel-mapping of which there are a few types you can try and hopefully one of them works for your panel; The default=0 is no mapping ('standard' panels), while 1, 2, ... are different mappings to try with. If your panel has a different mapping, you find everything you need to implement one in lib/multiplex-mappers.cc. Please send a pull request if you encounter a panel for which you needed to implement a new mapping.

Note that you have to set the --led-rows and --led-cols to the rows and columns that are physically on each chained panel so that the multiplexing option can work properly. For instance a 32x16 panel with 1:4 multiplexing would be controlled with --led-rows=16 --led-cols=32 --led-multiplexing=1 (or whatever multiplexing type your panel is, so it can also be --led-multiplexing=2 ...).

For 64x32 panels with 1:8 multiplexing, this would typically be --led-rows=32 --led-cols=64 --led-multiplexing=1; however, there are some panels that internally behave like two chained panels, so then you'd use --led-rows=32 --led-cols=32 --led-chain=2 --led-multiplexing=1;

--led-row-addr-type=<0..4>: 0 = default; 1 = AB-addressed panels; 2 = direct row select; 3 = ABC-addressed panels; 4 = ABC Shift + DE direct (Default: 0).

This option is useful for certain 64x64 or 32x16 panels. For 64x64 panels, that only have an A and B address line, you'd use --led-row-addr-type=1. This is only tested with one panel so far, so if it doesn't work for you, please send a pull request.

For 32x16 outdoor panels, that have have 4 address line (A, B, C, D), it is necessary to use --led-row-addr-type=2.

Panel Arrangement

--led-pixel-mapper  : Semicolon-separated list of pixel-mappers to arrange pixels.

Optional params after a colon e.g. "U-mapper;Rotate:90"

Available Parameter after colon Example
Mirror H or V for horizontal/vertical mirror. Mirror:H
Rotate Degrees. Rotate:90
U-mapper -

Mapping the logical layout of your boards to your physical arrangement. See more in Remapping coordinates.

Misc Options

--led-brightness=<percent>: Brightness in percent (Default: 100).

Self explanatory.

--led-pwm-bits=<1..11>    : PWM bits (Default: 11).

The LEDs can only be switched on or off, so the shaded brightness perception is achieved via PWM (Pulse Width Modulation). In order to get a good 8 Bit per color resolution (24Bit RGB), the 11 bits default per color are good (why ? Because our eyes are actually perceiving brightness logarithmically, so we need a lot more physical resolution to get 24Bit sRGB).

With this flag, you can change how many bits it should use for this; lowering it means the lower bits (=more subtle color nuances) are omitted. Typically you might be mostly interested in the extremes: 1 Bit for situations that only require 8 colors (e.g. for high contrast text displays) or 11 Bit for everything else (e.g. showing images or videos). Why would you bother at all ? Lower number of bits use slightly less CPU and result in a higher refresh rate.

--led-show-refresh        : Show refresh rate.

This shows the current refresh rate of the LED panel, the time to refresh a full picture. Typically, you want this number to be pretty high, because the human eye is pretty sensitive to flicker. Depending on the settings, the refresh rate with this library are typically in the hundreds of Hertz but can drop low with very long chains. Humans have different levels of perceiving flicker - some are fine with 100Hz refresh, others need 250Hz. So if you are curious, this gives you the number (shown on the terminal).

The refresh rate depends on a lot of factors, from --led-rows and --led-chain to --led-pwm-bits, --led-pwm-lsb-nanoseconds and --led-pwm-dither-bits. If you are tweaking these parameters, showing the refresh rate can be a useful tool.

--led-limit-refresh=<Hz>  : Limit refresh rate to this frequency in Hz. Useful to keep a
                            constant refresh rate on loaded system. 0=no limit. Default: 0

This allows to limit the refresh rate to a particular frequency to approach a fixed refresh rate.

This can be used to mitigate some situations in which you have a faint flicker, which can happen due to hardware events (network access) or other situations such as other IO or heavy memory access by other processes. Also when you see wildly changing refresh frequencies with --led-show-refresh.

You trade a slightly slower refresh rate and display brightness for less visible flicker situations.

For this to calibrate, run your program for a while with --led-show-refresh and watch the line that shows the current refresh rate and minimum refresh rate observed. So wait a while until that value doesn't change anymore (e.g. a minute, so that you catch tasks that happen once a minute, such as ntp updated). Use this as a guidance what value to choose with --led-limit-refresh.

The refresh rate will now be adapted to always reach this value between frames, so faster refreshes will be slowed down, but the occasional delayed frame will fit into the time-window as well, thus reducing visible brightness fluctuations.

You can play with value a little and reduce until you find a good balance between refresh rate and flicker suppression.

Use this also if you want to have a stable baseline refresh rate when using the vsync-multiple flag -V in the led-image-viewer or video-viewer utility programs.

--led-scan-mode=<0..1>    : 0 = progressive; 1 = interlaced (Default: 0).

This switches from progressive scan and interlaced scan. The latter might look be a little nicer when you have a very low refresh rate, but typically it is more annoying because of the comb-effect (remember 80ies TV ?).

--led-pwm-lsb-nanoseconds : PWM Nanoseconds for LSB (Default: 130)

This allows to change the base time-unit for the on-time in the lowest significant bit in nanoseconds. Lower values will allow higher frame-rate, but will also negatively impact qualty in some panels (less accurate color or more ghosting).

Good values for full-color display (PWM=11) are somewhere between 100 and 300.

If you you use reduced bit color (e.g. PWM=1) and have sharp contrast applications, then higher values might be good to minimize ghosting.

How to decide ? Just leave the default if things are fine. But some panels have trouble with sharp contrasts and short pulses that results in ghosting. It is particularly apparent in situations such as bright text on black background. In these cases increase the value until you don't see this ghosting anymore.

The following example shows how this might look like:

Ghosting with low --led-pwm-lsb-nanoseconds No ghosting after tweaking

If you tweak this value, watch the framerate (--led-show-refresh) while playing with this number.

--led-pwm-dither-bits   : Time dithering of lower bits (Default: 0)

The lower bits can be time dithered, i.e. their brightness contribution is achieved by only showing them some frames (this is possible, because the PWM is implemented as binary code modulation). This will allow higher refresh rate (or same refresh rate with increased --led-pwm-lsb-nanoseconds). The disadvantage could be slightly lower brightness, in particular for longer chains, and higher CPU use. CPU use is not of concern for Rasbperry Pi 2 or 3 (as we run on a dedicated core anyway) but proably for Raspberry Pi 1 or Pi Zero. Default: no dithering; if you have a Pi 3 and struggle with low frame-rate due to high multiplexing panels (1:16 or 1:32) or long chains, it might be worthwhile to try.

--led-no-hardware-pulse   : Don't use hardware pin-pulse generation.

This library uses a hardware subsystem that also is used by the sound. You can't use them together. If your panel does not work, this might be a good start to debug if it has something to do with the sound subsystem (see Troubleshooting section). This is really only recommended for debugging; typically you actually want the hardware pulses as it results in a much more stable picture.

--led-no-drop-privs       : Don't drop privileges from 'root' after initializing the hardware.

You need to start programs as root as it needs to access some low-level hardware at initialization time. After that, it is typically not desirable to stay in this role, so the library then drops the privileges.

This flag allows to switch off this behavior, so that you stay root. Not recommended unless you have a specific reason for it (e.g. you need root to access other hardware or you do the privilege dropping yourself).

--led-daemon              : Make the process run in the background as daemon.

If this is set, the program puts itself into the background (running as 'daemon'). You might want this if started from an init script at boot-time.

--led-inverse             : Switch if your matrix has inverse colors on.
--led-rgb-sequence        : Switch if your matrix has led colors swapped (Default: "RGB")

These are if you have a different kind of LED panel in which the logic of the color bits is reversed (--led-inverse) or where the Red, Green and Blue LEDs are mixed up (--led-rgb-sequence). You know it when you see it.

Here are some tips in case things don't work as expected.

Use minimal Raspbian distribution

In general, run a minimal configuration on your Pi.

  • Do not use a graphical user interface (Even though the Raspberry Pi foundation makes you believe that you can do that: don't. Using a Pi with a GUI is a frustratingly slow use of an otherwise perfectly good embedded device.). Always operate your Raspberry Pi headless.

  • Switch off on-board sound (dtparam=audio=off in /boot/config.txt). External USB sound adapters work, and are much better quality anyway, so that is recommended if you happen to need sound. The on-board sound uses a timing circuit that the RGB-Matrix needs (it seems in some distributions, such as arch-linux, this is not enough and you need to explicitly blacklist the snd_bcm2835 module).

  • Don't run anything that messes in parallel with the GPIO pins, e.g. PiGPIO library/daemon or devices that use the i2c or 1-wire interface if they are on the same pins you need for the panel.

  • I have also seen reports that on some Pis, the one-wire protocol is enabled (w1-gpio). This will also not work (disable by removing dtoverlay=w1-gpio in /boot/config.txt; or using raspi-config, Interface Options -> 1-Wire)

  • If you see some regular flickering, make sure that there is no other process running on the system that could cause that. For instance, it is known that merely running top creates a faint flicker every second it updates. Or a regular ntp run can also cause flicker once a minute (switch off with sudo timedatectl set-ntp false). Maybe instead you might want to run ntp at system start-up but then not regularly updating. There might be other things running regularly you don't need; consider a sudo systemctl stop cron for instance. To address some irregular flicker, consider the --led-limit-refresh option.

  • There are probably other processes that are running that you don't need and remove them; I usually remove right away stuff I really don't need e.g.

    sudo apt-get remove bluez bluez-firmware pi-bluetooth triggerhappy pigpio
    

    Take a close look at your systemd (systemctl) and see if there are other things running you don't need. If you have seen packages in standard Raspbians that interfere with the matrix code, let me know to include it here. In general: This is why starting with a minimal installation is a good idea: there is simply less cruft that you have to disable.

  • It seems that more recent version of Raspbian Lite result in some faint brightness fluctuations of the displays and it is not quite clear why (see issue #483). If you are a Kernel person and can help figuring out what is happening that would be very appreciated. Also, you might know a minimal Linux distribution that is more suited for near realtime applications ?

The default install of Raspbian Lite or DietPi seem to be good starting points, as they have a reasonably minimal configuration to begin with. Raspbian Lite is not as lite anymore as it used to be; I prefer DietPi these days.

Bad interaction with Sound

If sound is enabled on your Pi, this will not work together with the LED matrix, as both need the same internal hardware sub-system (a first test to see if you are affected is to run the progrem with --led-no-hardware-pulse and see if things work fine then).

If you run lsmod and see the snd_bcm2835 module, this could be causing trouble. (The library actually exits if it finds this module to be loaded).

In that case, you should create a kernel module blacklist file like the following on your system and update your initramfs:

cat <<EOF | sudo tee /etc/modprobe.d/blacklist-rgb-matrix.conf
blacklist snd_bcm2835
EOF

sudo update-initramfs -u

Reboot and confirm that the module is not loaded.

I have followed some tutorial on the Internet and it doesn't work

Well, if you use this library, please read the documentation provided here, not on some other website. Most important for you to get started is the wiring guide. There are some tutorials floating around that refer to a very old version of this library.

I have a Pi1 Revision1 and top part of Panel doesn't show green

Use --led-gpio-mapping=regular-pi1

Logic level voltage not sufficient

Some panels don't interpret the 3.3V logic level well, or the RPi output drivers have trouble driving longer cables, in particular with faster Raspberry Pis Version 2. This results in artifacts like randomly showing up pixels, color fringes, or parts of the panel showing 'static'.

If you encounter this, try these things

  • Make sure to have as short as possible flat-cables connecting your Raspberry Pi with the LED panel.

  • In particular if the chips close to the input of the LED panel read 74HC245 instead of 74HCT245 or 74AHCT245, then this board will not work properly with 3.3V inputs coming from the Pi. Use an adapter board with a bus-driver that acts as level shifter between 3.3V and 5V. (In any case, it is always a good idea to use the level shifters).

  • A temporary hack to make HC245 inputs work with the 3.3V levels is to supply only like 4V to the LED panel. But the colors will be off, so not really useable as long-term solution.

  • If you can't implement the above things, or still have problems, you can slow down the GPIO writing a bit. This will of course reduce the frame-rate, so it comes at a cost.

For GPIO slow-down, add the flag --led-slowdown-gpio=2 to the invocation of the binary.

If you have an Adafruit HAT or Bonnet

Generally, if you want to connect RGB panels via an adapter instead of hand-wiring, I suggest to build one of the adapters whose open-hardware files you find in the adapter/ subdirectory. It is a fun solder exercise with large surface mount components.

However, Adafruit offers an adapter which is already ready-made, but it only allows for a single chain. If the ready-made vs. single-chain tradeoff is worthwhile, then you might go for that (I am not affiliated with Adafruit).

Switch the Pinout

The Adafruit HAT/Bonnet uses this library but a modified pinout to support other features on the HAT. You can choose the Adafruit pinout with a command line flag.

Just pass the option --led-gpio-mapping=adafruit-hat. This works on the C++ and Python examples.

Improving flicker

To improve flicker, we need to do a little hardware modification, but it is very simple: solder a wire between GPIO 4 and 18 as shown in the following picture (click to enlarge):

Then, start your programs with --led-gpio-mapping=adafruit-hat-pwm.

Now you should have less visible flicker. This essentially switches on the hardware pulses feature for the Adafruit HAT/Bonnet.

64x64 with E-line on Adafruit HAT/Bonnet

There are LED panels that have 64x64 LEDs packed, but they need 5 address lines, which is 1:32 multiplexing (they have an E address-line). The first generation of the Adafruit HAT/Bonnet was not prepared for this, but it can be done with another hardware mod. Beginning October 2018, Adafruit began selling an updated version of the HAT that supports 64x64 panels simply by bridging two pads on the PCB with solder.

You can identify which HAT you have by looking for the Address E pads, circled here:

New Adafruit RGB Matrix Hat (with Address E pads)

Look for the Address E pads located between the HUB75 connector and Pi camera cutout.

Melt a blob of solder between the center “E” pad the the “8” pad just above it (for 64x64 matrices in the Adafruit shop)…or the “16” pad below (rare, for some third-party 64x64 matrices…check datasheet).

Old Adafruit HAT/Bonnet (without)

It is a little more advanced hack, so it is only really for people who are comfortable with this kind of thing. First, you have to figure out which is the input of the E-Line on your matrix (they seem to be either on Pin 4 or Pin 8 of the IDC connector). You need to disconnect that Pin from the ground plane (e.g. with an Exacto knife) and connect GPIO 24 to it. The following images illustrate the case for IDC Pin 4.

If the direct connection does not work, you need to send it through a free level converter of the Adafruit HAT/Bonnet. Since all unused inputs are grounded with traces under the chip, this involves lifting a leg from the HCT245 (figure out a free bus driver from the schematic). If all of the above makes sense to you, you have the Ninja level to do it!

It might be more convienent at this point to consider the Active3 adapter that has that covered already.

Running as root

The library requires to access hardware registers to control the LED matrix, and create accurate timings. These hardware accesses require to run as root user.

For security reasons, it is usually not a good idea to run an application as root entirely, so this library makes sure to drop privileges immediately after the hardware is initialized.

You can switch off the privilege dropping with the --led-no-drop-privs flag, or, if you do this programmatically, choose the configuration in the RuntimeOptions struct.

Note, you could run as non-root, which will use /dev/gpiomem to at least write to GPIO, however the precise timing hardware registers are not accessible. This will result in flicker and color degradation. Starting as non-root is not recommended.

CPU use

These displays need to be updated constantly to show an image with PWMed LEDs. This is dependent on the length of the chain: for each chain element, about 1'000'000 write operations have to happen every second! (chain_length * 32 pixel long * 16 rows * 11 bit planes * 180 Hz refresh rate).

We can't use hardware support for writing these as DMA is too slow, thus the constant CPU use on an RPi is roughly 30-40% of one core. Keep that in mind if you plan to run other things on this computer (This is less noticable on Raspberry Pi, Version 2 or 3 that has more cores).

Also, the output quality is susceptible to other heavy tasks running on that computer - there might be changes in the overall brigthness when this affects the referesh rate.

If you have a loaded system and one of the newer Pis with 4 cores, you can reserve one core just for the refresh of the display:

isolcpus=3

.. at the end of the line of /boot/cmdline.txt (needs to be in the same as the other arguments, no newline). This will use the last core only to refresh the display then, but it also means, that no other process can utilize it then. Still, I'd typically recommend it.

Performance improvements and limits

Regardless of which driving hardware you use, ultimately you can only push pixels so fast to a string of panels before you get flickering due to too low a refresh rate (less than 80-100Hz), or before you refresh the panel lines too fast and they appear too dim because each line is not displayed long enough before it is turned off.

Basic performance tips:

  • Use --led-show-refresh to see the refresh rate while you try parameters
  • use an active-3 board with led-parallel=3
  • led-pwm-dither-bits=1 gives you a speed boost but less brightness
  • led-pwm-lsb-nanoseconds=50 also gives you a speed boost but less brightness
  • led-pwm-bits=7 or even lower decrease color depth but increases refresh speed
  • AB panels and other panels with that use values of led-multiplexing bigger than 0, will also go faster, although as you tune more options given above, their advantage will decrease.
  • 32x16 ABC panels are faster than ABCD which are faster than ABCDE, which are faster than 128x64 ABC panels (which do use 5 address lines, but over only 3 wires)
  • Use at least an rPi3 (rPi4 is still slightly faster but may need --led-slowdown-gpio=2)

Maximum resolutions reasonably achievable: A general rule of thumb is that running 16K pixels (128x128 or otherwise) on a single chain, is already pushing limits and you will have to make tradeoffs in visual quality. 32K pixels (like 128x256) is definitely pushing things and you'll get 100Hz or less depending on the performance options you choose. This puts the maximum reasonable resolution around 100K pixels (like 384x256) for 3 chains. You can see more examples and video capture of speed on Marc MERLIN's page 'RGB Panels, from 192x80, to 384x192, to 384x256 and maybe not much beyond' If your refresh rate is below 300Hz, expect likely black bars when taking cell phone pictures. A real camera with shutter speed lowered accordingly, will get around this.

Ultimately, you should not expect to go past 64K pixels using 3 chains without significant quality tradeoffs. If you need bigger displays, you should use multiple boards and synchronize the output.

Limitations

If you are using the Adafruit HAT/Bonnet in the default configuration, then we can't make use of the PWM hardware (which only outputs to a particular pin), so you'll see random brightness glitches. I strongly suggest to do the aforementioned hardware mod.

The system needs constant CPU to update the display. Using the DMA controller was considered but after extensive experiments ( https://github.com/hzeller/rpi-gpio-dma-demo ) dropped due to its slow speed..

There is an upper limit in how fast the GPIO pins can be controlled, which limits the frame-rate. Raspberry Pi 2's and newer are generally faster.

Even with everything in place, you might see faint brightness fluctuations in particular if there is something going on on the network or in a terminal on the Pi; this could probably be mitigated with some more real-time kernel for the Pi; maybe there are also hardware limitations (memory bus contention?). Anyway, if you have a realtime kernel configuration that you have optimized for this application, let me know.

To address the brightness fluctuations, you might experiment with the FIXED_FRAME_MICROSECONDS compile time option in lib/Makefile that has instructions how to set it up.

Fun

I am always happy to see users successfully using the software for wonderful things, like this installation by Dirk in Scharbeutz, Germany:

rpi-rgb-led-matrix's People

Contributors

bbhsu2 avatar beta-tester avatar danielvy avatar etanremlap avatar ffontaine avatar flowztul avatar gingters avatar gohlhausen avatar helvethor avatar hzeller avatar inv3rtedco5ine avatar jpoppe avatar kirillaldashkin avatar marcmerlin avatar michael-richardson avatar mick111 avatar mister-scott avatar onebeartoe avatar partofthething avatar polyfloyd avatar rem5 avatar rogerguess avatar runinho avatar salazarhog avatar sanguinedreams avatar smdn avatar tcprst avatar tdholmes avatar vapiper avatar yarikoptic 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  avatar

Watchers

 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  avatar

rpi-rgb-led-matrix's Issues

Porting to Cubieboard

Hi hzeller,

Can you tell me if its possible to port your code for others platformos such as Cubieboard and BBB?

Multiple Matrix Displays

The Demo code can do 64x64 from 4 displays (and I've made it work as 96x64 and 128x96).. However, The image displayer program uses the Frame Canvas. I'm unable to find how to make the LargeSquare64x64Canvas type code work for the Frame Canvas so the image code can do it as well.

Adafruit HUB 75 Hat, -DRGB_CLASSIC_PINOUT option

Hi

I'm using an old Adafruit HUB75 Hat to drive the LED matrix.
So I must compile your code using the classic wiring option ( -DRGB_CLASSIC_PINOUT)

But I could not figure out where I have to write these -DRGB_CLASSIC_PINOUT arguments.
I guess somewhere in the Makefile.....

Thanks for your help!

led-image-viewer does nothing

I have a raspberry pi version 1 running latest Raspbian and a 32x32 LED matrix. All the "led-matrix" demos work as expected. I have the "libgraphicsmagick++1-dev" installed and "led-image-viewer" builds without any issues.

However, whenever I try to run "led-image-viewer", nothing happens on the LED matrix (stays completely off the whole time). I tried running it with a variety of images with different formats and dimensions. This is the output of running the command (which seems normal):
command screenshot

Any ideas on why it might not work or what steps I can take to further debug this?

Issue when two displays connected together

Hi hzeller

I followed a tutorial from Adafruit (https://learn.adafruit.com/16x32-rgb-display-with-raspberry-pi-part-2/software) to connect two LED displays together using your code. I am using a Raspberry Pi to run the displays. When I connect one display to the Pi, everything works find. I can display anything on it and there is no issue. I tested both displays like this and they both worked excellent. However, when I connect the two together and run the necessary adjustments to your code I run into a problem. When I try run something, only the 8th and 14th row on the display that is connected directly to the Pi work, the rest remain blank. I can tell the image is being sent to the display, as the LED's on those two rows change color, turn on, off.

Have you encountered a problem like this before? Do you have any tips on how it can be fixed?

Regards,
C

what "technique" do you recommend for temp "permanent" wiring?

good ideas come too late -- decided to prep a "moving text" display for upcoming (in 2.5 weeks) exhibit and was lucky to find your project! THANKS! I am about to order 4 32x32 matrices from adafruit (display should provide text readable from 3-5 meters) + RPi2 + probably a power supply(s) (or will just use some old PC supply). If I had time I would have ordered the active adapter of yours but can't cash out 80$ for speedy printing. What would you recommend for wiring up the data cable so it is not too horrid for "production" use for 5 days on a display (hanging on a back drape, with RPi hanging somewhere near)? may be smth like http://www.amazon.com/Phantom-YoYo-dupont-cable-female/dp/B00A6SOGC4/ref=sr_1_1?ie=UTF8&qid=1443501921&sr=8-1&keywords=GPIO+cable with males remapped directly into the hub75 leading to the matrix or should I fear (since would be passive) loosing ability to drive it by increasing the length of the wiring?
Thank you in advance for any wisdom. cheers!

text aliasing of led-matrix -D 1 or 2 on 32x32

Thanks for the project and detailed HOWTO -- getting 32x32 (6mm pitch) from adafruit running (using old PC power supply for 5V) was quite easy (ultimately need to chain 4). All demos seems to work nicely but the scrolling text -- my primary target. What could lead to text aliasing such as shown at http://www.onerussian.com/tmp/LED-text-aliasing.jpg . Usually it just aliases to the right (up to 3 LEDs) and if there is an extended number of light up LEDs seems sometimes happen to the left LEDs as well. The effect of right aliasing is independent from direction of text scrolling (-D 1 vs 2) -- guaranteed aliasing to the right. I have tried rebuilds with varying values for DEFINES+=-DRGB_SLOWDOWN_GPIO=1 which seemed had no effect. Static text (text-example) shows beautifully.
Any advice on where should I dig to manage to avoid having such aliasing effect?

Trying to run ThreadedCanvasManipulator again

I don't know if this is a bug or intended, but if you try to stop and start a thread with ThreadedCanvasManipulator you run into problems.
If you try:

demo->Start(); // I left out the Wait Commands
demo->Stop();
demo->Start();  //Error

You get an error because of the assert(!started_); line in the thread.cc library. I tried to solve this with an additional:

demo->Start(); // I left out the Wait Commands
demo->Stop();
demo->WaitStopped();
demo->Start(); //Error

You get no error, but nothing seems to happen. Am I wrong to expect that the Run() Method should just be executed a second time with this setup? Maybe this has anything to do with the MutexLock but I can't understand where the problem lays.

Use of led reproduce

Hi,I would like to use to clone the display without chains.
But the image does not come out normally.

In the video demonstration

./led-matrix -D1 Runtext16.ppm -r16 -m 100

Use the command output results.

I would like to thank the replication means that there is no solution. Thanks.

a demonstration:
https://www.youtube.com/watch?v=MIZ-7PZfKMg

Building Python Library

Hello,
Thank you very much for all your work, I can not do it but I'm happy to use the python library. But I'm not able any more to build the python library based on the lastest version of the repo on a Raspberry Pi.
Here under the error message:

make -C python build
make[1]: Entering directory '/home/pi/tweety_pi/matrix/python'
cython --cplus -o rgbmatrix/core.cpp rgbmatrix/core.pyx

Error compiling Cython file:
------------------------------------------------------------
...
        uint8_t g
        uint8_t b

    cdef cppclass Font:
        Font() except +
        bool LoadFont(const char*)
                               ^
------------------------------------------------------------

rgbmatrix/cppinc.pxd:52:32: Expected ')', found '*'

Error compiling Cython file:
------------------------------------------------------------
...
cimport cppinc

cdef class Canvas:
    cdef cppinc.Canvas *__getCanvas(self) except +
        ^
------------------------------------------------------------

rgbmatrix/core.pxd:4:9: 'Canvas' is not a type identifier

Error compiling Cython file:
------------------------------------------------------------
...

cdef class Canvas:
    cdef cppinc.Canvas *__getCanvas(self) except +

cdef class FrameCanvas(Canvas):
    cdef cppinc.FrameCanvas *__canvas
        ^
------------------------------------------------------------

rgbmatrix/core.pxd:7:9: 'FrameCanvas' is not a type identifier

Error compiling Cython file:
------------------------------------------------------------
...

cdef class FrameCanvas(Canvas):
    cdef cppinc.FrameCanvas *__canvas

cdef class RGBMatrix(Canvas):
    cdef cppinc.RGBMatrix *__matrix
        ^
------------------------------------------------------------

rgbmatrix/core.pxd:10:9: 'RGBMatrix' is not a type identifier

Error compiling Cython file:
------------------------------------------------------------
...
cdef class FrameCanvas(Canvas):
    cdef cppinc.FrameCanvas *__canvas

cdef class RGBMatrix(Canvas):
    cdef cppinc.RGBMatrix *__matrix
    cdef cppinc.GPIO *__gpio        ^
------------------------------------------------------------

rgbmatrix/core.pxd:11:9: 'GPIO' is not a type identifier

Makefile:43: recipe for target 'rgbmatrix/core.cpp' failed
make[1]: *** [rgbmatrix/core.cpp] Error 1
make[1]: Leaving directory '/home/pi/tweety_pi/matrix/python'
Makefile:49: recipe for target 'build-python' failed
make: *** [build-python] Error 2

I try on my laptop and it's OK, even if doesn't seem to use cython in the process
Thank you,

Raspberry Pi 2

Hi,
I have successfully used your program on my Raspberry Pi Model B.
Now I have tried to use it on my new Raspberry Pi 2 Model B. I am able to compile the code but the RGB Matrix is staying black when I run the program. I guess the new hardware of the Rapsberry Pi 2 needs some code fixing. Do you have some hints, where to start?

Regards
Helge

Flip Image

The image flip has an small error:
// Display upside down on my desk. Lets flip :)
int disp_x = columns - x;
int disp_y = 31 - y;
should be:
// Display upside down on my desk. Lets flip :)
int disp_x = columns - x - 1;
int disp_y = 31 - y;

Blue and Red rows

Using a Pi B+ w/ the new wiring diagram to drive a 16x32 display. When I run a demo, any demo, I see a row of red in the middle and a row of blue at the top. Not sure why this is, seen this behavior before?

led-matrix fails to run

I've compiled the code and no errors were shown. Trying to run led-matrix though fails with the message unexpected ")". Afterwords a file is created in the directory led-matrix is run from. The filename can isn't always the same and has invalid characters making it difficult to delete. Any insight to what may be wrong?

Abstract class for translating string for LED display

I'm a heavy user of this library and have used it for implementing an LED binary clock here: https://github.com/erget/BinaryClock. In order to make it easier to work with the LED array, I've implemented an abstract class that parses a string and translates its chars into colors. It inherits from RGBMatrixManipulator and is located here: https://github.com/erget/BinaryClock/blob/master/src/led-clock.hpp

Would be interested in having this upstream in the rpi-rgb-led-matrix? It makes it a bit easier to control the LED matrix because all client code has to do is generate a string formated to fit the dimensions of the LED matrix and decide what symbols should be what colors. If you'd like, I could move this into the rpi-rgb-led-matrix code and send you a pull request. Otherwise I'll just keep it in my code.

Running two instances don't work

Hi,

just startet led-image-viewer with gif as daemon and then started the led-matrix demos.
But that isn't possible. The two processes are hanging with 90% CPU usage.

Maybe it's a good idea to implement a semaphore to disable the start of a second led matrix update thread.

Greetings
Saij

Problem with panels 32x32 with scan rate 1:8

Dear Henner,

a few days ago I found matrixes 32x32 with 1:8 scan rate. I received one piece to try to use it but I have a big problem to print out complete information. Completely strange things show up - text is visible in higher part of the panel and first characters are below, following characters over the first ones.
I use 1:8 to use normal 16x32 panels but I do not know how to change paramteres or modify the library a little to use those panels. I would like to program a little to have them in the way that later we connect 3 chains in parallel and they still work fine. So I guess -r and -P cannot help in this moment (I tried :) )
I was trying to understand idea of variables

const int rows_; // Number of rows. 16 or 32.
const int parallel_; // Parallel rows of chains. 1 or 2.
const int height_; // rows * parallel
const int columns_; // Number of columns. Number of chained boards * 32.

but I'm afraid it's a dead end and I do not want to break the panel with blind shots.
Yes, I saw another issue regarding various scan rate but it was mostly about 1:4. The panels I found have only info regarding 1:8 scan rate - and I guess the rest is as in 'normal' 32x32 panels.
Could you please help me and give me some tips, information, how to program 32x32 panels with 1:8 scan rate? I will be really grateful.
Best regards
Daniel.


Dear Henner,
here is what shows up after setting -r32 -P1 -c1 and printing "ABCDEFGHIJ" - photo attached.
It seems that not only it has scan rate 1:8 in rows but also some 1:16 in columns. Am I right?
Could you please tell me which part of library is responsible for maintaining this?
I will be really grateful. It seems that new type of panels start to be available.
Best regards!

win_20150912_202735

Upgrading from Adafruit's Tutorial

Hi, I'm new to the Raspberry Pi, and I've recently implemented the display using Adafruit's tutorial, which can be found here: https://learn.adafruit.com/connecting-a-16x32-rgb-led-matrix-panel-to-a-raspberry-pi/overview

This code is based off an old fork of your code: https://github.com/Boomerific/rpi-rgb-led-matrix

I've successfully built a nice display, and even made a nice Sinatra website that powers the board's images. I'm looking to upgrade to a 32x32 display and consider using text for my next one, which is how I tracked down the original, here. Unfortunately, switching to your code, everything is upside-down!

I'm going to be working with some people in a local Maker space, and I'm wondering if there's a simple way to flip the output, so that people who complete the Adafruit tutorial, can upgrade to your constantly evolving repo, over being stuck on the other?

Overclocking and Flickering

Hi,

played a little bit with overclocking and determined that overclocking result in flickering.

Here is my config.txt (only overclocking part)

arm_freq=1000
sdram_freq=500
core_freq=500
over_voltage=2
force_turbo=1
disable_splash=1
boot_delay=0
gpu_mem=16

RPi is stable and no problems with cyclictest. But as soon as I run led-matrix it will flicker. Even with -p 4

A test shows that after removing the overclock settings matrix just works fine again.
Just as information

Greetings
Saij

Different scan rates

Awesome library, really looking forward to getting stuck into it! One question I had though, is it possible to change the scan rate to use different modules? I noticed all of the outdoor LED matrix modules out of China these days seem to be going to a 1:4 scan rate instead of 1:8. The explanation I have had from two Chinese suppliers now is that 1:8 is the old standard and apparently 1:4 is better. Any idea how difficult it would be to modify the library to accept 1:4 scan rate modules? Thanks in advance,

10K pullup

Hi,

a few days ago my boards from OSH Park. I think the sent me the older version without the 10k Pullup.
Do You have the actual schematic as PDF so I could change the boards ?

thanks in advance
Thomas
[email protected]

Use parallel LED-Ring and LED Matrix

Hi,
I'm trying to run the LED-Matrix and a Neopixel LED Ring together on the Pi2.
The LED Ring stops if I start the Matrix.
I'm using the matrix with your new Pinout from July 2015 in the only Singlechain-Mode and set Neopixel on GPIO13.
So the LED Ring works with the PWM-Channel 2. Is the PWM Channel already in use by the LED-Matrix ?
This is the LED-Ring library I'm using:
https://github.com/jgarff/rpi_ws281x

Do you have an Idea or solution how to solve it?

Best regards.
Dominik

Some additional examples

Hi,

Thanks for the API! I use the LED-matrix in winter for running to work and back home. I fix it to my running rucksack and then it shows several pong matches so that cars don't run me over. I put some additional examples which I use below:

https://github.com/jostien/rpi-rgb-led-matrix-examples

The code is almost a year old and I hope that it goes along with the current version or rpi-rgb-led-matrix. There is stuff like Beavis and Butthead doing some heavy metal or GIR dancing (GIR is not in the repository because it is a variation of B&B). Unfortunately I cannot provide the pngs because I doubt that I have the copyright.

Pong was derived from xscreensaver. So there is a lot of material which could be adapted to the LED-matrix. For instance Pacman would be nice. However, days are long in the moment, so maybe in autumn ...

Regards,
jost

led matrix flicking.

it is connected 2 lines which has 6ea of 32 x 16 led pannel. Total pixel is 192x32. When i check end of left side, there is flicking. even i tried to use rpi-rgb-led-matrix adapter, the result was totally same. please inform your solution.

New and old library - connections

Dear Henner,
I downloaded your source code and I tried to run it on 16x32 and 32x32 panels. However, I have some questions.

  1. I downloaded the current source code. And I used Adafruit tutorial to connect matrix to RPi 2 ("connecting-a-16x32-rgb-led-matrix-panel-to-a-raspberry-pi"). I run text-example code and it works correctly, which is confusing because in your tutorial OE and CLK have changed. I keep connections as in Revision 1 (OE Pin3, CLK Pin 5) - but in this case I will have a problem to connect 3rd display in parallel.
  2. I am wondering whether there is some solution to make mirror display. Let's assume I have 1 32x32 display. I would like to show the same information on my 2nd 32x32 display. I do not want to use parallel/chain solution. Splitting cables would be the solution? From each output of Rpi2 I would lead out 2 cables and connect to each panel..? Maybe you tried it?
  3. I already read solutions of running led matrix on Rpi and Arduino. I wonder whether there is some smaller/cheaper solution to run only one 16x32 panel? Maybe some Arduino clones?
    Thank you in advance.
    Best regards,
    Daniel

LEDs flicker

I have an Adafruit 64x32 LED Matrix (4mm pitch), a Adafruit RGB Matrix HAT (https://www.adafruit.com/product/2345), a Raspberry Pi B+ and a 5v 4W power supply.

I have everything wired up correctly (i think) the matrix responds and I am able to display text and images. However, my issue is that rows of LEDs flicker, almost like a bad refresh rate. You can see the video of the issue here: http://tinyurl.com/pt67son and attached.

What causes the flicker? Is it that the rpi can't refresh the display fast enough?

Clock frequency

I have some Chinese modules that work relatively well (they are 16 x 32 modules), but with more than 4 in a chain I start to get lots of noise in the display (looks like some of the pixels are ending up in the wrong place - but colours are staying consistant) regardless of PWM bits (seems to be the same whether 1 or 11 bits are set for PWM). The more LEDs I have switched on in the modules the worse the noise seems to get. I have spoken with the supplier and they have said the max clock frequency is 24MHz... Dumb question - what is the clock frequency set to with this library? The only references I could find in the library indicated 500MHz but that seems to be related to PWM. Is there a way that the clock frequency can be adjusted? I might see what I can see with the oscilloscope tonight...

Limit to # of panels (32x32) that you can chain?

This is more of an exploratory question. I'm interested in making a 16:9-ish display. Using the 64x64 coordinate example code as a basis, is it reasonable to assume that you can scale up to 3x2 panels providing you have enough power?

Sidenote: thanks for all your work on this. Really cool stuff!

New Boards

I am having difficulties with the new board. I built two of them, and I can't get any of the examples to run, have you have any issues with yours?

I have the new experimental pin out running, as well as parallel and I just get artifacting (while moving the cable.)

I built the second one with out the buffer caps and it updates, but only one 2 lines on the first display chain. I have a feeling something might be wrong with my raspberry pi. I am going to re-wire it to the new pin out on a breadboard to see.

Here are the parts I bought:

HC245
http://www.digikey.com/product-detail/en/0/568-3973-5-ND

100nf caps
http://www.digikey.com/product-detail/en/0/399-1096-1-ND

image1

Use of left GPIO pins

Hi, I want to show my appreciation for this wonderful piece of code, I've been able to make it work with a custom led panel.
However, I've encountered a problem when I wanted to use the leftover pins on the GPIO to input some signals from some infrared sensors, as I want to make an interactive application.
I'm very new to C++ so I opted for Python, and used the RPi.GPIO.add_event_detect() to wait for the trigger, however, the signal gets some noise whenever the display is lit.
I assumed RGBMatrix was still trying to write to those pins, and I tried uncommenting the #DEFINES+=-DONLY_SINGLE_CHAIN in lib/Makefile and even commenting the pins I'm using in kValidBits in lib/gpio.cc but to no avail, I still get false triggers on my sensors.
I hope someone can point me to the right direction
Cheers,
Samu

Swapped blue and green

I have a 32x32 RGB matrix purchased from Adafruit in July 2013. I believe it is a 4mm pitch; it was the only one being sold at the time at a price of $120. The Blue and Green pins seem to be swapped from what you have documented and coded for. When I wire the matrix as instructed and use the stock code, blue and green are swapped. I have verified this using the text demo by selecting 100% green or 100% blue text, and by looking at the colors in the scrolling runtext.ppm demo where the raspberry's leaves are pink instead of green and the smiley face is magenta instead of yellow.

Either swapping the G1 <-> B1 and G2 <-> B2 wires, or swapping the variable names in the IoBits structure in framebuffer-internal.h fixes the issue. I had initially swapped the blue and green elements in IoBits structure, but when I redid my wiring for the hardware PWM you recently added, I opted to swap the blue and green wires so I don't have to maintain a separate branch of your code anymore. Has anyone else reported this? If it's rare, I am not sure it is worth an extra ifdef in the code but it may at least be worth a footnote in the documentation.

As a side note, I wrote up the wiring technique I used in my blog here: http://adventuresinelectronics.blogspot.com/2015/02/leds-part-deux.html. If you want to link it from your documentation, it may be preferable to use my wiring method for people who don't know how to solder or have the necessary equipment.

RGBMatrixManipulator and DisplayUpdater in separate files

Hi there,

I'm working with this library and using it for a Raspberry Pi wall clock. I love it! :)

I find two classes from main.cc, RGBMatrixManipulator and DisplayUpdater, very useful and would like to move them to a separate file or perhaps into led-matrix to make it easier to include them. Would this be a desired change for the upstream repository? I could imagine that many users would like that and can send a pull request.

Regards,
Daniel

Docs: compiler optimization flag

Please add to the documentation that images will not be displayed with strictly correct colors unless -O3 is passed to the compiler. The files get loaded and parsed correctly, but without the optimizations the code doesn't run fast enough and the output appears "posterized", however this is a side effect of the timing.

Width of 1 board is always 20?

Hi,
I am finding that the width of 1 board is always assumed to be 20, I have 3 chained displays and it always returns 60, instead of 96 as I am using 3 x 16x32 displays

This can be reproduced and verified by adding the following line to demo-main.cc

printf("Canvas Width: %x \n", canvas()->width());

In the VolumeBars example
./led-matrix -b 30 -c 3 -r 16 -D 9
Press to exit and reset LEDs
Canvas Width: 60

./led-matrix -b 30 -c 1 -r 16 -D 9
Press to exit and reset LEDs
Canvas Width: 20

Curiously, if specifying 5 it returns 'a0' and more than 5 it just returns '100'
I have tried to find where in the led-matrix library it is specified that the default width of a board is assumed to be 20 but havn't had any success. Could you please explain how the chain interface works and hopefully I can modify it for my needs.

Thank you

Displaying animated gifs

Is there any way with this code, or another that you know of, to display animated GIFs on the LED matrix?

New Resistor on PCB

I was looking at the new master active 3 adapter boards, and I noticed there is now a 10k resistor from the experimental boards. Is this just a pull up resistor? Thanks.

Ignore complete black bitplanes

Would it be better to ignore a full row in abitplane if the row doesn't set any data in the matrix?
It could possibly save some time the library doesn't have to spend on PWMing (when there is no data you won't need to toggle the row on and off)
Just clock it in, pull strobe and oe and don't PWM oe for long.
Or would the overhead more time consuming than the actual time you would wait for the PWM to finish?

Active-RPi-3xHub75-Adapter

Hi,
I want to buy your adapter but I expect the board will be delivered without the IC etc.
So can you tell me which components are needed?

Thanks

Running led-matrix as daemon

Hi,

thanks to Your code I got my 32 x 256 Matrix running. Now I'd like to start led-matrix as a daemon but I've got no idea how send new images to the daemon. I tried to copy ppm-files to /dev/mem but this causes my pi to crash.
Could you give me an example ?
Thanks in advance
Thomas

Issues driving 32x64 matrix

I have a 32x64 matrix from Adafruit, and have been unable to drive a consistent pattern across all rows. I had at first suspected that the matrix had issues, but some of the demos seem to suggest all pixels are capable of all desired colors. Note that at 1:15 in the video, I cycle through demo 0 with each bit value 1 to 11 for PWM.

http://youtu.be/_QmmxjrfeGI

I am running the led-matrix with flags for rows at 32 and chained at 2 (yes, when chained = 1, it acts like 2 32x32 panels, but they are not perfectly mirrored). I made sure all GND pins on the panel are connected to the Pi and I am using a 10A power supply.

74HC245 vs. 74HCT245

Hi -
I got some LED Boards from a previous installation left over and I'd like to use them with the RPi2. Checking the chips to make sure it runs with 3.3 Volt i saw the type: "ChipOne ICN74HC245TS". Does anybody know if this is a HC or HCT type chip? Found a supplier on aliexpress, but there ain't no datasheets around.
Thanks for any hints,
best
Urs

foto

led-image-viewer doesn't work. "Crashes"?

Hi there,

I compiled led-image-viewer and tried it on several gif images, but all I get is the following output:

pi@autopi ~/display16x32/rpi-rgb-led-matrix $ sudo ./led-image-viewer giphy.gif
Read image...
Assembling animation with 25 frames.
Scale ... 281x216 -> 32x32
Preprocess for display.
Display.

Its runs for about half a second on terminal and than terminates. And nothing is shown on the panel. Rest of the examples work fine!

Any Idea?

Scrolling ppm

I am using your project to control a 16x32 led matrix

Particular the demo1 scrolling message
As you can see in the adafruit tutorial i'm missing THE lowest horizontal row and first /last vertical row on the right
https://learn.adafruit.com/connecting-a-16x32-rgb-led-matrix-panel-to-a-raspberry-pi/overview

Any idea how i can solve this?

I'm using a rpi and led matrix to scrol ppm's generated by my restored arcade cabinet's frontend
80's Pacman style ! Gives my project a personal touch!

Thanx for sharing your code!

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.