{"id":17302984,"url":"https://github.com/binarybrain/rpi-sk6812-ws2812b-rgbw-http-server","last_synced_at":"2025-10-13T12:21:29.564Z","repository":{"id":40659080,"uuid":"204339919","full_name":"BinaryBrain/Rpi-SK6812-ws2812b-RGBW-http-server","owner":"BinaryBrain","description":"An Express HTTP Server to Drive SK6812/ws2812b RGBW LED Strips on Raspberry Pi","archived":false,"fork":false,"pushed_at":"2023-10-30T11:39:41.000Z","size":2434,"stargazers_count":3,"open_issues_count":2,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-28T02:12:37.078Z","etag":null,"topics":["express","hacktoberfest","rasberry-pi","rgb","rgbw","sk6812","udp","ws2812b"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/BinaryBrain.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-08-25T19:24:30.000Z","updated_at":"2024-02-22T19:06:13.000Z","dependencies_parsed_at":"2023-01-26T14:16:30.497Z","dependency_job_id":null,"html_url":"https://github.com/BinaryBrain/Rpi-SK6812-ws2812b-RGBW-http-server","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BinaryBrain%2FRpi-SK6812-ws2812b-RGBW-http-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BinaryBrain%2FRpi-SK6812-ws2812b-RGBW-http-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BinaryBrain%2FRpi-SK6812-ws2812b-RGBW-http-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BinaryBrain%2FRpi-SK6812-ws2812b-RGBW-http-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BinaryBrain","download_url":"https://codeload.github.com/BinaryBrain/Rpi-SK6812-ws2812b-RGBW-http-server/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248886317,"owners_count":21177643,"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":["express","hacktoberfest","rasberry-pi","rgb","rgbw","sk6812","udp","ws2812b"],"created_at":"2024-10-15T11:49:14.148Z","updated_at":"2025-10-13T12:21:24.534Z","avatar_url":"https://github.com/BinaryBrain.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Rpi-SK6812-ws2812b-RGBW-http-server\n\nThis is an express server that exposes an API to drive SK6812/ws2812b RGBW LED strips on a Raspberry Pi\n\n## Hardware Install\n\n1. Plug the +5V and GND in an external power supply.\n\n2. Plug the DATA and GND in your Raspberry Pi.\n\n3. The default data pin is GPIO18 (which is #12 on the circuit board). You can change it in the `.env` file.\n\n## Software Install\n\nYou'll need some dependencies for this. On Debian, Ubuntu, etc. you can install them with\n```\nsudo apt install build-essential python3\n```\n\nThen, just run the server with:\n\n```sh\ncp .env.dist .env # Copy and edit environment variables\nnpm install\nsudo npm start\n```\n\n### Supported LED_TYPE\n\n```js\n// 4 color R, G, B and W ordering\n\"sk6812-rgbw\"\n\"sk6812-rbgw\"\n\"sk6812-grbw\"\n\"sk6812-gbrw\"\n\"sk6812-brgw\"\n\"sk6812-bgrw\"\n\n// 3 color R, G and B ordering\n\"ws2811-rgb\"\n\"ws2811-rbg\"\n\"ws2811-grb\"\n\"ws2811-gbr\"\n\"ws2811-brg\"\n\"ws2811-bgr\"\n\n// predefined fixed LED types\n\"ws2812\"\n\"sk6812\"\n\"sk6812w\"\n```\n\n## API\n\n### HTTP\n\nDo an HTTP POST with this JSON body:\n\n```json\n{\n    \"colors\": [\n        { \"r\": 255, \"g\": 255, \"b\": 255, \"w\": 255 },\n        { \"r\": 255, \"g\": 0, \"b\": 0, \"w\": 0 },\n        { \"r\": 0, \"g\": 255, \"b\": 0 },\n        { \"r\": 0, \"g\": 0, \"b\": 255 },\n        { \"r\": 0, \"g\": 0, \"b\": 0, \"w\": 255 }\n    ]\n}\n```\n\nOr this JSON body (`WWRRGGBB` or `RRGGBB`):\n\n```json\n{\n    \"colors\": [\n        \"FF995522\",\n        \"FF9955\",\n        \"FF995500\",\n    ]\n}\n```\n\n_Note that the \"white\" value is optionnal. It will default to 0._\n_With as many element in the array as your LED strip is. Usually 30, **60** or 120 LED/m._\n\n### UDP\n\nThe UDP server runs on port `13334` by default.\n\nFirst byte is header: 0x03 for RGB, 0x04 for RGBW. Rest is payload, each byte is a color value.\n\nFor instance:\n\n```\nHead R    G    B    R    G    B   \n0x03 0xFF 0x99 0x55 0xFF 0x99 0x55\n```\n\n```\nHead W    R    G    B    W    R    G    B   \n0x04 0x22 0xFF 0x99 0x55 0x22 0xFF 0x99 0x55\n```\n\nYou can also send a JSON on UDP.\nIf the first character is a curly bracket (`{`) it will behave like the HTTP API.\n\n```json\n{\"colors\": [\"9955CC\", \"FF9955CC\"]}\n```\n\n## curl Example\n\n```sh\ncurl -X POST \\\n  http://\u003craspberry-ip-address\u003e:13334 \\\n  -H 'Content-Type: application/json' \\\n  -d '{ \"colors\": [{\"r\": 255, \"g\": 255, \"b\": 255, \"w\": 255}]}'\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbinarybrain%2Frpi-sk6812-ws2812b-rgbw-http-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbinarybrain%2Frpi-sk6812-ws2812b-rgbw-http-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbinarybrain%2Frpi-sk6812-ws2812b-rgbw-http-server/lists"}