{"id":18147357,"url":"https://github.com/knifa/led-matrix-zmq-server","last_synced_at":"2025-04-23T21:50:40.833Z","repository":{"id":152522334,"uuid":"206343334","full_name":"Knifa/led-matrix-zmq-server","owner":"Knifa","description":"A tool for streaming frames to rpi-rgb-led-matrix over ZeroMQ.","archived":false,"fork":false,"pushed_at":"2024-12-17T23:17:57.000Z","size":83,"stargazers_count":28,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-30T03:51:10.620Z","etag":null,"topics":["docker-image","led-matrix","raspberry-pi","rgb-led-matrix","zeromq","zmq"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Knifa.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-09-04T14:48:35.000Z","updated_at":"2024-12-17T23:18:01.000Z","dependencies_parsed_at":"2024-11-17T02:17:12.377Z","dependency_job_id":"c0c50c2f-2740-4bea-81bb-a24beacd9561","html_url":"https://github.com/Knifa/led-matrix-zmq-server","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Knifa%2Fled-matrix-zmq-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Knifa%2Fled-matrix-zmq-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Knifa%2Fled-matrix-zmq-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Knifa%2Fled-matrix-zmq-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Knifa","download_url":"https://codeload.github.com/Knifa/led-matrix-zmq-server/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250522293,"owners_count":21444510,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker-image","led-matrix","raspberry-pi","rgb-led-matrix","zeromq","zmq"],"created_at":"2024-11-01T22:06:21.102Z","updated_at":"2025-04-23T21:50:40.809Z","avatar_url":"https://github.com/Knifa.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# led-matrix-zmq-server\n\nA tool for interacting with [rpi-rgb-led-matrix](https://github.com/hzeller/rpi-rgb-led-matrix/) over ZeroMQ.\n\n## Building\n\n- Depends on `cppzmq` and friends.\n- Requires a built [rpi-rgb-led-matrix](https://github.com/hzeller/rpi-rgb-led-matrix/). Tell CMake where it is with `-DRPI_RGB_LED_MATRIX_DIR`.\n- Build with `cmake`, e.g.:\n\n  ```shell\n  mkdir build\n  cd build\n  cmake -DRPI_RGB_LED_MATRIX_DIR=/path/to/rpi-rgb-led-matrix ..\n  make\n  ```\n\n## Docker\n\nA [Docker image](https://github.com/Knifa/led-matrix-zmq-server/pkgs/container/led-matrix-zmq-server) is available for `amd64` and `arm64`.\n\nThe server must be run with `--privileged` to allow GPIO access. This binary is only included in the `arm64` image.\n\n```shell\ndocker run \\\n  --privileged \\\n  --rm \\\n  -v /run/lmz:/run/lmz \\\n  ghcr.io/knifa/led-matrix-zmq-server:latest \\\n    led-matrix-zmq-server \\\n    --frame-endpoint ipc:///run/lmz/frame.sock \\\n    --control-endpoint ipc:///run/lmz/control.sock \\\n    --cols 64 \\\n    --rows 64\n    # ...etc\n```\n\n`led-matrix-zmq-control` and `led-matrix-zmq-pipe` are also available in the image.\n\n```shell\ndocker run \\\n  --rm \\\n  -v /var/run/lmz:/run/lmz \\\n  ghcr.io/knifa/led-matrix-zmq-server:latest \\\n    led-matrix-zmq-control \\\n      --control-endpoint ipc:///run/lmz/control.sock \\\n      set-brightness 128\n```\n\n## Usage\n\n### Running the Server\n\nSee `led-matrix-zmq-server --help` for available options. These mostly passthrough to the `rpi-rgb-led-matrix` library.\n\n```shell\nsudo ./led-matrix-zmq-server \\\n  --cols 64 \\\n  --rows 64 \\\n  --chain-length 2\n  # ...etc\n```\n\n#### Endpoints\n\nThe `--xyz-endpoint` options pass directly through to ZeroMQ, so you can use any valid transport string. For example, you could specify `tcp://0.0.0.0:42069` to listen on the network.\n\n### Sending Frames\n\nThe server is a simple ZMQ REQ-REP loop. All you need to do is send your frame as a big ol' byte chunk then wait for an empty message back. Each frame should be in a RGBA32 format.\n\n#### Just Pipe It\n\n[led-matrix-zmq-pipe](src/pipe_main.cpp) is both a bit of an example and a handy tool. It reads raw RGBA32 frames from stdin and sends them to the server.\n\n```shell\n# Use ffmpeg to convert a video to raw data.\nffmpeg -re -i input.mp4 -vf scale=128:64 -f rawvideo -pix_fmt rgba - \\\n  | sudo ./led-matrix-zmq-pipe -w 128 -h 64\n\n# Use imagemagick to resize and convert an image to raw data.\nconvert input.png -resize 128x64^ rgba:- \\\n  | sudo ./led-matrix-zmq-pipe -w 128 -h 64\n\n# Play a YouTube video.\nyt-dlp -f \"bv*[height\u003c=480]\" \"https://www.youtube.com/watch?v=FtutLA63Cp8\" -o - \\\n  | ffmpeg -re -i pipe: -vf scale=128:64 -f rawvideo -pix_fmt rgba - \\\n  | sudo ./led-matrix-zmq-pipe -w 128 -h 64\n```\n\n### Control Messages\n\nBrightness, color temperature, etc. can be get/set through another simple REQ-REP loop.\n\nSee `led-matrix-zmq-control --help` for available options, or see [the source](src/control_main.cpp) to dig deeper.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fknifa%2Fled-matrix-zmq-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fknifa%2Fled-matrix-zmq-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fknifa%2Fled-matrix-zmq-server/lists"}