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: 16462
Latest: TheRockyRoad
New This Month: 12
New This Week: 1
New Today: 0
Stats
Total Posts: 132620
Total Topics: 16449
Most Online Today: 390
Most Online Ever: 7634
(January 21, 2020, 02:14:03 AM)
Users Online
Members: 1
Guests: 111
Total: 112

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

Video Output display creation failed by Zcarpenter
June 17, 2024, 11:42:12 AM

Difference on Channel output > LED Panels between two FPP instances by Poporacer
June 17, 2024, 08:08:51 AM

Scheduler Holiday list now only has Christmas and New Years by SeldenBlack
June 16, 2024, 04:43:00 PM

Did the the latest upgrade tonight and it failed. by k6ccc
June 15, 2024, 11:56:26 AM

FPP 7.5 Virtual Matrix Overlay Sub Model State by wjenkins364
June 14, 2024, 11:04:59 PM

Looking for specs on F4V2 (Red) by algerdes
June 13, 2024, 08:14:31 PM

F16v3 & Differential Cntrl Pwr Question by jeff.ott
June 13, 2024, 07:55:31 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

Powered by EzPortal
Powered by SMFPacks Menu Editor Mod