{"id":25830888,"url":"https://github.com/lab5e/pi-psu","last_synced_at":"2025-07-15T15:38:05.556Z","repository":{"id":97096115,"uuid":"420705243","full_name":"lab5e/pi-psu","owner":"lab5e","description":"simple server for resetting power when a Span connected device stops talking","archived":false,"fork":false,"pushed_at":"2022-02-10T17:33:06.000Z","size":21,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-28T22:38:58.952Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","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/lab5e.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":"2021-10-24T14:20:19.000Z","updated_at":"2022-01-21T13:47:42.000Z","dependencies_parsed_at":null,"dependency_job_id":"aed5e3db-ce1f-4331-a002-13aac6f3bbb4","html_url":"https://github.com/lab5e/pi-psu","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/lab5e/pi-psu","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lab5e%2Fpi-psu","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lab5e%2Fpi-psu/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lab5e%2Fpi-psu/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lab5e%2Fpi-psu/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lab5e","download_url":"https://codeload.github.com/lab5e/pi-psu/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lab5e%2Fpi-psu/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265443549,"owners_count":23766410,"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":"2025-02-28T19:34:33.476Z","updated_at":"2025-07-15T15:38:05.536Z","avatar_url":"https://github.com/lab5e.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pi-psu\n\nThis is just a simple server that listens for messages from a Span device and power cycles the device if it hasn't seen any traffic from the device within some time span.\n\n## Deployment\n\nThis runs on the host `relay` on the local network.  You can inspect the state at \u003chttp://relay:8080/\u003e and trigger a reboot of the connected device at \u003chttp://relay:8080/reset\u003e\n\n## Example\n\nAssuming you have set `PI_PSU_TOKEN` to your SPAN API token, and you are using the board Bjørn made with the relay attached to pin 27, the defaults for the other parameters should do.\n\n```shell\npi-psu --collection 566ecm37cmcahj --device 566ecm37cmcahh\n```\n\n## Command line options\n\n```shell\n$ pi-psu -h\nUsage:\n  pi-psu [OPTIONS]\n\nApplication Options:\n      --addr=                    HTTP interface listen address (default: :8080)\n      --token=                   Span API token [$PI_PSU_TOKEN]\n      --collection=              Span collection id [$PI_PSU_COLLECTION]\n      --device=                  Span device ID [$PI_PSU_DEVICE]\n      --msg-timeout=             time after last message seen from device to when we power cycle (default: 2m)\n      --minimum-reboot-interval= minimum time between reboots (default: 5m)\n      --gpio-pin=                GPIO pin for relay (default: 27)\n      --gpio-hold=               how long we turn off power (default: 3s)\n\nHelp Options:\n  -h, --help                     Show this help message\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flab5e%2Fpi-psu","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flab5e%2Fpi-psu","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flab5e%2Fpi-psu/lists"}