ModusCreateOrg/network-rgb-matrix-display

How to documentation needed

rijotech opened this issue · 18 comments

I was able to compile the network-display-client and the matrix-server but I'm kind of confused on how to make this work since there is no how to doc available.
Can you guys please make some examples?

This is one of the problems I'm facing.

`/network-rgb-matrix-display/client $ sudo ./network-display-client simple.ini
arg 0   ./network-display-client
arg 1   simple.ini
NetworkDisplayConfig:
        frameRate 30
        inputBufferSize 3197040172
        inputStreamWidth 256
        inputStreamHeight 320
        outputScreenWidth 256
        outputScreenHeight 320
        singlePanelWidth 128
        singlePanelHeight 64
        totalPanelsWide 2
        totalPanelsTall 5
        segmentPanelsWide 2
        segmentPanelsTall 5
        Segments:
                Segment 0 IP: raspled
                Segment 0 Port: 9890
SegmentClient raspled (id = 0)
I have 1 segments!
SegmentClient 0x1873690
        mSegmentId = 0
        mSinglePanelWidth = 128
        mSinglePanelHeight = 64
        mPixelsPerPanel = 16384
        mSegmentWidth = 256
        mSegmentHeight = 320
        mMatricesWide = 2
        mMatricesTall = 5
        mTotalPixels = 32768
        mTotalBytes = 65536
        mDestinationIP = raspled
        mDestinationPort = 9890
Smaller screen is OUTPUT
error: XDG_RUNTIME_DIR not set in the environment.
* failed to add service - already in use?
`

Hi @rijotech . Yes, our documentation definitely needs help. I just realized that i have stubs for each server and client and didn't finish writing them. Sorry if this frustrates you. :(

For a high-level overview of how things work, here's the most documentation i've written thus far:
https://github.com/ModusCreateOrg/network-rgb-matrix-display/blob/master/md/How_it_works.md

One of the provisioning scripts my team wrote creates services and that's likely what is causing part of the problem. You have a daemon resident in memory and can't re-execute it. https://github.com/ModusCreateOrg/network-rgb-matrix-display/blob/master/server/pidisplay.service. I'm going to review

I need a day to go to my office and grab the panels and spare parts so that i can (re) setup a working environment at home. I was planning on doing this anyway since we've completed our 2020 game and wanted to get it up and running on the RGB Screen we have there.

In the interim, i'm going to boot up a pi and get you the commands on how to shut down and disable the service so you can iterate on your dev environment.

Thanks a lot @jaygarcia, I will take a look at that info to see if I can get it to work!
Thanks again. And sorry to bother you.

Hi @rijotech,

I put some of our build documentation (taken from GSuite) and put them here: https://github.com/ModusCreateOrg/network-rgb-matrix-display/tree/master/interim-docs

No worries. I too am self taught and meeting others like me is exciting (and energizing) :D

Cool, I developed a sick remote controllable screen using HZellers library that you can create a playlist, schedule what video to play at any giving time, it can call 911 and play an audio using text 2 speech, send text message, display custom video alerts, sync video folders every time there is new content on a remote server and all I need is this function to make it cooler.
Question: can this library work with128x64 matrix or is limited to 64x64?

It can work with whatever we program it to do.

I've not experimented with anything outside 64x64, but no reason why we couldn't try. All of it is contingent on how well the logic was crafted to parse the information.

So that I don't talk underneath you, what level of experience do you have with C++?

OK, well I can read codes and modify some but I'm not really good with C++ I mostly do php, jquery, javascript, shell scripting and some other stuff but not much C++.
I have sudo ./matrix-server rgb-server.ini running on the led screen server which is set up with 8 128x64 led matrix and an active 3 controller using this configuration on rgb-server.ini

; Exmaple INI file for a screen  with 20 matrices
; broken up into 5 strips of 4 64x64 pixel screens

; Single matrix dimensions
[matrix_dimensions]
width = 128
height = 64

[segment_info]
panels_wide = 2
panels_tall = 4

[network]
port = 9890
; Be sure to change this
;ip = 192.168.1.86
; and this for debugging purposes
segment_id = 1


; These are passed on to the rpi-rgb-led-matrix library
[rgb_matrix_lib_options]
; Name of the hardware mapping. Something like "regular" or "adafruit-hat"
hardware_mapping = regular

; The number of parallel chains connected to the Pi; in old Pis with 26
; GPIO pins, that is 1, in newer Pis with 40 interfaces pins, that can
; also be 2 or 3. The effective number of pixels in vertical direction is
; then thus rows * parallel. Default: 1
parallel = 2


; Set PWM bits used for output. Default is 11, but if you only deal with
; limited comic-colors, 1 might be sufficient. Lower require less CPU and
; increases refresh-rate.
; RPi4 - set to 6. Rpi 3, set to 4.
pwm_bits = 6

; Change the base time-unit for the on-time in the lowest
; significant bit in nanoseconds.
; Higher numbers provide better quality (more accurate color, less
; ghosting), but have a negative impact on the frame rate.
;  range of pwm-lsb-nanoseconds (50..3000 allowed).
; 130 is default
pwm_lsb_nanoseconds = 85

; The lower bits can be time-dithered for higher refresh rate.
; Flag: --led-pwm-dither-bits
;pwm_dither_bits = 1

; The initial brightness of the panel in percent. Valid range is 1..100
; Default: 100
brightness = 100

; Scan mode: 0=progressive, 1=interlaced
;scan_mode = 0

; Default row address type is 0, corresponding to direct setting of the
; row, while row address type 1 is used for panels that only have A/B,
; typically some 64x64 panels
;row_address_type = 0

; Type of multiplexing. 0 = direct, 1 = stripe, 2 = checker (typical 1:8)
;multiplexing = 0

; Disable the PWM hardware subsystem to create pulses.
; Typically, you don't want to disable hardware pulsing, this is mostly
; for debugging and figuring out if there is interference with the
; sound system.
; This won't do anything if output enable is not connected to GPIO 18 in
; non-standard wirings.
; 0 false, 1 true
disable_hardware_pulsing = 0

; 0 false, 1 true
show_refresh_rate = 1
; 0 false, 1 true
;inverse_colors = 0

; In case the internal sequence of mapping is not "RGB", this contains the
; real mapping. Some panels mix up these colors.
; see led-matrix.h for more details
led_rgb_sequence = RBG

; A string describing a sequence of pixel mappers that should be applied
; to this matrix. A semicolon-separated list of pixel-mappers with optional
; parameter.

pixel_mapper_config =

[rgb_matrix_runtime_options]
; 0 = no slowdown.
gpio_slowdown = 3

; ----------
; If the following options are set to disabled with -1, they are not
; even offered via the command line flags.
; ----------

; If daemon is disabled (= -1), the user has to call StartRefresh() manually
; once the matrix is created, to leave the decision to become a daemon
; after the call (which requires that no threads have been started yet).
; In the other cases (off or on), the choice is already made, so the thread
; is conveniently already started for you.
; -1 disabled. 0=off, 1=on.
daemon = 1

; Drop privileges from 'root' to 'daemon' once the hardware is initialized.
; This is usually a good idea unless you need to stay on elevated privs.
; -1 disabled. 0=off, 1=on.
drop_privileges = -1

; By default, the gpio is initialized for you, but if you want to manually
; do that yourself, set this flag to false.
; Then, you have to initialize the matrix yourself with SetGPIO().
; Use 1 for true, 0 for false
do_gpio_init = 1

And I'm running the client sudo ./network-display-client simple.ini with the fallowing config on simple.ini

; Exmaple INI file for a screen  with 20 matrices
; broken up into 5 strips of 4 64x64 pixel screens

[input_stream]         ; input stream size dimensions
width = 256
height = 256

[matrix_dimensions]    ; Single matrix dimensions
width = 256
height = 256

[segment_info]         ; How many segments is the screen broken into?
panels_tall = 1
panels_wide = 1

[output_stream]
frame_rate = 30         ; -1 to ignore
total_panels_wide = 1
total_panels_tall = 1
total_segments = 1      ; The number of displays we'll be piping TCIP data to

[segment_num_1]         ; Need a segment section for each of the total segments!
port = 9890             ;  Ports can be different if you wish.
ip = 192.168.1.86

#[segment_num_2]                                ;  Need a segment section for e$
#port = 9890
#ip = raspled2

#[segment_num_3]                                ;  Need a segment section for e$
#port = 9890
#ip = raspled3

#[segment_num_4]                                ;  Need a segment section for e$
#port = 9890
#ip = raspled4


Both raspberry are connected to my local router via ethernet but when i run the client to connect and send data to the server
I get malloc (); invalid next size (unsorted)
Aborted

I'm not really sure but if I'm not mistaken that's something related to my configuration, I tried changing stuff around but still no luck.

Leaving this here as something to fix:
Data array is a fixed size and needs to be based off of the ini file.
server/src/NetworkServer.cpp
image

Leaving this here as something to fix:
Data array is a fixed size and needs to be based off of the ini file.
server/src/NetworkServer.cpp
image

I'm kind of confused there, so basically the value 32768 is wrong?

Yes. Because it's hard coded instead of configuration based. I clearly overlooked this when setting it up. :(

The earliest i can look at this is about 1PM EDT tomorrow. Long story short, the array should be dynamically allocated via malloc and I can't recall why i made it static. :(

The earliest i can look at this is about 1PM EDT tomorrow. Long story short, the array should be dynamically allocated via malloc and I can't recall why i made it static. :(

Ok, I'm still playing the codes.

Hi @rijotech, have not forgotten about this issue :). I finally got to a point where I have a lab setup now.

I am setting up the software side and will circle back with you once I have things working.

image

Man, I almost didn't make it, that freaking coronavirus almost killed me, Question @jaygarcia I have a video wall panel with a LINSN Receiving Card L202 RV916 LED Control Card do you have a short tutorial to send the display from the raspberry pi to the screen using that receiver or similar?

Hi @rijotech ! I'm glad you are doing better!

Unfortunately, no. Those devices typically are best paired with their windows-based driver boards: https://www.ledcontrollercard.com/english/linsn-ts802d-led-panel-sender-card.html

Ok I understand.

@jaygarcia fyi

There is logic out there for sending data to ColorLight 5A-75B. This is really easy since you can capture the packets from LEDVision without the purchase of a sender card. Since the ColorLight 5A-75B uses standard packets you can generate Linux logic which runs on the Pi to replace the sender card. If you clean up the interface you make it portable for pretty much any graphics library.

I have seen logic for ColorLight I am not familiar with RV916. Again check the vendor of the card to see if they have an application which uses the application as a sender card. Then you can study the packets to reproduce frames on Linux. Otherwise you have to buy a sender card and those are not very cheap. Again this assumes they use standard ethernet frames or some other standard L2 frame.

Hint these cards usually have support for some unsupported PWM/MM drivers. (So even if Pi library does not support it, you can still use them.) In the case of ColorLight the L2 frames do not care and I believe work exactly the same. However you may have to use a different firmware. ColorLight has decent support list.