News:

Server migration complete, Welcome to version 2.1.1

+-+-

+-User

Welcome, Guest.
Please login or register.
 
 
 
Forgot your password?

+-Site Stats

Members
Total Members: 16460
Latest: tripleblack
New This Month: 10
New This Week: 1
New Today: 0
Stats
Total Posts: 132598
Total Topics: 16443
Most Online Today: 221
Most Online Ever: 7634
(January 21, 2020, 02:14:03 AM)
Users Online
Members: 2
Guests: 168
Total: 170

Direct writing on the "LED Panels" peripheral

Started by digilabpg, May 21, 2024, 03:15:16 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

digilabpg

Good morning, thanks to anyone who can help me
I'm using a Python script in Falcon Player Ver.8 where I write images directly to the "/dev/fb0" device with this code and everything works fine:

def refresh():
    # We open the TFT screen's framebuffer as a binary file. Note that we will write bytes into it, hence the "wb" operator
    f = open("/dev/fb0","wb")
    # According to the TFT screen specs, it supports only 16bits pixels depth
    # Surfaces use 24bits pixels depth by default, but the surface itself provides a very handy method to convert it.
    # once converted, we write the full byte buffer of the pygame surface into the TFT screen framebuffer like we would in a plain file:
    f.write(screen.convert(24,0).get_buffer())
    # We can then close our access to the framebuffer
    f.close()

Now I would like to write with the same method on the "LED Panels" device but I can't find the way, can anyone help me?
Thank you all in advance, thank you

dkulp


Every pixel overlay model in FPP maps it's overlay data into named shared memory.   If you look in /dev/shm, you'll likely find a file there for the shared memory for each model.   You basically would need to use the REST API's to "Enable" the overlay (Set the Overlay Model State to enabled) and then you should be able to map that file into your memory space and manipulate the bytes.      

That said, it's been a long time since I looked at this stuff so I'm not 100% sure it's still working.   
Daniel Kulp - https://kulplights.com

digilabpg

Quote from: dkulp on May 21, 2024, 12:11:26 PMEvery pixel overlay model in FPP maps it's overlay data into named shared memory.  If you look in /dev/shm, you'll likely find a file there for the shared memory for each model.  You basically would need to use the REST API's to "Enable" the overlay (Set the Overlay Model State to enabled) and then you should be able to map that file into your memory space and manipulate the bytes.     

That said, it's been a long time since I looked at this stuff so I'm not 100% sure it's still working. 
Hi, thanks for the help, I found the video memory buffer files in /dev/shm FPP-Model-Data-fb0, FPP-Model-Data-LED Panels, I tried to write into the buffer file but the screen does not it updates, I also activated the Overlay node on fb0, I think that after writing to the file it must be loaded on the screen but I couldn't figure out how to do this.

darylc

@digilabpg Do you actually need FPP generally or are you just trying to use FPP to display to the panels?  In the latter case I just cut & paste FPP's colorlight source code into chat gpt and asked me to write some python functions to control the panels and bypased FPP completely.

digilabpg

Quote from: darylc on May 24, 2024, 09:11:13 PM@digilabpg Do you actually need FPP generally or are you just trying to use FPP to display to the panels?  In the latter case I just cut & paste FPP's colorlight source code into chat gpt and asked me to write some python functions to control the panels and bypased FPP completely.
Hi, thanks for the reply,

in fact I would only need the ability to write on P10/P5 panels even without FPP, now I'm using ColorLight cards, do you know where I can find this software support or maybe the Python libraries to do this to download? because with FPP I'm finding it difficult to write directly on the panels using scripts in Python which is the language I know.

Thank you if you can help me, bye.

dkulp

Try installing the matrixtools plugin and use that to "draw" on the panels.    That will make sure the overlay model is enabled.   Then, while the drawing is there, run your python to outputs to the shm.    If the overlay model isn't properly enabled, writing to the shm won't do anything.   The model has to be enabled so FPP knows to use the data.   If it works from the matrixtools, then its likely that you aren't enabling things properly first via the rest calls.
Daniel Kulp - https://kulplights.com

digilabpg

Quote from: dkulp on May 25, 2024, 02:02:22 AMTry installing the matrixtools plugin and use that to "draw" on the panels.    That will make sure the overlay model is enabled.  Then, while the drawing is there, run your python to outputs to the shm.    If the overlay model isn't properly enabled, writing to the shm won't do anything.  The model has to be enabled so FPP knows to use the data.  If it works from the matrixtools, then its likely that you aren't enabling things properly first via the rest calls.
Hi, thank you very much for your help,
unfortunately I can't get it to work, I installed Matrix Tool and everything works fine either on fb0 or LED Colors.
If with the Python scripts I write the RAW file on /dev/fb0 everything works fine, if I write the RAW file on /dev/shm/FPP-Model-Data-fb0 or /dev/shm/FPP-Model-Data-LED Panels doesn't work, RAW files are obviously the same size as the buffer
To enable overlay I tried using these commands:

fppmm -m fb0 -o on

or the command:

arg = {"State" : 1}
#r = requests.put('http://localhost/api/overlays/model/LED Panels/state', json = arg)
r = requests.put('http://localhost/api/overlays/model/fb0/state';, json = arg)

It doesn't work either way, the screen stays black and I can't figure out where I'm going wrong.
For the tests I use a Raspberry pi 4 with FPP 7.5
Thank you again for your help.

Support FPP

+- Recent Topics

Did the the latest upgrade tonight and it failed. by MikeKrebs
June 10, 2024, 09:19:42 PM

No Audio by Steve
June 07, 2024, 02:10:47 PM

Video IP Capture -> sound by MikeKrebs
June 06, 2024, 09:00:17 PM

Control Channel Output by zj023
June 03, 2024, 06:23:35 AM

Compatibility question by John_82
June 02, 2024, 04:23:25 PM

Virtual Display not working? by colonelcline
June 01, 2024, 04:55:41 PM

Help for my LED Pit board project by Octonath
May 31, 2024, 06:15:17 PM

Help, can't get PCA9685 working with xLights and FPP by dkulp
May 30, 2024, 08:54:53 AM

HELP Did something dumb - turned on Tethering by The Engineer
May 27, 2024, 06:39:38 PM

First Time User - Can't open GUI only Terminal by k6ccc
May 27, 2024, 09:51:34 AM

Powered by EzPortal
Powered by SMFPacks Menu Editor Mod