{"id":22860025,"url":"https://github.com/reelyactive/neopixel-serial-api","last_synced_at":"2025-07-04T07:36:19.527Z","repository":{"id":232811586,"uuid":"655869457","full_name":"reelyactive/neopixel-serial-api","owner":"reelyactive","description":"REST API to control NeoPixel strips via a serial link to a microcontroller.  We believe in an open Internet of Things.","archived":false,"fork":false,"pushed_at":"2023-06-20T18:49:09.000Z","size":13,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-06-03T22:05:26.381Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/reelyactive.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}},"created_at":"2023-06-19T19:26:46.000Z","updated_at":"2023-06-20T00:28:58.000Z","dependencies_parsed_at":"2024-04-11T16:29:45.759Z","dependency_job_id":null,"html_url":"https://github.com/reelyactive/neopixel-serial-api","commit_stats":null,"previous_names":["reelyactive/neopixel-serial-api"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/reelyactive/neopixel-serial-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reelyactive%2Fneopixel-serial-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reelyactive%2Fneopixel-serial-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reelyactive%2Fneopixel-serial-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reelyactive%2Fneopixel-serial-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/reelyactive","download_url":"https://codeload.github.com/reelyactive/neopixel-serial-api/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reelyactive%2Fneopixel-serial-api/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263469984,"owners_count":23471648,"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-12-13T09:08:47.012Z","updated_at":"2025-07-04T07:36:19.503Z","avatar_url":"https://github.com/reelyactive.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"neopixel-serial-api\n===================\n\nREST API to control NeoPixel strips via a serial link to a microcontroller.\n\n\nQuick Start\n-----------\n\nClone this repository, install package dependencies with `npm install`, and then from the root folder run at any time:\n\n    npm start\n\n__neopixel-serial-api__ will attempt to connect with a microcontroller at 9600 baud on a serial/USB link, and accept requests to configure via API any LED strips connected to that microcontroller.\n\n\nMicrocontrollers\n----------------\n\nThe following microcontrollers are supported, with code provided:\n\n| Microcontroller (and shield)   | Code (in /microcontrollers folder) |\n|:-------------------------------|:-----------------------------------|\n| Arduino Nano with Grove shield | arduino-nano.ino                   |\n\n\nREST API\n--------\n\n__neopixel-serial-api__'s REST API includes the following base route:\n- /strips _for the configuration of a given LED strip_\n\n### PUT /strips/{id}\n\nUpdate the configuration of the strip with the given _id_.\n\n#### Example request\n\n| Method | Route     | Content-Type     |\n|:-------|:----------|:-----------------|\n| PUT    | /strips/0 | application/json |\n\n    [\n      { \"offset\": 0, \"rgb\": \"0770a2\" },\n      { \"offset\": 1, \"rgb\": [ 7, 112, 162 ] }\n    ]\n\n#### Example response\n\n    {\n      \"_meta\": {\n        \"message\": \"ok\",\n        \"statusCode\": 200\n      },\n      \"_links\": {\n        \"self\": {\n          \"href\": \"http://localhost:3001/strips/0/\"\n        }\n      }\n    }\n\n\n### PUT /strips/{id}/{offset}\n\nUpdate the configuration of the LED with the given _offset_ in the strip with the given _id_.\n\n#### Example request\n\n| Method | Route       | Content-Type     |\n|:-------|:------------|:-----------------|\n| PUT    | /strips/0/0 | application/json |\n\n    {\n      \"rgb\": \"0770a2\"\n    }\n\n#### Example response\n\n    {\n      \"_meta\": {\n        \"message\": \"ok\",\n        \"statusCode\": 200\n      },\n      \"_links\": {\n        \"self\": {\n          \"href\": \"http://localhost:3001/strips/0/0/\"\n        }\n      }\n    }\n\n\nSerial Protocol\n---------------\n\n__neopixel-serial-api__ translates API requests into serial messages, according to the following protocol, which can easily be interpreted by resource-constrained microcontrollers and transformed into neopixel commands using existing libraries.\n\nEach serial message is 6 bytes long, as specified in the following table, and terminated with a newline character ('\\n').\n\n| Byte offset | Description                                       |\n|:------------|:--------------------------------------------------|\n| 0           | Strip id (0 to 127) or special command (128-255)  |\n| 1           | MSB of LED offset or strip id for special command |\n| 2           | LSB of LED offset                                 |\n| 3           | Red intensity (0 to 255)                          |\n| 4           | Green intensity (0 to 255)                        |\n| 5           | Blue intensity (0 to 255)                         |\n\nThe following special commands are supported:\n- 0xaa: _display the current configuration_\n- 0xff: _clear the current configuration_\n\nFor example, to clear strip 1 and make the first three LEDs red, green and blue, respectively, the serial message sequence, as hexadecimal strings, would be as follows:\n\n    ff01000000000a\n    000000ff00000a\n    00000100ff000a\n    0000020000ff0a\n    aa01000000000a\n\nThe seventh byte in each message above is the newline character (0x0a).\n\n\nLicense\n-------\n\nMIT License\n\nCopyright (c) 2023 [reelyActive](https://www.reelyactive.com)\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR \nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, \nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE \nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER \nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, \nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN \nTHE SOFTWARE.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freelyactive%2Fneopixel-serial-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Freelyactive%2Fneopixel-serial-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freelyactive%2Fneopixel-serial-api/lists"}