{"id":17481173,"url":"https://github.com/paratron/lednet","last_synced_at":"2025-03-28T13:11:16.231Z","repository":{"id":141688059,"uuid":"304973475","full_name":"Paratron/lednet","owner":"Paratron","description":"A UDP based message module for nodeJS for controlling a WS2812 LED strip","archived":false,"fork":false,"pushed_at":"2020-11-08T11:24:59.000Z","size":283,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-19T01:18:36.719Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/Paratron.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-10-17T21:37:11.000Z","updated_at":"2022-11-26T07:21:07.000Z","dependencies_parsed_at":null,"dependency_job_id":"67807679-b0c7-4a47-8553-33bf8a104590","html_url":"https://github.com/Paratron/lednet","commit_stats":{"total_commits":77,"total_committers":1,"mean_commits":77.0,"dds":0.0,"last_synced_commit":"47987fb5503ef2d38b7c0448a08a1d00439cd458"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Paratron%2Flednet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Paratron%2Flednet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Paratron%2Flednet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Paratron%2Flednet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Paratron","download_url":"https://codeload.github.com/Paratron/lednet/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246034297,"owners_count":20712856,"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":[],"created_at":"2024-10-18T22:08:45.591Z","updated_at":"2025-03-28T13:11:16.201Z","avatar_url":"https://github.com/Paratron.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# LED net\n\nThis package allows controlling a WS2812 LED strip over UDP.\n\n## Motivation\n\nI started working on this project, because I am planning an (maybe) unusual setup:\n\nI have - currently - two terrariums where I want to add controlled light for simulating sunrise/sunset scenarios.\nThe plan is to have a Raspberry Pi Zero W in each terrarium that is connected to a LED stripe and several sensors.\n\nI want to have one additional Raspberry Pi 4 that is the \"main server\" and gathers all data, controls the light and\ndoes other tasks. Therefore, I needed to have a slim client on the Zero Ws that only receives commands from my main server.  \n\n## Server / SDK\n\nThe server can be imported in any nodeJS program and used to send commands to your LED strip or read its state.\n\nInstall it by executing `npm i -s lednet` - it can be used immediately.\n\nThis is an example that tries to discover a client on the network, and send color tweens in a two second interval:\n\n```javascript\nconst led = require(\"lednet\")();\n\n(async function () {\n    const clients = await led.discoverClients();\n\n    console.log(`Found client at ${clients[0].address}`);\n\n    const client = clients[0];\n\n    client.configure({leds: 144, type: \"grb\"});\n\n    setInterval(() =\u003e {\n        client.tweenToColor(Math.random() * 255, Math.random() * 255, Math.random() * 255);\n    }, 2000);\n})();\n```\n\n## Client\n\nThe client runs on a raspberry pi with a connected WS2812 LED strip. It will process command messages\nsent via UDP from a client in the same network and apply the commands on the LED strip.\n\nFor testing and/or debugging purposes, the client can also be started without a LED strip connected, or even\nwithout running it on a raspberry. The hardware simulator will open in your browser and show live updates.\n\n![Screenshot of the hardware simulator](./screenshot.png)\n\n### Running the client simulator locally\n\nCheck out the project code to your harddrive. Run `npm i` in the project root. All sub dependencies for the client and\nclient UI will be installed as well.\n\n\u003e __Don't be afraid if the install fails!__    \n\u003e This will most likely happen, because the npm module that is used to actually control the hardware on the raspberry pi\n\u003e will only install correctly on a raspberry pi.\n\nTo start the client simulator, execute `npm run clientSimulator`. You should see the messages \"Using Browser Test Connector\"\n and \"LED net client started\".\n \nTo actually see something, you need to start the UI in a separate shell with `npm run clientUI`. The UI should open in your\nbrowser automatically.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparatron%2Flednet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fparatron%2Flednet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparatron%2Flednet/lists"}