Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LEDCube - panels do not work. #19

Open
Investegate opened this issue Mar 12, 2021 · 21 comments
Open

LEDCube - panels do not work. #19

Investegate opened this issue Mar 12, 2021 · 21 comments

Comments

@Investegate
Copy link

Hello.

I have a problem with my setup. I got no output with the examples of the hzeller/rpi-rgb-led-matrix library. I use a RPI 2b v1.1 and a Adafruit RGB Matrix Bonnet to drive a 64x64 LED Matrix of Aliexpress (https://a.aliexpress.com/_mLDLYhN)

For the hardware part:
I have soldered GPIO4 & GPIO18 for the quality setting
shorted out the middle pad to ‘8’ on the backside of the Adafruit RGB LED Bonnet

For the software part:

I have installed the LED-matrix library with quality mod for the bonnet.
I tried a couple of different flags. But i think, this should be the right:
sudo ./demo -D0 --led-rows=64 --led-cols=64

I also tried this with no success:

sudo ./demo -D0 --led-rows=64 --led-cols=64 --led-gpio-mapping=adafruit-hat

The RPI starts the DEMO, but the panel remains black. Absolutely nothing happens.

I also tried the convenience option. But its still the same. And i tried also the E to 16....

Please help :)

Best Regards!

@Investegate
Copy link
Author

Could it be the wrong panels? I got the instruction of the panels as pdf from the manufacture: https://www.docdroid.net/Oy5GKYW/fm6124-pdf

@Staacks
Copy link
Owner

Staacks commented Mar 13, 2021

Since this already occurs with the hzeller library, it is not really an "issue" for the LED matrix code. But since we do not really have too many open issues here, I will leave it open for a while, so maybe someone with a good idea can help you.

I will also add the reference to your question on Reddit with my suggestion (which apparently was not the solution), so others can easily find both threads if researching a similar problem: https://www.reddit.com/r/thereoughtabe/comments/m2onlu/led_cube_no_function_with_rpi_2b_adafruit_bonnet/

(BTW: I just saw that Reddit has marked it as spam, probably because of the aliexpress-link in it. I have approved it now, so it should be visible again.)

@Investegate
Copy link
Author

Vielen Dank dir :) Ich würde deinen Cube nur zu gerne nachbauen :D

@Investegate
Copy link
Author

Can someone please recommend a suitable panel that works well without further ado? (P2 64x64)

@Investegate
Copy link
Author

Hey :) I sold my Panels with the FM6124 ICs and bought some with FM6126A ICs.
I tried it, but still nothing works. Then i used an other Raspberry Pi and it works :D Maybe the FM6124 IC´s will work also, but now its to late to test it xD

@Staacks
Copy link
Owner

Staacks commented Apr 1, 2021

That's odd. Do I understand correctly that you just swapped the Pi for the same model or was it a different one?

@Investegate
Copy link
Author

Yea i think the RPI 2 that i bought on ebay was broken. I just paid 10€ for that Pi xD
So i tried it with my RPI 3 where i run Octoprint for my 3d printer. That works. Now i have ordered an other RPI 2 for this project here. And then i will try it with that.

@Investegate
Copy link
Author

Hey @Staacks,

i can now run the examples of the rpi-rgb-led-matrix library without any issues. All works fine with your parameters.
I got my Pi ready to support OpenGL by Matus Novak. That works fine with the triangle. I opened the trainee.raw in photoshop, but it seams only to be black&white (grey).
I also done that without error: g++ -g -o cpu-stats-gl cpu-stats-gl.cpp -std=c++11 -lbrcmEGL -lbrcmGLESv2 -I/opt/vc/include -L/opt/vc/lib -Lrpi-rgb-led-matrix/lib -lrgbmatrix -lrt -lm -lpthread -lstdc++ -Irpi-rgb-led-matrix/include/

On my pc i use windows 10, so i installed the LEDCubeFeeder from Johnwulp. This works good and i can see the right output of the program in the log. I set the right IP and also the Port 1234.
But on the LEDCube nothing happened. The panels stay black.

If you can help me I would like to give you a donation.

Best Regards :)

@Investegate Investegate reopened this Apr 1, 2021
@Staacks
Copy link
Owner

Staacks commented Apr 1, 2021

ok, here are my first thoughts:

  • At the moment you do not need to worry about the feeder-part from Windows 10. If the cube does not receive CPU stats, it should at least show a grayscale version of the animation.
  • Which parameters did you need to set in the end for the rpi-rgb-led-matrix examples? You should make sure that they are the same as set in the code at . There might be a few options that are not set to the default value, so check the hardware options here. Also, I am not entirely sure right now if you can set them as a command-line parameter to cpu-stats-gl. I set them all in code, so I can just call ./cpu-stats-gl in the end to start the cube.
  • I have never tried generating the raw file from Matus Novak myself, but that it does not throw an error does not necessarily say much if the output stays black. One annoying aspect when working with OpenGL is that the code never crashes and never outputs any errors on its own. If OpenGL is not happy, it has a tendency to just stay black unless you explicitly check for errors in the code. I am not sure if the example by Matus Novak does this, so it might just be a problem with viewing the file, but it could also be an OpenGL issue. I just would not rule this out at this point.

@Investegate
Copy link
Author

Hey and thank you for your fast answer!

At the moment you do not need to worry about the feeder-part from Windows 10. If the cube does not receive CPU stats, it should at least show a grayscale version of the animation.

Ok alright. I installed the normal rasbianOS on my Pi. Not the light version. Could that be a problem?

Which parameters did you need to set in the end for the rpi-rgb-led-matrix examples? You should make sure that they are the same as set in the code at
there.oughta.be/led-cube/led-cube/cpu-stats-gl.cpp
Line 507 in 7b22293
//LED Matrix settings
. There might be a few options that are not set to the default value, so check the hardware options here. Also, I am not entirely sure right now if you can set them as a command-line parameter to cpu-stats-gl. I set them all in code, so I can just call ./cpu-stats-gl in the end to start the cube.

I keep the settings there as default. I only changed the number of cores int this file to 8.
I can run with this string the examples perfect:
sudo ./demo -D1 runtext.ppm --led-rows=64 --led-cols=192 --led-panel-type=FM6126A --led-pwm-bits=11 --led-slowdown-gpio=1 --led-parallel=1 --led-chain=1 --led-brightness=60 --led-pwm-lsb-nanoseconds=50 --led-rgb-sequence RGB

The only way that remembers me now is reinstalling rasbianOS again and install everything again to exclude a mistake here.

@Investegate
Copy link
Author

Investegate commented Apr 1, 2021

Haha i just got it xD

pi@raspberrypi:~ $ ./cpu-stats-gl
Initialized EGL version: 1.4
GL Viewport size: 192x64
Need root. You are configured to use the hardware pulse generator for
smooth color rendering, however the necessary hardware
registers can't be accessed because you probably don't run
with root permissions or privileges have been dropped.
So you either have to run as root (e.g. using sudo) or
supply the --led-no-hardware-pulse command-line flag.

Exiting; run as root or with --led-no-hardware-pulse

So i run it with sudo ./cpu-stats-gl and it works :D Very nice ^-^

pi@raspberrypi:~ $ sudo ./cpu-stats-gl
Initialized EGL version: 1.4
GL Viewport size: 192x64

But how do I set it right now, that it start automatically in root mode?

@Investegate
Copy link
Author

I have got it. I have done it for the autostart like in this tutorial: https://www.youtube.com/watch?v=yDJgohRfTb0
It seems to works fine!

One last question :D

One LED of one panel is missing in the corner. It falls off while shipping.
And it doesn't matter if i change the panel in the row. The missing pixel is always exactly in the center of the circle. Is it possible to rotate the display on one or all panels by 180 degrees? Then it is hardly noticeable.

And i need you PayPal or Coffee link for the donation 👍

@Staacks
Copy link
Owner

Staacks commented Apr 4, 2021

Is it possible to rotate the display on one or all panels by 180 degrees? Then it is hardly noticeable.

Yes, I would edit the coordinate mapping for the vertices that make up the rendered surface. Have a look at this:

static const GLfloat vcoords[] = {
0.0f,
0.0f,
-0.866f,
0.5f,
0.0,
-1.0f,
-0.866,
-0.5f,
0.0f,
0.0f,
0.0f,
-1.0f,
0.866f,
0.5f,
0.866f,
-0.5f,
0.0f,
0.0f,
0.866f,
0.5f,
-0.866f,
0.5f,
0.0f,
1.0f,
};

...and compare it to the explanation and illustrations of the coordinate mapping in the blog article: http://there.oughta.be/an/led-cube#the-opengl-shader
Rotating one panel should be as simple as swapping two blocks of coordinates in this code segment.

And i need you PayPal or Coffee link for the donation

Well, I really enjoy doing this stuff just for the fun of it :) But, since I will not mind some change to buy electronics and gadgets without having a bad conscience towards my family, I will probably set something up in the near future. Have to figure out some bureaucracy first, though.

@Investegate
Copy link
Author

Ok, I'll try that.

I now have a new RPI 2. It now runs. Have Rasbian Lite installed. Only I do not get it there with the auto startup. I made exactly as with the desktop version of Rasbian. But it just does not start at the startup. Have now also tried some other methods for the autostart. Unfortunately without success. Maybe you have another tip in this regard.

@Staacks
Copy link
Owner

Staacks commented Apr 6, 2021

I have just added a single line to /etc/rc.local (just before "exit 0"):
/home/pi/performance-gl&

In your case it should be /home/pi/cpu-stats-gl& (mine has an older filename from before publication) or maybe another path, depending on where you placed your executable. Don't forget the ampersand.

@Investegate
Copy link
Author

Thank you :) After a long back and forth, I finally made it. Of course only thanks to your help!

Best regards

@Investegate
Copy link
Author

Hey @Staacks,

i have one more thing :D
I have as you said 2 blocks swapped to turn the display. I noticed that the ring is no longer fit at the ends. Can you make that right again?
Here you can see it: https://ibb.co/7kXbt0J

Best Regards :)

@Investegate Investegate reopened this Apr 9, 2021
@Investegate
Copy link
Author

PS: Incidentally, I have measured the power consumption. Maximum flow 2.5A. A power supply with 5V/3A is sufficient.

@Staacks
Copy link
Owner

Staacks commented Apr 13, 2021

Hey @Staacks,

i have one more thing :D
I have as you said 2 blocks swapped to turn the display. I noticed that the ring is no longer fit at the ends. Can you make that right again?
Here you can see it: https://ibb.co/7kXbt0J

Best Regards :)

Looks like it just needs to be flipped. I have lost track of which coordinates belong to this particular panel on your build... You now have this as the two groups in the middle, right?

     0.866f, 
     0.5f, 
     0.866f, 
     -0.5f, 

     0.0f, 
     0.0f, 
     0.0f, 
     -1.0f, 

If this group belongs to the panel in the bottom left corner (although, I think in my build it was the first two groups that belong there), you should switch second half of each groupt, like this:

     0.866f, 
     0.5f, 
     0.0f, 
     -1.0f, 

     0.0f, 
     0.0f, 
     0.866f, 
     -0.5f, 

If not, show me exactly how it is right now and try to set any line in each group to +100 after each other. This way, you can tell me, which group belongs to which panel...

PS: Incidentally, I have measured the power consumption. Maximum flow 2.5A. A power supply with 5V/3A is sufficient.

Interesting. Is this in normal mode or full white? I am getting instabilities when it is full white...

@Investegate
Copy link
Author

Investegate commented Apr 14, 2021

Looks like it just needs to be flipped. I have lost track of which coordinates belong to this particular panel on your build... You now have this as the two groups in the middle, right?

 0.866f, 
 0.5f, 
 0.866f, 
 -0.5f, 

 0.0f, 
 0.0f, 
 0.0f, 
 -1.0f, 

I don't think so but i am a little confused now. I only changed the first two groups:

0.0,
-1.0f,
-0.866,
-0.5f,

0.0f,
0.0f,
-0.866f,
0.5f,

0.0f,
0.0f,
0.0f,
-1.0f,

0.866f,
0.5f,
0.866f,
-0.5f,

0.0f,
0.0f,
0.866f,
0.5f,

-0.866f,
0.5f,
0.0f,
1.0f,

If i change the second half of the two first blocks like that,

0.0,
-1.0f,
-0.866f,
0.5f,

0.0f,
0.0f,
-0.866,
-0.5f,

i got this: https://ibb.co/XxdC5M6

I took a second picture, if the cube stands on a flat side, like yours: https://ibb.co/mc4f9YR
The panel or the circle must be mirrored / swapped on the red line!

Interesting. Is this in normal mode or full white? I am getting instabilities when it is full white...

In normal mode. If you use your animation with 100% brightness. Sure, full white will need more amps.

@Staacks
Copy link
Owner

Staacks commented Apr 19, 2021

Sorry, I did not find the time to review this yet and I am still not sure if I have all the info, because your result is not really what I was expecting...

May I suggest that you test which of the edges belongs to which corner first? As suggested in a previous post, set one corner after the other to an extreme value and see which corner of which panel changes. (Two lines belong to one corner as they are x and y coordinates. You should have 12 corners in total, obviously.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants