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

Example of using multiple panels in a non standard layout #26

Closed
witnessmenow opened this issue Jul 29, 2020 · 64 comments
Closed

Example of using multiple panels in a non standard layout #26

witnessmenow opened this issue Jul 29, 2020 · 64 comments

Comments

@witnessmenow
Copy link
Contributor

Hello,

First, thanks a lot of the library, it is working great! Much appreciated.

I have made a shield for using this library with the D1 mini style ESP32 board (if you want one @mrfaptastic , I would be more than happy to donate one) and someone wanted to arrange their panels vertically rather than horizontally and I came up with this fairly hacky, but very simple solution that I wanted to share.

https://github.com/witnessmenow/ESP32-i2s-Matrix-Shield/tree/master/examples/MultiplePanelVirtualScreenPatternPlasma

I'm creating a virtual display using AdafruitGFX where the user configures how their panels are laid out and it will look after the mapping of the pixels for them. A reference to this library is passed into the virtual displays constructor. I've implemented the same virtual calls as this library so you should be able to just swap out the matrix calls with the virtual display.

It should be flexible enough to be used with panels arranged in rows and columns too. There is possibly a better way of doing this, but this was one idea I had that I thought would be really simple for end users to use.

I noticed earlier that you updated to GFX, I haven't got a chance to try that out instead with the virtual display, its still using AdafruitGFX.

The example linked is patternPlasma, but I also tried it out on Aurora and it worked fine too. (I only have two panels though)

Just as a BTW, Aurora was running out of memory for me originally, but I noticed in #23 that you had mentioned that you updated some things to free up some, so I updated to version from about 8 hours ago (I see you have updated since!) and now it's working perfectly.

@mrcodetastic
Copy link
Owner

Hi Brian! Firstly, you're the legend that got me interested in these panels with your fantastic library for the ESP8266 years ago! So thank you for the kind words.

I'm creating a virtual display using AdafruitGFX where the user configures how their panels are laid out and it will look after the mapping of the pixels for them. A reference to this library is passed into the virtual displays constructor. I've implemented the same virtual calls as this library so you should be able to just swap out the matrix calls with the virtual display.

This is fantastic, and is something that has often come up as a request. I'll look into your implementation and merge it into the overall library.

I noticed earlier that you updated to GFX, I haven't got a chance to try that out instead with the virtual display, its still using AdafruitGFX.

I did, but as of a few minutes ago I've changed it back to Adafruit_GFX. GFX_Root didn't in the end provide any memory/program space benefits and I'd rather not break backwards compatability when people update to the new version of this library. Especially given you're using this library for your cool project.

Just as a BTW, Aurora was running out of memory for me originally, but I noticed in #23 that you had mentioned that you updated some things to free up some, so I updated to version from about 8 hours ago (I see you have updated since!) and now it's working perfectly.

That's great to hear. You should be able to get it working on 4-6 panels even, but who know. I only have a sole 32x64 to test with.

(if you want one @mrfaptastic , I would be more than happy to donate one)

That would be absolutely amazing if you were happy to do that? Absolutely no need to however. Can test the library out on this as well!

@witnessmenow
Copy link
Contributor Author

I'm not sure I can take credit for leading you down this dark, yet brightly illuminated, path! I didn't write PxMatrix, and only contributed very minor code changes to it! I did however use it in a lot of projects! On of the most common complaints I had from people using it was the second ribbon cable and a buddy mentioned this library to me, but I only really started using it recently.

If you'd like to merge it in that would be great. I have some instructions on top of the ino, but I think it might be better to describe it in more detail in a readme or something, with some high quality graphics, such as this beauty 😄

image

Re: Adafruit_GFX ah ok, good to know. I was actually interested in what the advantage between the two was!

Well just to mention it did work with Aurora demo out of the box before, just with my virtual screen thing it didn't on the old version of the lib.

That sounds great, I'd love to test it out with more panels! I have a friend who has a few of those pixel purses panels that she is looking to make into a larger screen, they are fairly low res though (32x16) but she has tried 3 so far with no problems, and she mentioned that she will try it with more when she gets time.

Re: board, no worries at all. Very happy to support the efforts of this library! Do you have the right ESP32 for it? If not I should have a spare one here I can throw in too. I'll send you an email

P.S.
I'm not sure if you ever seen this video before: https://www.youtube.com/watch?v=HKWDGangWU0

@witnessmenow
Copy link
Contributor Author

Actually, can you email me, I can't find your email! I didn't realise you didn't have to populate it in the library.properties file !

brian.d.lough@ gmail com

@mrcodetastic
Copy link
Owner

Thank you! Email sent earlier today.

@mrcodetastic
Copy link
Owner

mrcodetastic commented Aug 3, 2020

I have created a VirtualDisplay class example, and a graphic based on your git example. Thanks for this.

https://github.com/mrfaptastic/ESP32-RGB64x32MatrixPanel-I2S-DMA/tree/master/examples/ChainedPanels

Although, the 2x2 panel mapping example hasn't actually been written, especially with the rotated panels! Will get to that when I kindly recieve test panels from galaxy man.

@witnessmenow
Copy link
Contributor Author

witnessmenow commented Aug 7, 2020

I love the diagrams you added @mrfaptastic , but I think there is mistake with the 2x2 image

image

I don't think the bottom rows should be upside down

I think it should be:
[ 2 ][ 1 ]
[ 4 ][ 3 ]

It's possibly not a bad idea to have the option of invert the second row, as it makes it easier to arrange (it would need a long ribbon cable from 2 to 3 in my config. I might take a look at that later (although I can't test it)

My Buddy Emily got this working with 4 panels 32x16 panels btw, not sure the orientation though!

https://twitter.com/MLE_Online/status/1291547518493274113

@mrcodetastic
Copy link
Owner

mrcodetastic commented Aug 7, 2020 via email

@Galaxy-Man
Copy link

mrfaptastic, thanks for the update. Sorry not replied earlier, doing covid stuff.

@witnessmenow
Copy link
Contributor Author

witnessmenow commented Aug 7, 2020

I think it makes sense to make it optional, the ribbon cables that come with the screens are pretty short but longer ones are easy to get. But i'll leave it up to you!

as mentioned I can't test it but here is what I think the code should be (I literally have not checked this works though)

Adding invertEvenRows as a constructor param, can default it to true or false, or even remove this altogether.

bool invertEven = false;

    RGB64x32MatrixPanel_I2S_DMA *display;

    VirtualGFX(RGB64x32MatrixPanel_I2S_DMA &disp, int vRows, int vCols, int screenX, int screenY, int vResX, int vResY, bool invertEvenRows = false)
      : Adafruit_GFX(vResX, vResY)
    {
      this->display = &disp;
      rows = vRows;
      cols = vCols;
      screenResX = screenX;
      screenResY = screenY;

      virtualResX = vResX;
      virtualResY = vResY;

      invertEven = invertEvenRows;
    }

And then updating the getCoords function. Just remove the invertEven bool check if you don't want to make it optional.

inline VirtualCoords VirtualGFX::getCoords(int16_t x, int16_t y) {
  uint8_t row = (y / screenResY) + 1; //a non indexed 0 row number
  if(invertEven && (row % 2 == 0))
  {
    // First portion gets you to the correct offset for the row you need
    // Second portion inverts the x on the row
    coords.x = (y / screenResY) * (cols * screenResX) + (virtualResX - 1 - x);

    // inverts the y the row
    coords.y = screenResY - 1 - (y % screenResY);
  } else {
    coords.x = x + (y / screenResY) * (cols * screenResX);;
    coords.y = y % screenResY;
  }
  return coords;
}

@witnessmenow
Copy link
Contributor Author

Looking at the graphics agian, even with the serpentine, the still look wrong to me.

Screen 4 has the origin, so 1 and 2 should be upside down.
image

The vertical one is also incorrect, display 4 should be on the top. Also every second display should be inverted if you want to stick with inverting the even rows

@Galaxy-Man
Copy link

mrfaptastic, I will be ordering more panels next week, let me know if you'd like another 2 for trying the 2x2.

@witnessmenow
Copy link
Contributor Author

Actually I can test it, I was thinking too big!

Here are two vertical panels, with the second one inverted

image

image

@Galaxy-Man
Copy link

Ive looked at it and layed out the panels, too me it looks correct. When I put two panels together the 0rigin shifted to second panels qed the diagram looks correct for 4.

@Galaxy-Man
Copy link

Good job on 64x64

@mrcodetastic
Copy link
Owner

mrcodetastic commented Aug 9, 2020

Alright. I think I can close this issue. Thanks @witnessmenow for the code, and huge thanks to @Galaxy-Man for the 2xP3's! 🥇
So I have three panels of different sizes to test the logic, which made it possible.

Simplified the diagram after your feedback as people won't really care about how it works to be honest.

Example updated.

IMG_20200809_191122_1
IMG_20200809_191125_2

Commit

@mrcodetastic
Copy link
Owner

mrcodetastic commented Aug 9, 2020

Also, I think where a bit of confusion came from is the fact I prefer to chain from the top-right down, and in your pattern plasma test you're chaining upwards.

So I've made it such the library can handle s-chaining as well as top-down or bottom-up (the latter being the default).

@mrcodetastic
Copy link
Owner

mrcodetastic commented Aug 9, 2020

mrfaptastic, I will be ordering more panels next week, let me know if you'd like another 2 for trying the 2x2.

Very kind of you yet again, but not sure if it's required now. You don't happen to have a spare HUB75 ribbon cable though - I could do with one of those things to connect a 4th panel.

@witnessmenow
Copy link
Contributor Author

witnessmenow commented Aug 9, 2020 via email

@Galaxy-Man
Copy link

Hi mrfaptastic, looks like good progress on the panels. Once you have Brian's package if you still need cables just message me and I'll send more.

@mrcodetastic
Copy link
Owner

I have plenty of them if you need them. I only sent the package Thursday so it will probably be with you early this week. There is one ribbon cable in it , but if you need more just let me know.

Ah yes. Sorry I forgot about this. Thank you so much! Looking forward to receiving it. Thanks again.

Hi mrfaptastic, looks like good progress on the panels.

If you end up buying more panels (i.e. 2x2) hook them up per the diagrams and test away. Should work fine with the library now. One could sell a cheap commercial LED panel signage product powered by just ESP32 with this.

@Galaxy-Man
Copy link

Galaxy-Man commented Aug 10, 2020

Was thinking along same lines, stupidly high fps or 24 gazillion colours may not be needed as won't be playing video etc. However for an info panel this is perfect. Less is more, do you think 2x2 will be the limit?

@mrcodetastic
Copy link
Owner

mrcodetastic commented Aug 10, 2020

Less is more, do you think 2x2 will be the limit?

Entirely dependant on colour depth. 2x3 should be easily doable I think. 2x4 with a lower color depth. Trial and error really to see what works / looks best!

Edit: Also dependant on what else would be in the sketch that uses memory. WiFi / networking / jpg decompression etc.

@mrcodetastic
Copy link
Owner

itworks

Thanks for the kind donation Brian [@witnessmenow ] of ESP32 and your new product. Looking forward to testing with this. As for the chaining, your cable has proven all is working now (ignore the fact I have different PX boards).

@mrcodetastic
Copy link
Owner

mrcodetastic commented Aug 10, 2020

ezgif com-video-to-gif

A quick mod to the new Animated GIF example to use the VirtualDisplay class shows no issues.

The pause in the video display is due to the GIF of neo flying, looping.

Original gif

@mrcodetastic
Copy link
Owner

Included in version 1.2.0 of the library + other improvements.

@mrcodetastic
Copy link
Owner

Hi @Galaxy-Man. I thought I would respond to this quote in this issue:

If you are thinking of going bigger let me know and Ill get you some more panels sent over. Im currently using FM6124/FM6126 and seems to be fine.

I chained all 6 panels I had up today (thanks again for the four), and it's working ridiculously well!

itworks

I'm going to run out of 5v power before memory.

@Galaxy-Man
Copy link

Galaxy-Man commented Aug 24, 2020 via email

@mrcodetastic
Copy link
Owner

mrcodetastic commented Aug 24, 2020

I think about 12-16 64x32 panels would be the memory limit, if there's no other memory consuming stuff happening in the sketch (like a webserver etc.).

Note: Not sure if one can technically chain that many panels without other issues coming into play, like noise on the data line / attenuation.

How much more power do you need?

It's a self-induced issue. Basically I need to get more poundland power packs. As a ghetto solution to not having a bench power supply I have each second panel connected to a rechargeable USB power pack via micro-usb plug soldered to the back of the panel, with a common ground running across all boards. Does the job for a short period for testing.

@atc1441
Copy link

atc1441 commented Aug 24, 2020

For me the maximum was 4 panels 64x64 with 8bpp after that there wasnt enough memory.
https://twitter.com/atc1441/status/1176855172204650496

You could simply try to init it with more panels and see when it stops working to get the max. in will just be not visible, have you tried that?

@Galaxy-Man
Copy link

Galaxy-Man commented Aug 30, 2020

Morning mrfaptastic, I'm back online been a busy week. Good tip ref capacitor for mulitpanel setup. Panels should be with me this week, I'll ship them out to you as soon as they arrive in deliveries.

I keep forgetting these are not closed conversations, everyone on GitHub reads, copies and actions our communications. As Brian mentioned also a good tip, when running panels at full brightness carefull of current usage. I'm using multi Tenma bench supplies so should be ok, also running setbrightness around 10.

Something I spotted one ESP32 I'm using only runs max 160mhz, and my others which are the 38 pin yellow header run at 240mhz. Not sure if that will make a difference to the fps as the DMA does the work, is my understanding correct?

@mrcodetastic
Copy link
Owner

mrcodetastic commented Aug 30, 2020

Hi @Galaxy-Man. Let me know if there's any comments you want deleted to protect identity, but I have been sending you the odd email directly - no reponse received yet. Thanks again for sending through panels!

The CPU speed is not of relevance - but it certainly will help with graphical calcs. If you want to speed up the DMA output to the GPIO's the frequency can be changed on about line 119 of 'ESP32-RGB64x32MatrixPanel-I2S-DMA.h'. It's currently set to 10Mhz which is a good trade off for 64x32 panels. For a huge chain it could be increased up to about 40Mhz to keep the refresh rate high and colour depth. Increasing the frequency also increases memory usage so it's trial and error.

@witnessmenow
Copy link
Contributor Author

Where are you guys getting the 64x32 panels at the moment? I just want to try link to ones that work with the library on my documentation!

@kosso
Copy link
Contributor

kosso commented Sep 6, 2020

Sorry if this sounds like a silly question, but I have a few 64x32 panels which I want to chain.

The instructions say to set a GPIO pin for the 'E' pin. The panels don't have an 'E' pin (because they're only 64x32). Leaving me confused by the instructions. (I thought the 'E' only exists on physical 64x64 panels ?)

So do I simply need to set an unconnected pin for 'E' to make this work with chained panels?

thx.

@mrcodetastic
Copy link
Owner

mrcodetastic commented Sep 6, 2020

Hi @kosso. No need to worry about the E pin. Only required for 64 (row) x64 panels.

Edit: I've updated the README to remove this confusion.

@kosso
Copy link
Contributor

kosso commented Sep 7, 2020

Hi. Thanks. I eventually figured it out early this morning.

I also finally got many of the Aurora demos working on a pair of stacked 32x64 panels using the chained 'virtualDisp'(lay), after much editing of the patterns and Effects files to deal with the 'virtual' size of a chained display, which differs from the global MATRIX_WIDTH and/or MATRIX_HEIGHT. 👍

@mrcodetastic
Copy link
Owner

Good to hear. If you're feeling generous, please feel free to raise a pull request and contribute. I'll create another example with the virtualDisplay.

Repository owner deleted a comment from Galaxy-Man Sep 16, 2020
Repository owner deleted a comment from Galaxy-Man Sep 16, 2020
Repository owner deleted a comment from Galaxy-Man Sep 16, 2020
@mrcodetastic
Copy link
Owner

Closing this issue as with Kosso's use of the VirtualDisplay library it's clearly proven to be working.

Removed a few comments in this thread which leaked personal details / chat.

@mrcodetastic
Copy link
Owner

@Galaxy-Man - FYI - As part of testing a new development branch, I have finally chained up the 12 x 64x32 panels of different types and it is working flawlessly. Managed to test this off one lone USB power pack.

IMG_20210208_214900

@mrcodetastic
Copy link
Owner

mrcodetastic commented Feb 8, 2021

@vortigont - The library changes work a treat, only needed to change:

#define NUM_ROWS 3 // Number of rows of chained INDIVIDUAL PANELS
#define NUM_COLS 4 // Number of INDIVIDUAL PANELS per ROW

In the ChainedPanels sketch and upload!! No need to hack the library itself anymore with the runtime memory allocation. Fantastic work.

@Galaxy-Man
Copy link

Galaxy-Man commented Feb 8, 2021 via email

@vortigont
Copy link
Collaborator

Those 12 looks awesome! Not even a glitch! :) So it makes it what... 32x64x12, right? Gotta go and throw out of the window my old tv panel... ha-ha :))))

@mrcodetastic
Copy link
Owner

Hey, how are you 😊 Hope you are keeping well? That is brilliant news getting all 12 working, so obvious question where is the limit, memory or panels? Would you like more panels to try, and may be bigger PSU?

Hi @Galaxy-Man. I am good thanks, thanks for asking - keeping as sane as one can during Covid. Luckily there's always a bug to fix or something to code to keep one entertained. Glad to hear you're well, if not busy.

Ideally I'd like to try and get this to work as a 4x4 grid (256x128) @ 8bpp color, so 16 panels in total - but I think that might be a tall ask given the memory required, and perhaps, the 2-3meters of chaining required. Always happy to try with a couple more panels.

Have you tried the NDK yet? Very impressed with your work quality and speed, some where along the way you should make money from this, I hope you are.

My entry into Android coding was out of sheer boredom - only Java/Kotlin based stuff at the moment and for my own learning. I don't make any money off this or other projects - the goal is to learn and have fun above all else. Others (such as @vortigont @witnessmenow) have made major contributions to this project which keeps the wheels turning!

Those 12 looks awesome! Not even a glitch! :) So it makes it what... 32x64x12, right? Gotta go and throw out of the window my old tv panel... ha-ha :))))

Correct! I tried the current vs. dev branch and both seemed to 'KABOOM' :) around 15 panels though.

@Archer-1983
Copy link

Hello,

First, thanks a lot of the library, it is working great! Much appreciated.

I have made a shield for using this library with the D1 mini style ESP32 board (if you want one @mrfaptastic , I would be more than happy to donate one) and someone wanted to arrange their panels vertically rather than horizontally and I came up with this fairly hacky, but very simple solution that I wanted to share.

https://github.com/witnessmenow/ESP32-i2s-Matrix-Shield/tree/master/examples/MultiplePanelVirtualScreenPatternPlasma

I'm creating a virtual display using AdafruitGFX where the user configures how their panels are laid out and it will look after the mapping of the pixels for them. A reference to this library is passed into the virtual displays constructor. I've implemented the same virtual calls as this library so you should be able to just swap out the matrix calls with the virtual display.

It should be flexible enough to be used with panels arranged in rows and columns too. There is possibly a better way of doing this, but this was one idea I had that I thought would be really simple for end users to use.

I noticed earlier that you updated to GFX, I haven't got a chance to try that out instead with the virtual display, its still using AdafruitGFX.

The example linked is patternPlasma, but I also tried it out on Aurora and it worked fine too. (I only have two panels though)

Just as a BTW, Aurora was running out of memory for me originally, but I noticed in #23 that you had mentioned that you updated some things to free up some, so I updated to version from about 8 hours ago (I see you have updated since!) and now it's working perfectly.

Hello,

First, thanks a lot of the library, it is working great! Much appreciated.

I have made a shield for using this library with the D1 mini style ESP32 board (if you want one @mrfaptastic , I would be more than happy to donate one) and someone wanted to arrange their panels vertically rather than horizontally and I came up with this fairly hacky, but very simple solution that I wanted to share.

https://github.com/witnessmenow/ESP32-i2s-Matrix-Shield/tree/master/examples/MultiplePanelVirtualScreenPatternPlasma

I'm creating a virtual display using AdafruitGFX where the user configures how their panels are laid out and it will look after the mapping of the pixels for them. A reference to this library is passed into the virtual displays constructor. I've implemented the same virtual calls as this library so you should be able to just swap out the matrix calls with the virtual display.

It should be flexible enough to be used with panels arranged in rows and columns too. There is possibly a better way of doing this, but this was one idea I had that I thought would be really simple for end users to use.

I noticed earlier that you updated to GFX, I haven't got a chance to try that out instead with the virtual display, its still using AdafruitGFX.

The example linked is patternPlasma, but I also tried it out on Aurora and it worked fine too. (I only have two panels though)

Just as a BTW, Aurora was running out of memory for me originally, but I noticed in #23 that you had mentioned that you updated some things to free up some, so I updated to version from about 8 hours ago (I see you have updated since!) and now it's working perfectly.

hi
can you help me how to use this library for P10 1/4 scan RGB panels
thank

@mrcodetastic
Copy link
Owner

Library does not support 1/4 scan panel as it says in README.

Sombody tried to make a workaround though: https://github.com/mrfaptastic/ESP32-HUB75-MatrixPanel-I2S-DMA/tree/master/examples/One_Quarter_1_4_ScanPanel

@Archer-1983
Copy link

Thank 👍

Repository owner deleted a comment from truckerreid Jun 27, 2023
Repository owner deleted a comment from board707 Jun 27, 2023
Repository owner deleted a comment from truckerreid Jun 27, 2023
@paulpham1407
Copy link

Actually I can test it, I was thinking too big!

Here are two vertical panels, with the second one inverted

image

image

How to control parallel panel?

@board707
Copy link
Contributor

What do you mean as "parallel panel" ?

@paulpham1407
Copy link

I want to display a video with a 192x128 vertical frame format using a ESP32, is that possible?

@board707
Copy link
Contributor

Why did you asked this in the somebody other thread?
Please open a new topic in the issues or Discussions.

@Abdulrahman-owayj
Copy link

ezgif com-video-to-gif ezgif com-video-to-gif

A quick mod to the new Animated GIF example to use the VirtualDisplay class shows no issues.

The pause in the video display is due to the GIF of neo flying, looping.

Original gif

This is fantastic job, I tried the virtual matric to display icons using drawIcon but I think its not supported yet,
i can show simple test though.
can you show me how to display the image like you did here

This issue was closed.
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

10 participants