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

Access to Matrix through serial or other means #3303

Closed
2 tasks done
joex92 opened this issue Oct 26, 2024 · 15 comments
Closed
2 tasks done

Access to Matrix through serial or other means #3303

joex92 opened this issue Oct 26, 2024 · 15 comments
Labels
answered question Further information is requested

Comments

@joex92
Copy link

joex92 commented Oct 26, 2024

Rules

  • I made myself familiar with the Readme, FAQ and Troubleshooting.
  • I understand that, if insufficient information will be provided, my issue will be closed without an answer.

Is your feature request related to a problem? Please describe

For me I find it wasteful to not be able to fully customize the Matrix beyond just "setting images" or preconfigured modes...
I saw that on Linux you can change it with Python, idk if that's possible on Windows...
for example being able to show anything dynamically, almost like an exrta screen...

Describe the solution you'd like

I've thought on many ways...

  • Serial, you could send serial messages to it to set each pixel value.
  • NDI source/destination, you could send any kind of video from any source to it.
  • ArtNet or DMX, using any kind of DMX software to manipulate each pixel.
  • Custom code, I've seen on other issues that you have to code some modes (like the audio mode), we could try to code our own modes and we could "upload" a custom code like the "picture/gif"...

Describe alternatives you've considered

the only thing in mind is using Linux... because I don't even know if this is possible...

Device and Model

Asus ROG Zephyrus G14 GA401QC

Additional information.

Even if this may be too much for you, It would be good, for me at least, to know how to access it by myself and do some testing... idk how to even start...

@seerge
Copy link
Owner

seerge commented Oct 26, 2024

@joex92 hello,

If you want to change Matrix image programmatically (you mention writing a Python code and using Linux for example) - then it's absolutely possible.

G-Helper uses this library to access matrix https://github.com/vddCore/Starlight , so you can also write your own code to set whatever you prefer.

I have extended / modified this library a bit afterwards, so you can use one form G-Helper codebase directly
https://github.com/seerge/g-helper/blob/main/app/AnimeMatrix/AnimeMatrixDevice.cs

As for your (specific) use-cases,

Serial, you could send serial messages to it to set each pixel value.

What does Serial mean in your understanding? Library to access matrix allows you to set brightness for each individual pixel.

NDI source/destination, you could send any kind of video from any source to it.

"Streaming" video to Matrix would cost a lot of resources (as you need to decode it to each frame, scale it and output pixel by pixel to matrix). But it is possible to set any animated GIF to matrix already. You can just convert video to GIF in advance and play it

ArtNet or DMX, using any kind of DMX software to manipulate each pixel.

What is ArtNET or DMX ?

@seerge seerge added the question Further information is requested label Oct 26, 2024
@joex92
Copy link
Author

joex92 commented Oct 26, 2024

@seerge Hi,

thanks for the library, I will check it out... but how do I use it with G-Helper to do testing?


  • through Serial I was thinking like connecting to the Matrix through a Serial port and send an array of numbers that would set each pixel up, that way I can change it "Live"...

  • I understand the "set any animated GIF" but that can´t be done dynamically, like for example generating visuals dynamically, for example using my web camera, that can't be done with a gif... I know this one might be resource intense...

  • ArtNet and DMX are 2 protocols that are commonly used to control RGB Lights, like the strip RGB lights you can buy and setup in your room or lights used on concerts/events or stuff like that... DMX is a protocol that lets you send individual values to each channel, in case of 1 RGB light it needs 3 channels, usually it supports 512 channels... ArtNet is similar but supports more channels and uses Network for communication...

@seerge
Copy link
Owner

seerge commented Oct 26, 2024

@joex92

If you write your own app to change matrix - you don't need G-Helper :) All communication between matrix and the app happens via USB interface. So you just need to reuse existing code and extend it.

  • It's not Serial, it's USB that is being used for communications. Matrix (same as keyboard and many other "peripherals") is just another USB device.
  • That is possible - but again needs to be manually implemented
  • I see, well in case of Matrix - it uses own proprietary protocol, where you can either set one of predefined (hardcoded in firmware modes), or set your own contents. Either led by led, or as a batch.

@joex92
Copy link
Author

joex92 commented Oct 26, 2024

@seerge

  • Oh, I see, so technically I would need to just send the data to the USB device? what does the library do then?
  • yeah, I find that option useful but at the same time too hard
  • I see, it has its own protocol through USB i suppose, then it's similar to DMX, which goes through USB as well...

@seerge
Copy link
Owner

seerge commented Oct 26, 2024

@joex92

Library / code actually sends data to the USB device :) Literally check code at https://github.com/seerge/g-helper/blob/main/app/AnimeMatrix/AnimeMatrixDevice.cs it has methods to set individual leds, pictures and even text.

@joex92
Copy link
Author

joex92 commented Oct 26, 2024

@seerge

Insteresting... thanks... Don't you think it would be good to add to G-Helper the feature to use a custom code as a matrix option?

Also there's no text option and I see you have a Text function on your code...

@seerge
Copy link
Owner

seerge commented Oct 26, 2024

@joex92 well, G-Helper can't run the "custom code" :) it's an app. Custom code can be written by reusing / extending what is already created as part of the project.

There is a text function, and it is used currently to render clock (it's a text with time and date). And eventually I might add an option to add any random text as well (see existing issue request).

@joex92
Copy link
Author

joex92 commented Oct 26, 2024

@seerge I was thinking on a way for people to "add modes", you could add a Folder where all the modes are and the app could load them as modes... isn't that possible?
Obviosuly this would be for people who know how to code, and for people who don't know, they could look for other's posted modes

@seerge
Copy link
Owner

seerge commented Oct 26, 2024

@joex92 that could be extremely difficult :) it would require some own pseudocode that will needs to be processed.

If someone with technical skills want to do something custom - it would be easier for them just to write app in C# (or extend G-Helper and offer it as a pull request)

@joex92
Copy link
Author

joex92 commented Oct 26, 2024

@seerge 🤔 I don't think a pseudocode would be strictly needed, it could use C#, and the app could just "load that script" as a mode... that way you don't need to use any other code language and just use the same language...
Obviously this would be for people who know how to code, and there could be some doc about what the functions available do and how to use it using the other existing modes as examples...

@seerge
Copy link
Owner

seerge commented Oct 26, 2024

@joex92 that won't work, sorry. Windows apps written in C# / .NET need to be compiled.

@joex92
Copy link
Author

joex92 commented Oct 26, 2024

@seerge oh... I see... then there must be some "pseudo language" coded in C# that could do that... I don't believe there's none, there must be some existing one that could be used... 🤔

@seerge
Copy link
Owner

seerge commented Oct 26, 2024

@joex92 i'm not aware of any.

To summarize our discussion - if you want to extend app functionality (i.e. add some new matrix mode) you will need to clone repository and just program this new mode and do a PR. If it's helpful and not resource-heavy I can include it.

Or you can just write / play around with your own app by just re-using G-Helper code.

@joex92
Copy link
Author

joex92 commented Oct 26, 2024

@seerge ok, I'll look for one and share it here if I find it...

anyways, thanks for all the info and the patience, I'm going to try to do some testings... It's been decades since I used C, and this time it's C#...

@seerge
Copy link
Owner

seerge commented Oct 28, 2024

@joex92 ok, np. I'm closing this as answered (as this is not an issue by itself). As mentioned - if you want to extend the app - it's possible :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
answered question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants