{"id":20995271,"url":"https://github.com/todbot/node-blink1-server","last_synced_at":"2025-05-14T21:31:09.398Z","repository":{"id":45137878,"uuid":"43474362","full_name":"todbot/node-blink1-server","owner":"todbot","description":"HTTP API server in Node for blink(1) devices","archived":false,"fork":false,"pushed_at":"2022-01-05T20:28:27.000Z","size":27,"stargazers_count":14,"open_issues_count":0,"forks_count":7,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-05-08T02:18:26.678Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://github.com/todbot/blink1-server","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/todbot.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}},"created_at":"2015-10-01T02:24:47.000Z","updated_at":"2024-06-13T17:52:43.000Z","dependencies_parsed_at":"2022-09-02T23:10:15.741Z","dependency_job_id":null,"html_url":"https://github.com/todbot/node-blink1-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/todbot%2Fnode-blink1-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/todbot%2Fnode-blink1-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/todbot%2Fnode-blink1-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/todbot%2Fnode-blink1-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/todbot","download_url":"https://codeload.github.com/todbot/node-blink1-server/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254230840,"owners_count":22036252,"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-11-19T07:22:40.646Z","updated_at":"2025-05-14T21:31:04.588Z","avatar_url":"https://github.com/todbot.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# node-blink1-server\nHTTP REST API server in Node for blink(1) devices\n\nSupports plug and unplug of blink(1) while server is running.\n\nUses new `node-hid@0.5.1` so works with Node 4.x.\n\n### Installation\n\nInstall globally and use on the commandline:\n```\nnpm install -g node-blink1-server\nblink1-server 8754   # starts server on port 8754\n```\n\nOr check out and use via npm:\n```\ngit clone https://github.com/todbot/node-blink1-server.git\ncd node-blink1-server\nnpm install\nnpm start 8754\n```\n\n### Supported URIs:\n- `/blink1`  -- status info about connected blink1s, lastColor, etc.\n- `/blink1/fadeToRGB` -- fade blink(1) to a color. query args:\n    - `rgb` -- hex color code (e.g. \"#ff00ff\") [required]\n    - `time` -- fade time in seconds (default: 0.1)\n    - `ledn` -- LED to control (0=both, 1=top, 2=bottom; default: 0)\n- `/blink1/blink` -- blink a color, query args:\n    - `rgb` -- hex color code (e.g. \"`#ff00ff`\") [required]\n    - `time` -- fade \u0026 blink time in seconds (default: 0.1)\n    - `ledn` -- LED to control (0=both, 1=top, 2=bottom; default: 0)\n    - `repeats` -- number of times to blink (default: 3)\n- `/blink1/pattern` -- blink a pattern of colors, query args:\n    - `rgb` -- hex color codes separated by a comma (,) (e.g. \"`#ff00ff`\") [required]\n    - `time` -- time in seconds between colors (default: 0.1)\n    - `repeats` -- number of times to blink pattern (default: 3)\n- `/blink1/on`  -- turn blink(1) on to full-on white (#FFFFFF)\n- `/blink1/red`  -- turn blink(1) red (#FF0000)\n- `/blink1/green`  -- turn blink(1) green (#00FF00)\n- `/blink1/blue`  -- turn blink(1) blue (#000000)\n- `/blink1/yellow`  -- turn blink(1) yellow (#FFFF00)\n- `/blink1/cyan`  -- turn blink(1) cyan (#00FFFF)\n- `/blink1/magenta`  -- turn blink(1) magenta (#FF00FF)\n- `/blink1/off`  -- turn blink(1) off (#000000)\n\n### Examples:\n```\n$ blink1-server 8754 \u0026\n$ curl 'http://localhost:8754/blink1'\n{\n    \"blink1Connected\": true,\n    \"blink1Serials\": [\n        \"AB0026C1\"\n    ],\n    \"lastColor\": \"#FF0000\",\n    \"lastTime\": 1.5,\n    \"lastLedn\": 0,\n    \"lastRepeats\": 0,\n    \"cmd\": \"info\",\n    \"status\": \"success\"\n}\n$ curl 'http://localhost:8754/blink1/fadeToRGB?rgb=%230000ff\u0026time=2.5\u0026ledn=2'\n{\n    \"blink1Connected\": true,\n    \"blink1Serials\": [\n        \"200026C1\"\n    ],\n    \"lastColor\": \"#0000ff\",\n    \"lastTime\": 2.5,\n    \"lastLedn\": 2,\n    \"lastRepeats\": 0,\n    \"cmd\": \"fadeToRGB\",\n    \"status\": \"success\"\n}\n\n$ curl  'http://localhost:8754/blink1/pattern?rgb=%23ff0000,%23ffffff,%230000ff\u0026time=.2\u0026repeats=8'\n{\n    \"blink1Connected\": true,\n    \"blink1Serials\": [\n        \"200026C1\"\n    ],\n    \"time\": 0.2,\n    \"colors\": [\n        \"#ff0000\",\n        \"#ffffff\",\n        \"#0000ff\"\n    ],\n    \"repeats\": 8,\n    \"cmd\": \"pattern\",\n    \"status\": \"success\"\n}\n```\n\n\n\n### debugging\n```\n% DEBUG=Blink1Service node main.js\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftodbot%2Fnode-blink1-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftodbot%2Fnode-blink1-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftodbot%2Fnode-blink1-server/lists"}