{"id":19535093,"url":"https://github.com/sndnvaps/ups_monitor-go","last_synced_at":"2026-04-16T17:04:41.209Z","repository":{"id":148834920,"uuid":"513870243","full_name":"sndnvaps/ups_monitor-go","owner":"sndnvaps","description":"cmd shell ups monitor by Raspberry Pi I2C interface (https://www.waveshare.net/wiki/UPS_HAT)","archived":false,"fork":false,"pushed_at":"2022-08-10T15:29:08.000Z","size":21,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-08T17:53:01.886Z","etag":null,"topics":["golang","ina219","raspberry-pi","ups"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sndnvaps.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,"publiccode":null,"codemeta":null}},"created_at":"2022-07-14T11:15:08.000Z","updated_at":"2022-07-14T11:36:47.000Z","dependencies_parsed_at":null,"dependency_job_id":"f614bafa-8e2b-47ef-a782-c244a548388c","html_url":"https://github.com/sndnvaps/ups_monitor-go","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sndnvaps%2Fups_monitor-go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sndnvaps%2Fups_monitor-go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sndnvaps%2Fups_monitor-go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sndnvaps%2Fups_monitor-go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sndnvaps","download_url":"https://codeload.github.com/sndnvaps/ups_monitor-go/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240788772,"owners_count":19857699,"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":["golang","ina219","raspberry-pi","ups"],"created_at":"2024-11-11T02:17:05.642Z","updated_at":"2026-04-16T17:04:41.155Z","avatar_url":"https://github.com/sndnvaps.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ups monitor\n ups status monitor for Raspberry Pi Openwrt\n \n# 图片\n\n![UPS-HAT](https://www.waveshare.net/photo/accBoard/UPS-HAT/UPS-HAT-1.jpg)\n\n# connect (openwrt raspbeery pi需要先安装i2c内核驱动的支持)\n    Raspberry Pi I2C interface\n\n# hack （如果获取ups连接到树莓派后，用的是哪个地址）\n```bash\nopkg install  i2c-tools\n\ni2cdetect -y 1\n```\n![ups-hat-i2c-address](https://www.waveshare.net/w/upload/f/f1/UPS_HAT_I2C.png)\n\n默认设置的地址为 0x42(需要修改 [/ina219.go#L44](/ina219.go#L44))\n```go\n\t// create the sensor Opts\n\tsensorOpts := ina219.Opts{\n\t\tAddress:       0x42, // ina219 ic2 address\n\t\tSenseResistor: 100 * physic.MilliOhm,     // 0.1Ohm\n\t\tMaxCurrent:    1000 * physic.MilliAmpere, //1A\n\t}\n```\n\n# depend\n\n\n# how to build\n## Install golang in the host (the host system must by  Linux or Mac)\n\n## just run make to build the ups_monitor\n```bash\nmake\n```\n\n# Install ups_monitor to Raspbery Pi\n192.168.xx.xx is the ip of you RPI\n```bash\nscp ups_monitor root@192.168.xx.xx:/tmp\n```\n\n# Run ups_monitor on Raspberry Pi\nconnect RPI with ssh\n```bash\ncd /tmp\nmv /tmp/ups_monitor /usr/bin/ups_monitor\nups_monitor\n```\n# wiki\n## ups-hat介绍文档\nhttps://www.waveshare.net/wiki/UPS_HAT\n\n## Raspberry Pi OpenWRT打开 I2C支持 \nhttps://www.icode9.com/content-4-1367375.html\n    \n# python support from waveshare\nhttps://www.waveshare.net/w/upload/d/d9/UPS_HAT.7z\n\n\n# 声明\n 此代码，目前只测试于 \u003cstrong\u003e微雪的UPS_HAT\u003c/strong\u003e\n\n 编译的时候，需要\u003cstrong\u003ego\u003c/strong\u003e支持\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsndnvaps%2Fups_monitor-go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsndnvaps%2Fups_monitor-go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsndnvaps%2Fups_monitor-go/lists"}