0

RGB Matrix Sample Programs
Moderators: adafruit_support_bill, adafruit

Forum rules
Talk about Adafruit Raspberry Pi® accessories! Please do not ask for Linux support, this is for Adafruit products only! For Raspberry Pi help please visit: http://www.raspberrypi.org/phpBB3/
Please be positive and constructive with your questions and comments.

RGB Matrix Sample Programs

by JPBOYLANJR on Mon Mar 12, 2018 4:37 pm

I built and installed a RGB Matrix HAT + RTC. I completed the software download no problem. The rpi-rgb-led-matrix folder was created and contains the files referenced in the Adafruit instructions and the read me file. The instructions indicate “sudo ./demo” is the first command to enter — I have tried all sorts of combinations result is always “command not found”. What have I missed?

Thanks

Jim

JPBOYLANJR
 
Posts: 4
Joined: Tue Feb 27, 2018 4:13 pm

Re: RGB Matrix Sample Programs

by adafruit_support_mike on Tue Mar 13, 2018 12:53 am

Are you sure you're entering the command from the directory where the demo script lives?

What output do you get from `ls -l`?

adafruit_support_mike
 
Posts: 54104
Joined: Thu Feb 11, 2010 2:51 pm

Re: RGB Matrix Sample Programs

by JPBOYLANJR on Tue Mar 13, 2018 4:39 pm

ls -l produced a list of 18 items that included several python program names and other items such as: Desktop, Downloads, Documents, Music, Pictures, Scratch, rbi-matrix.sh, rgn-matrix.sh, rpi-rgb-led-matrix —

I also tried opening Python 3.5.3 and running one of the programs in /home/pi/rpi-rgb-led.matrix/python/samples the program was simple.square.pi it appears to run printing a message “Press CTRL-C to stop sample” however the LED display remains blank. I have confirmed 5 volts are present at the power plug on the display. I am using the 5 volt 4 amp power supply. The Pi is being powered by its own original power supply. The 16 pin cable is connected from the HAT to the display socket marked “input” arrow pointing to the power plug. I moved the 16 pin cable to the other socket, columns 16 and 32 on the display illuminate white. Program still does not run.

This Pi is being used in an after school coding club, previously I had a Pi Sense Hat on it which worked fine — could this be creating a conflict with the current install?

Also thanks for the quick response to the original post,

Jim

JPBOYLANJR
 
Posts: 4
Joined: Tue Feb 27, 2018 4:13 pm

Re: RGB Matrix Sample Programs

by adafruit_support_mike on Wed Mar 14, 2018 7:08 pm

If the list didn’t contain ‘demo’, you were entering the command from the wrong directory.

The list you described sounds like a RasPi home directory that’s been connected to a Mac using the Mac’s native file sharing. It expects to see directories named Documents, Desktop, and so on, and creates them if it doesn’t see them. You probably need to enter the command:

Code: Select all | TOGGLE FULL SIZE
cd rpi-rgb-led-matrix
then run `ls -l` again to see if one of the items is named ‘demo’.

Running the code from a Python prompt will only work if you used:

Code: Select all | TOGGLE FULL SIZE
sudo python3
to launch the interpreter. The RasPi restricts access to the GPIO pins, and the `sudo` command gives the following command the access rights to do that.

adafruit_support_mike
 
Posts: 54104
Joined: Thu Feb 11, 2010 2:51 pm

Re: RGB Matrix Sample Programs

by JPBOYLANJR on Thu Mar 15, 2018 6:08 pm

Thanks for the help on this. Once I got to the right directory and added “sudo” before Python3 and the program name all of the sample programs worked as advertised. Next step is to add another 32 x 32 led matrix and dig into the programming. I am assuming there is nothing I can do to configure the Python3 IDLE to be able to run the programs without using the command line.

Thanks again for the help:)

Jim

JPBOYLANJR
 
Posts: 4
Joined: Tue Feb 27, 2018 4:13 pm

Re: RGB Matrix Sample Programs

by adafruit_support_mike on Thu Mar 15, 2018 6:34 pm

IDLE will run with the correct privileges if you use `sudo` to launch it.

If you’re launching it from the GUI, there are ways to edit the resource files to make that happen. Hit the search engines with ‘launch IDLE as root’ and look for versions that match the version of Raspbian you’re using.

adafruit_support_mike
 
Posts: 54104
Joined: Thu Feb 11, 2010 2:51 pm

Re: RGB Matrix Sample Programs

by JPBOYLANJR on Sun Mar 18, 2018 4:15 pm

Thanks again for your help on this. As a result of your recommendations not only is the original problem fixed, we have many new areas to explore. I am launching the Python3 IDLE from a command line as sudo that allows us to run the samples using the IDLE. I am researching the changes that need to be made To enable launching launching IDLE from the GUI so it can access GPIO. We are planning on adding a secon 32x32 panel to experiment with.

Jim

JPBOYLANJR
 
Posts: 4
Joined: Tue Feb 27, 2018 4:13 pm

Re: RGB Matrix Sample Programs

by adafruit_support_mike on Mon Mar 19, 2018 1:43 am

Glad to hear you've gotten things working. Happy hacking!

adafruit_support_mike
 
Posts: 54104
Joined: Thu Feb 11, 2010 2:51 pm

Re: RGB Matrix Sample Programs

by kr_jammin on Tue Nov 27, 2018 1:29 am

hi, i'm in a very similar boat to jim at the beginning of this thread....
but when i run `ls -l` (after first entering cd rpi-rgb-led-matrix) i see everything except anything that says demo. and i still get an identical message when i try to run the demo. could it have somehow been excluded from my download?

also worth mentioning this is my first foray into anything like this, first time even opening a terminal haha.

let me know what my next move should be, thanks!

kr_jammin
 
Posts: 3
Joined: Tue Nov 27, 2018 1:23 am

Re: RGB Matrix Sample Programs

by adafruit_support_mike on Tue Nov 27, 2018 5:27 am

Post the exact output you get from `ls -l` between CODE tags please.

adafruit_support_mike
 
Posts: 54104
Joined: Thu Feb 11, 2010 2:51 pm

Re: RGB Matrix Sample Programs

by kr_jammin on Wed Nov 28, 2018 2:09 am

hi mike- here is what i get:

total 116
drwxr-xr-x 6 pi pi 4096 Sep 23 13:09 adapter
drwxr-xr-x 4 pi pi 4096 Sep 23 13:09 bindings
-rw-r--r-- 1 pi pi 18092 Sep 23 13:09 COPYING
drwxr-xr-x 2 pi pi 4096 Nov 22 20:37 examples-api-use
drwxr-xr-x 2 pi pi 4096 Sep 23 13:09 fonts
drwxr-xr-x 2 pi pi 4096 Sep 23 13:09 img
drwxr-xr-x 2 pi pi 4096 Sep 23 13:09 include
-rwxr-xr-x 1 pi pi 281 Sep 23 13:09 led-matrix
drwxr-xr-x 2 pi pi 4096 Nov 22 20:37 lib
-rw-r--r-- 1 pi pi 817 Sep 23 13:09 Makefile
-rw-r--r-- 1 pi pi 29600 Sep 23 13:09 README.md
-rw-r--r-- 1 pi pi 6651 Nov 24 21:03 rgb-matrix.sh
drwxr-xr-x 10 pi pi 4096 Sep 23 13:09 rpi-rgb-led-matrix
drwxr-xr-x 2 pi pi 4096 Sep 23 13:09 utils
-rw-r--r-- 1 pi pi 9634 Sep 23 13:09 wiring.md

and when i enter “sudo ./demo” i get :

sudo: ./demo: command not found

kr_jammin
 
Posts: 3
Joined: Tue Nov 27, 2018 1:23 am

Re: RGB Matrix Sample Programs

by adafruit_support_mike on Wed Nov 28, 2018 5:24 am

Thank you.

It looks like you're using the hzeller version. Try ours, which is forked from the main project:

https://github.com/adafruit/rpi-rgb-led-matrix

adafruit_support_mike
 
Posts: 54104
Joined: Thu Feb 11, 2010 2:51 pm

Re: RGB Matrix Sample Programs

by kr_jammin on Sun Dec 02, 2018 2:22 am

hi mike, thanks for the reply. i had a chance to continue digging into this and i now at least have red lights flashing on the screen, still no images though. so here are some additional questions:
there are two different tutorials: https://learn.adafruit.com/raspberry-pi ... y/software and https://learn.adafruit.com/adafruit-rgb ... g-matrices
the ladder one is specifically for the rtc hat and former one is not.
-if i follow the first one and specify in the makefile that im using -DADAFRUIT_RGBMATRIX_HAT my setup should work with the rest of the tutorial correct?
-seems like the ladder link is just for demo purposes since there is no 'matrix.cfg' file to point to to duplicate the screen image on the led panels? i also cannot get those demos to display, only get flashing red bars. i tried adjusting the gpio setting to no avail.

if that's true i think i may be going wrong somewhere else in the makefile, not sure though. let me know where you think i should look next.
thanks again for your help

kr_jammin
 
Posts: 3
Joined: Tue Nov 27, 2018 1:23 am

Re: RGB Matrix Sample Programs

by adafruit_support_mike on Mon Dec 03, 2018 3:15 am

The first tutorial is an old one, and might not work with recent versions of Raspbian and the LED Matrix code.

The second tutorial is current, and should work whether you have a Matrix Hat connected or not. The matrix part of the Hat is mostly a set of wiring connections, 3V-to-5V level shifters, and connections for an external 5V power supply.

adafruit_support_mike
 
Posts: 54104
Joined: Thu Feb 11, 2010 2:51 pm

Please be positive and constructive with your questions and comments.