{"id":28673207,"url":"https://github.com/maiswan/backlight","last_synced_at":"2026-01-07T08:07:51.233Z","repository":{"id":296700820,"uuid":"994197681","full_name":"maiswan/backlight","owner":"maiswan","description":"WS2812B Controller on Pi","archived":false,"fork":false,"pushed_at":"2025-06-25T12:29:05.000Z","size":72,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-06-25T13:31:23.995Z","etag":null,"topics":["fastapi","led-controller","raspberry-pi","webcontrol","ws2812b"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/maiswan.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,"zenodo":null}},"created_at":"2025-06-01T12:36:48.000Z","updated_at":"2025-06-25T12:29:09.000Z","dependencies_parsed_at":"2025-06-01T21:37:19.221Z","dependency_job_id":"9f8c0d27-db10-4472-be1f-6a7f4cd7cc64","html_url":"https://github.com/maiswan/backlight","commit_stats":null,"previous_names":["maiswan/backlight"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/maiswan/backlight","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maiswan%2Fbacklight","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maiswan%2Fbacklight/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maiswan%2Fbacklight/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maiswan%2Fbacklight/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/maiswan","download_url":"https://codeload.github.com/maiswan/backlight/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maiswan%2Fbacklight/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266455301,"owners_count":23931359,"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","status":"online","status_checked_at":"2025-07-22T02:00:09.085Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["fastapi","led-controller","raspberry-pi","webcontrol","ws2812b"],"created_at":"2025-06-13T20:08:54.778Z","updated_at":"2026-01-07T08:07:51.228Z","avatar_url":"https://github.com/maiswan.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"## backlight\n\nbacklight is a FastAPI-based LED controller for WS281x strips (WS2812B, SK6812, ...) for Raspberry Pi. backlight works on Raspberry Pi 4 and 5, but likely has some degree of backward compatibility.\n\n## Features\n\n* Multiple built-in commands (colors, brightness, gamma correction, animations...)\n* Individual LED addressable\n* Highly configurable from\n    * JSON config file\n    * RESTful API\n* React frontend at [maiswan/backlight-dashboard](https://github.com/maiswan/backlight-dashboard)\n\n## Setup\n### 1. Initialize a Python virtual environment\n```bash\nsudo apt-get install python3-dev # install globally\npython -m venv .venv\nsource .venv/bin/activate\n```\n\n### 2a. Install packages (PWM) (NOT for Pi 5)\n\u003e [!WARNING]\n\u003e If you have a Pi 5, skip directly to step 2b instead.\n\n```bash\npip install -r requirements.txt\n```\n\n### 2b. Install packages (SPI) (For Pi 5)\n\u003e [!WARNING]\n\u003e This section is recommended for the Pi 5 only.\n\n\u003e [!IMPORTANT]\n\u003e With SPI, backlight can only address 168 RGB LEDs (≈ 126 RGBW LEDs) because of the underlying SPI driver. [The issue is tracked here](https://github.com/adafruit/Adafruit_CircuitPython_NeoPixel_SPI/issues/37). \n\n```bash\n# https://gordonlesti.com/light-up-ws2811-leds-with-a-raspberry-pi-5-via-spi/\nsudo raspi-config\n```\nSelect _3 Interface Options_, then _I4 SPI_, then _Yes_.\n\n```bash\n# https://abyz.me.uk/lg/download.html\nsudo apt install swig\nsudo apt install python-setuptools python3-setuptools\nwget http://abyz.me.uk/lg/lg.zip\nunzip lg.zip\ncd lg\nmake\nsudo make install\ncd ..\npip install -r requirements-pi-5.txt\n```\n\nOn a Pi 5, the LED data line must be connected to a SPI pin (e.g., GPIO10). In `config.json`, set `spi_enabled` to `true`.\n\n### 3. Final touches\nModify `config.json` as needed.\n\nRun (`sudo` as needed).\n```bash\nchmod 755 backlight.sh \n./backlight.sh\n```\n\n## Configurations\n\nbacklight will read and use the first available configuration file from `config.dev.json`, `config.prod.json`, and `config.json`. When exiting, backlight saves the latest configurations and LED commands.\n\nbacklight also offers remote control through a HTTP API. The routes are as follows:\n\n| Method | Route | Behavior |\n|--------|-------|----------|\n| `GET` | `/dashboard` | Dashboard and controller \u0026mdash; requires [maiswan/backlight-dashboard](https://github.com/maiswan/backlight-dashboard) |\n| `GET` | `/api/v3/commands` | Get the current commands |\n| `POST` | `/api/v3/commands` | Create a new command |\n| `PUT` | `/api/v3/commands` | Replace all existing commands with the payload |\n| `DELETE` | `/api/v3/commands` | Delete all existing commands |\n| `GET` | `/api/v3/commands/{id_or_name}` | Retrieve an existing command |\n| `PUT` | `/api/v3/commands/{id_or_name}` | Modify an existing command |\n| `DELETE` | `/api/v3/commands/{id_or_name}` | Delete an existing command |\n| `POST` | `/api/v3/commands/redraw` | Restart the render pipeline |\n| `GET` | `/api/v3/config` | Get the current configurations and commands |\n| `GET` | `/api/v3/config/stream` | Get the current configurations and commands via [SSE](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events) |\n\nThere are two endpoints for each of `port`, `led_count`, `pixel_order`, `spi_enabled`, `pwm_pin` and `fps`, `fps_static`.\n\n    GET /api/v3/config/{x}\n    PUT /api/v3/config/{x}\n\nWhen sending a PUT request, encapsulate the value in a JSON object:\n\n```\nPUT /api/v3/config/fps\n```\n```json\n{\n    \"value\": 60\n}\n```\n\nUpdating the `port` value will require restarting backlight.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaiswan%2Fbacklight","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaiswan%2Fbacklight","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaiswan%2Fbacklight/lists"}