{"id":37190720,"url":"https://github.com/xanecs/lighthouse","last_synced_at":"2026-01-14T22:01:51.985Z","repository":{"id":57524128,"uuid":"85347333","full_name":"xanecs/lighthouse","owner":"xanecs","description":"Control Arduinos via Redis Pub/Sub","archived":false,"fork":false,"pushed_at":"2017-03-23T01:51:19.000Z","size":30,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-11-15T06:08:41.201Z","etag":null,"topics":["arduino","firmata","iot","light","redis"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xanecs.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":"2017-03-17T19:22:08.000Z","updated_at":"2019-01-28T15:56:53.000Z","dependencies_parsed_at":"2022-09-15T18:30:22.562Z","dependency_job_id":null,"html_url":"https://github.com/xanecs/lighthouse","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/xanecs/lighthouse","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xanecs%2Flighthouse","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xanecs%2Flighthouse/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xanecs%2Flighthouse/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xanecs%2Flighthouse/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xanecs","download_url":"https://codeload.github.com/xanecs/lighthouse/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xanecs%2Flighthouse/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28436268,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T21:32:52.117Z","status":"ssl_error","status_checked_at":"2026-01-14T21:32:33.442Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["arduino","firmata","iot","light","redis"],"created_at":"2026-01-14T22:01:50.894Z","updated_at":"2026-01-14T22:01:51.952Z","avatar_url":"https://github.com/xanecs.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# LightHouse\n\nControl lights and other devices connected to multiple Arduinos with [Redis](https://redis.io) Pub/Sub messaging.\n\n![Build Status](https://travis-ci.org/xanecs/lighthouse.svg?branch=master)\n\n## Installing / Getting started\n__Prerequisites__\n- A running Redis server\n- One or more Arduinos flashed with the _firmata_ sketch.\n\n__Installation__\n1. Download a binary for your system from the [releases](https://github.com/xanecs/lighthouse/releases/latest) page.\n2. Create a `config.toml` and place it next to the binary (See [configuration](#configuration)).\n3. Start the binary\n\n```bash\ncd lighthouse\nwget https://.../lighthouse\nnano config.toml\n./lighthouse\n```\n\n Lighthouse should now be connecting to the specified Redis server and await commands on the configured channel.\n\n## Configuration\nLightHouse is configured with the `config.toml` file. The service expects this file to be in the _current working directory_.\n\nA minimal `config.toml` might look like this:\n```toml\n[redis]\nhost = \"127.0.0.1:6379\"\ntopic = \"lighthouse\"\n\n[boards]\n  [boards.first]\n  serial = \"/dev/ttyUSB0\"\n    [boards.first.dev]\n      [boards.first.dev.led]\n      mode = \"direct\"\n      inverted = false\n      pinse = [\"13\"]\n```\n\nThis tells LightHouse to connect to the redis server running on `127.0.0.1:6379` and subscribe to the channel `lighthouse`.\nIt configures one Arduino connected to `/dev/ttyUSB0` and exposes the internal LED on pin 13.\n\n#### [redis]\nThe `[redis]` section is pretty self-explainatory. Specify IP and Port in the `host` field and the Pub/Sub channel in the `topic` field.\n\n#### [boards]\nThe `[boards]` section is the list of Arduinos to connect to. \n\n#### [boards.name]\nEach Arduino has a `serial` field, specifying the serial port and a `dev` array.\n\n#### [boards.name.dev.name]\nGive each device a __unique name across all boards!__ You will later address a device using this name.\n\n__mode__  \nwhat kind of device (for example `\"direct\"`, `\"pwm\"` or `\"servo\"`, see [modes](#modes)).\n\n__inverted__  \nsome modes have an inverted mode. If you have an LED connected to `+5V` and Arduino pin `2`, you would need to set `inverted` to `true`.\n\n__pins__  \narray of pins to use for this mode. some modes require multiple pins (e.g the `rgb` mode requires a red, green and a blue pin.)  \nSome modes will also perform actions on all pins if you specify more than one.\n\n## Commands\n\nCommands are received through Redis Pub/Sub. To send a command you publish a JSON string to the configured channel:\n\n```redis\n$ redis-cli\nredis\u003e PUBLISH lighthouse '{\"device\": \"internal\", \"action\": \"on\", \"params\": {}}'\nredis\u003e PUBLISH lighthouse '{\"device\": \"internal\", \"action\": \"write\", \"params\": {\"power\": false}}'\n```\n\nEach command has the following format\n```json\n{\n  \"device\": \"rgblight\",\n  \"action\": \"color\",\n  \"params\": {\n    \"red\": 255,\n    \"green\": 96,\n    \"blue\": 0\n  }\n}\n```\n\n`device`  \nthe unique device identifier specified in the `config.toml`\n\n`action`  \nwhich action to perform on the device. supported actiosn depend on the driver\n\n`params`  \nparameters for the action\n\n## Modes\n\nCurrently, LightHouse supports the following modes:\n\n| Name   | Description              | Inverted          | Pins        |\n| ------ | ------------------------ | ----------------- | ----------- |\n| direct | switch a pin high or low | `value = !value`  | same on all |\n| pwm    | apply pwm to a pin       | `value = 1-value` | same on all |\n| rgb    | control an rgb-led       | like pwm          | r, g, b     |\n| servo  | control a servo          | does not apply    | same on all |\n\n### Direct\n\n| Action   | Params             |\n| -------- | ------------------ |\n| `on`     | `{}`               |\n| `off`    | `{}`               |\n| `write`  | `{\"power\": bool}`  |\n\n### Pwm\n\n| Action      | Params                                          |\n| ------------| ----------------------------------------------- |\n| `on`        | `{}`                                            |\n| `off`       | `{}`                                            |\n| `power`     | `{\"power\": bool}`                               |\n| `brightness`| `{\"brightness\": float}` (0 to 1)                |\n| `write`     | `{\"power\": bool, \"brightness\": float}` (0 to 1) |\n\n### Rgb\n\n| Action | Params                                                   |\n| -------| -------------------------------------------------------- |\n| `on`   | `{}`                                                     |\n| `off`  | `{}`                                                     |\n| `power`| `{\"power\": bool}`                                        |\n| `color`| `{\"red\": int, \"green\": int, \"blue\": int}` (0 to 255)     |\n| `write`| `{\"power\": bool, \"red\": int, \"green\": int, \"blue\": int}` |\n\n### Servo\n\n| Action | Params                         |\n| -------| -------------------------------|\n| `on`   | `{}`                           |\n| `off`  | `{}`                           |\n| `power`| `{\"power\": bool}`              |\n| `angle`| `{\"angle\": int}` (0 to 180)    |\n| `write`| `{\"power\": bool, \"angle\": int}`|\n\n## Licensing\nThe code in this project is licensed under the 2-Clause BSD license (BSD-2-Clause). See `LICENSE` for further details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxanecs%2Flighthouse","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxanecs%2Flighthouse","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxanecs%2Flighthouse/lists"}