News:

LATEST RELEASE:  FPP 8.4 - Download from here - https://github.com/FalconChristmas/fpp/releases/tag/8.4

+-+-

+-User

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

+-Site Stats

Members
Total Members: 16851
Latest: mikebrowder
New This Month: 29
New This Week: 2
New Today: 0
Stats
Total Posts: 135335
Total Topics: 16955
Most Online Today: 92
Most Online Ever: 7634
(January 21, 2020, 02:14:03 AM)
Users Online
Members: 0
Guests: 50
Total: 50

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.

mattjcurry

I tried this as well and got the same result.  I was able to copy off the data from /dev/shm, but pushing data into /dev/shm has no impact.

Support FPP

+- Recent Topics

Question about /home/fpp/media/config/interface.wlan0 by Poporacer
Today at 03:52:38 PM

Tiny bug by lrhorer
Today at 01:40:41 PM

No Fuses and No Expansion Port by JonD
Today at 10:42:42 AM

Swapped PiCap V1 with V2 - Pixels will not light in test by twseeman
Today at 10:17:24 AM

FPP Connection Question by JonD
January 20, 2025, 03:50:30 PM

Does the Falcon PiCap v2 support Renard Output? by dakingus
January 20, 2025, 09:17:28 AM

F48 v1 & F16v5 by Mark_M
January 19, 2025, 09:34:10 PM

FPP 8.4 released! by lrhorer
January 19, 2025, 11:30:42 AM

K2-Pi-Servo by breese
January 17, 2025, 01:47:06 PM

Big button url question by darylc
January 14, 2025, 05:54:32 PM

Powered by EzPortal
Powered by SMFPacks Menu Editor Mod