{"id":850,"date":"2019-02-25T15:36:21","date_gmt":"2019-02-25T06:36:21","guid":{"rendered":"http:\/\/sunao-mita.pgw.jp\/blog\/?p=850"},"modified":"2019-02-25T15:36:21","modified_gmt":"2019-02-25T06:36:21","slug":"%e3%83%a9%e3%82%ba%e3%83%91%e3%82%a4%e3%81%abups%e6%a9%9f%e8%83%bd%e3%82%92%e7%b5%84%e8%be%bc%e3%82%80-2","status":"publish","type":"post","link":"http:\/\/sunao-mita.pgw.jp\/blog\/?p=850","title":{"rendered":"\u30e9\u30ba\u30d1\u30a4\u306bUPS\u6a5f\u80fd\u3092\u7d44\u8fbc\u3080"},"content":{"rendered":"\n<h3 class=\"wp-block-heading\">\u76ee\u6307\u3059\u3082\u306e\u306f<\/h3>\n\n\n<p><strong>\u30e9\u30ba\u30d1\u30a41B+<\/strong>\u3092<em>\u30cd\u30c3\u30c8\u30ef\u30fc\u30af<strong>\u5171\u6709\u30b5\u30fc\u30d0\u30fc<\/strong><\/em>\u3068\u3057\u3066\u3001\u30d0\u30c3\u30c6\u30ea\u30fc\u30d0\u30c3\u30af\u30a2\u30c3\u30d7\u3092\u884c\u3044\u306a\u304c\u3089<strong>\u5e38\u6642\u8d77\u52d5<\/strong>\u3057\u3066\u304a\u304f\u3053\u3068\u3092\u8003\u3048\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n<h4 class=\"wp-block-heading\">\u5229\u7528\u3059\u308b\u90e8\u6750\u306f<\/h4>\n\n\n<p>\u30a2\u30de\u30be\u30f3\u3067\u8cfc\u5165\u306e\u624b\u4f5c\u308aUPS\u306f\u30012,499\u5186\u3067\u8cfc\u5165\u3057\u307e\u3057\u305f\u3002\u6700\u8fd1\u51fa\u8377\u3055\u308c\u3066\u3044\u308b\u30e2\u30c7\u30eb\u306e<strong>\u30e9\u30ba\u30d1\u30a4<\/strong>\u306e\u30dc\u30fc\u30c9\u672c\u4f53\u3092\u56fa\u5b9a\u3059\u308b\u7a74\u4f4d\u7f6e\u3068\u91cd\u306a\u308b\u540c\u3058\u7a74\u4f4d\u7f6e\u5f62\u72b6\u306e\u5236\u5fa1\u30dc\u30fc\u30c9\u3067\u3059\u3002<strong>\u30e9\u30ba\u30d1\u30a4<\/strong>\u3068\u306e\u63a5\u7d9a\u306f\u3001<strong>IO\u306e 40\u30d4\u30f3\u30b3\u30cd\u30af\u30bf<\/strong>\u306b\u305d\u306e\u307e\u307e\u91cd\u306a\u308b HAT \u3068\u547c\u3070\u308c\u308b\u4e00\u9023\u306e\u88fd\u54c1\u7fa4\u3067\u3001\u677f\u72b6\u306e\u30d0\u30c3\u30c6\u30ea\u30fc\u304c\u4ed8\u5c5e\u3057\u3066\u3044\u3066\u4fe1\u3058\u3089\u308c\u306a\u3044\u304f\u3089\u3044\u5b89\u3044\u3068\u611f\u3058\u307e\u3059\u3002<\/p>\n\n\n<p>\u3057\u304b\u3057\u3001\u4e00\u822c\u7684\u306a\u56fd\u5185\u30e1\u30fc\u30ab\u30fc\u304c\u8ca9\u58f2\u3059\u308b\u3088\u3046\u306a\u5b8c\u6210\u3055\u308c\u305f\u30d1\u30c3\u30b1\u30fc\u30b8\u54c1\u3068\u306f\u5927\u304d\u304f\u7570\u306a\u308a\u3001\u4ed8\u5c5e\u8cc7\u6599\u306f\u5168\u304f\u7121\u304f\u3066\u9069\u5f53\u306a\u30ad\u30fc\u30ef\u30fc\u30c9(\u4f8b\u3048\u3070 <strong>UPS HAT<\/strong>) \u3092\u5143\u306b\u30cd\u30c3\u30c8\u3067\u691c\u7d22\u3059\u308b\u3068\u3001\u305d\u308c\u3089\u3057\u3044\u60c5\u5831\u304c\u898b\u3064\u304b\u308a\u8272\u3005\u3068\u63d0\u4f9b\u3055\u308c\u3066\u3044\u308b\u30b5\u30f3\u30d7\u30eb\u985e\u306f\u3001\u81ea\u5206\u306e\u8cac\u4efb\u3067\u78ba\u8a8d\u3057\u3066\u30d0\u30b0\u53d6\u308a\u3084\u6027\u683c\u306b\u5408\u308f\u305b\u305f\u30ab\u30b9\u30bf\u30de\u30a4\u30ba\u4f5c\u696d\u304c\u5fc5\u8981\u3067\u3059\u3002<\/p>\n\n\n<h4 class=\"wp-block-heading\">\u5b8c\u6210\u3057\u305f\u30b5\u30fc\u30d0\u30fc\u306e\u30a4\u30e1\u30fc\u30b8\u306f<\/h4>\n\n\n<p><span style=\"color: #0000ff;\">\u4eca\u56de\u306e\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u5171\u6709\u30b5\u30fc\u30d0\u30fc\u30b7\u30b9\u30c6\u30e0\u306f\u30012TB\u306e2.5\u30a4\u30f3\u30c1HDD\u3068\u7d44\u5408\u305b\u3066\u3001100\u5747\u306e\u30b1\u30fc\u30b9\u306b\u7d44\u3093\u3067\u52d5\u4f5c\u3055\u305b\u3066\u3044\u307e\u3059\u3002\u30b1\u30fc\u30b9\u304b\u3089\u306f\u3001AC100V\u304b\u3089DC5V-2.4A\u306b\u5909\u63db\u3057\u305f Micro USB \u306e\u30b1\u30fc\u30d6\u30eb\u3001\u30a4\u30fc\u30b5\u30cd\u30c3\u30c8\u306e RJ-45 \u306e\u30b1\u30fc\u30d6\u30eb\u306e\uff12\u672c\u3060\u3051\u304c\u51fa\u3066\u3044\u307e\u3059\u3002<\/span><\/p>\n\n\n<h4 class=\"wp-block-heading\">\u30d0\u30c3\u30c6\u30ea\u30fc\u76e3\u8996\u7528\u306e\u30b5\u30fc\u30d3\u30b9\u30bd\u30d5\u30c8<\/h4>\n\n\n<p>\u4ee5\u524d\u3001\u666e\u6bb5\u4f7f\u3044\u306e\u30ce\u30fc\u30c8PC\u306eLinux(Ubuntu)\u7acb\u4e0a\u3052\u5f8c\u306b\u3001\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u5171\u6709\u30b5\u30fc\u30d0\u30fc\u4e0a\u306b\u81ea\u52d5\u7684\u306b\u3001Windows\u30d5\u30a1\u30a4\u30eb\u306e\u4e00\u90e8\u3092\u30d0\u30c3\u30af\u30a2\u30c3\u30d7\u3059\u308b<strong>systemd\u306e\u30b5\u30fc\u30d3\u30b9<\/strong>\u3092\u8ffd\u52a0\u3057\u305f\u3053\u3068\u304c\u3042\u308a\u3001\u540c\u69d8\u306b<strong>\u5e38\u6642\u8d77\u52d5\u306e\u30e9\u30ba\u30d1\u30a41B+<\/strong>\u306b<strong>\u30d0\u30c3\u30c6\u30ea\u30fc\u76e3\u8996\u306e\u30b5\u30fc\u30d3\u30b9<\/strong>\u3092\u8d77\u52d5\u3057\u3088\u3046\u3068\u8003\u3048\u307e\u3057\u305f\u3002<\/p>\n\n\n<h3 class=\"wp-block-heading\"><strong>\u4eca\u56de\u306e\u4f5c\u696d\u80cc\u666f<\/strong><\/h3>\n\n\n<p>\u4f55\u3068\u306a\u304f\u30cd\u30c3\u30c8\u3067\u898b\u4ed8\u3051\u3001\u534a\u4fe1\u534a\u7591\u306e\u601d\u3044\u3064\u304d\u3067\u8cfc\u5165\u3057\u305f\u5b89\u4fa1\u306a\u88fd\u54c1\u3067\u3001<strong>\u30e9\u30ba\u30d1\u30a4\u306b\u88c5\u7740<\/strong>\u3067\u304d\u308b<strong>\u5236\u5fa1\u30dc\u30fc\u30c9<\/strong>\u3068<strong>\u30d0\u30c3\u30c6\u30ea\u30fc<\/strong>\u306e\u30bb\u30c3\u30c8\u3067\u3059\u3002\u4ed8\u5c5e\u306e\u8aac\u660e\u66f8\u985e\u306f\u4e00\u5207\u7121\u3044\u3082\u306e\u3067\u3001\u4f7f\u3046\u306b\u306f\u3069\u306e\u3088\u3046\u306b\u3059\u308b\u306e\u304b\u3082\u542b\u3081\u3066\u3001\u982d\u3092\u30d5\u30eb\u56de\u8ee2\u3057\u3066\u60c5\u5831\u53ce\u96c6\u304b\u3089\u59cb\u3081\u307e\u3057\u305f\u3002<\/p>\n\n\n<p><a href=\"http:\/\/www.raspberrypiwiki.com\/index.php\/Raspi_UPS_HAT_Board\"><span style=\"color: #333399;\">Raspi UPS HAT Board \u3068\u547c\u3070\u308c\u3066\u3044\u308b\u3088\u3046\u3067\u3001\u8cc7\u6599\u304c\u516c\u958b\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/span><\/a><\/p>\n\n\n<p>\u3053\u306e\u516c\u958b\u8cc7\u6599\u3067\u306f\u8272\u3005\u3068\u8aac\u660e\u3055\u308c\u3066\u3044\u3066\u3001\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u3082\u591a\u6570\u63d0\u793a\u3055\u308c\u3066\u3044\u308b\u306e\u3067\u3059\u304c\u3001\u4f55\u304b\u8a70\u304c\u7518\u304f\u3066\u52d5\u4f5c\u3092\u691c\u8a3c\u3057\u3066\u3082\u671f\u5f85\u3057\u305f\u3088\u3046\u306a\u7d50\u679c\u304c\u51fa\u307e\u305b\u3093\u3002\u516c\u958b\u3055\u308c\u3066\u3044\u308b\u30b5\u30f3\u30d7\u30eb\u306e\u307e\u307e\u3067\u671f\u5f85\u3057\u305f\u7d50\u679c\u3060\u3063\u305f\u30e2\u30b8\u30e5\u30fc\u30eb\u306f\u3001C\u8a00\u8a9e\u3067\u8a18\u8ff0\u3055\u308c\u305f File:<strong>Ups-hat-c.zip<\/strong> \u3060\u3051\u3067\u3057\u305f\u3002\u3053\u308c\u306f\u30e2\u30b8\u30e5\u30fc\u30eb\u3068\u3057\u3066\u89e3\u8aac\u306e\u624b\u9806\u3067\u30b3\u30f3\u30d1\u30a4\u30eb\u3059\u308b\u3068\u3001<strong>ups-read<\/strong> \u304c\u4f5c\u6210\u3055\u308c\u307e\u3059\u3002<\/p>\n\n\n<p style=\"font-size:0\">\u3053\u306e ups-read \u306e\u5229\u7528\u65b9\u6cd5\u3068\u3057\u3066\u306f\u3001\u5f15\u6570\u3092 [\u4ed8\u3051\u308b\/\u4ed8\u3051\u306a\u3044] \u306b\u3088\u308a\u5c11\u3057\u7570\u306a\u308a\u307e\u3059\u304c\u3001\u30d0\u30c3\u30c6\u30ea\u30fc\u96fb\u5727\u3068\u30d0\u30c3\u30c6\u30ea\u30fc\u5bb9\u91cf\u304c\u53d6\u5f97\u3067\u304d\u307e\u3059\u3002\u305f\u3060\u4fe1\u7528\u3067\u304d\u306a\u3044\u5024\u304c\u6e21\u3055\u308c\u308b\u3053\u3068\u304c\u591a\u3044\u306e\u3067\u3059\u304c\u3001\u305d\u3053\u3092\u8003\u616e\u3059\u308c\u3070\u7c21\u5358\u306b bash \u3068\u304b\u4e00\u822c\u7684\u306a\u30b7\u30a7\u30eb\u304b\u3089\u30d0\u30c3\u30c6\u30ea\u30fc\u306e\u60c5\u5831\u3092\u53d6\u5f97\u3067\u304d\u308b\u305f\u3081\u3001\u8272\u3005\u306a\u51e6\u7406\u3092\u81ea\u5206\u3067\u8a18\u8ff0\u3059\u308b\u306e\u304c\u7c21\u5358\u306b\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n<p>\u89e3\u8aac\u306e\u4e2d\u306b\u306f\u3001root\u6a29\u9650\u3067\u5b9f\u884c\u3059\u308b\u305f\u3081\u306b\u30d1\u30b9\u30ef\u30fc\u30c9\u7121\u3057\u306e <strong>sudo<\/strong> \u3092\u51a0\u3057\u3066\u5b9f\u884c\u3059\u308b\u305f\u3081\u306e <strong>\/etc\/sudoers<\/strong> \u306e\u8ffd\u52a0\u8a18\u8ff0\u304c\u3042\u308a\u307e\u3059\u304c\u3001<strong>\u6700\u65b0\u306e raspbian<\/strong> \u3067\u306f\u5358\u7d14\u306b<strong>\u30e6\u30fc\u30b6\u30fc\u6a29\u9650\u306e\u307e\u307e<\/strong>\u3067\u3082\u5b9f\u884c\u3067\u304d\u308b\u3088\u3046\u3067\u3057\u305f\u3002<\/p>\n\n\n<h4 class=\"wp-block-heading\">\u30d0\u30c3\u30c6\u30ea\u30fc\u306e\u5145\u653e\u96fb\u306e\u691c\u8a3c<\/h4>\n\n\n<p><strong>\u5f15\u6570\u7121\u3057<\/strong>\u3067\u306f\u3001\u30d0\u30c3\u30c6\u30ea\u30fc\u5bb9\u91cf\u304c\u30d1\u30fc\u30bb\u30f3\u30c6\u30fc\u30b8\u3067\u8868\u3057\u305f<strong>\u6574\u6570\u5024\u306e\u307f<\/strong>\u3067\u8fd4\u3055\u308c\u307e\u3059\u3002\u3053\u308c\u306f\u30d0\u30c3\u30c6\u30ea\u30fc\u5236\u5fa1\u30dc\u30fc\u30c9\u304b\u3089\u76f4\u63a5\u53d7\u3051\u53d6\u3063\u305f\u60c5\u5831\u3092\u7279\u5b9a\u306e\u95a2\u6570\u3067\u5909\u63db\u3057\u3066\u3044\u308b\u3068\u601d\u308f\u308c\u307e\u3059\u304c\u3001\u3061\u3087\u3063\u3068\u3057\u305f\u843d\u3068\u3057\u7a74\u304c\u3042\u3063\u3066\u3001\u30d1\u30fc\u30bb\u30f3\u30c6\u30fc\u30b8\u304b\u3089\u5224\u65ad\u3057\u3066 0 \u301c 100 \u3068\u601d\u3044\u8fbc\u307f\u307e\u3059\u304c\u30010<strong>\u301c100 \u3067\u306f\u306a\u3044\u5834\u5408<\/strong>\u304c\u3042\u308a\u3001 \u5272\u5408\u3092\u8868\u3059\u6570\u5024\u3068\u3057\u3066\u306f\u3042\u308a\u3048\u306a\u3044<strong> 120<\/strong> \u3068\u304b <strong>112<\/strong> \u3068\u304b\u306b\u306a\u3063\u3066\u3044\u308b\u3053\u3068\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n\n\n<p>\u3055\u3089\u306b\u96d1\u97f3\u306e\u3088\u3046\u306a\u3001\u524d\u5f8c\u306e\u8aad\u307f\u53d6\u308a\u304b\u3089\u306f\u304b\u3051\u96e2\u308c\u305f\u7a81\u767a\u7684\u306a\u6570\u5024\u3001197 \u3068\u304b 213 \u3068\u304b\u3042\u308a\u3048\u306a\u3044\u5024\u304c\u6e21\u3055\u308c\u308b\u3053\u3068\u304c\u3042\u308a\u3001\u305d\u306e\u8fba\u308a\u306e\u5bfe\u7b56\u3082\u5fc5\u8981\u3067\u3059\u3002<\/p>\n\n\n<p><span style=\"color: #0000ff;\">\u306a\u304a\u3001<strong>\u30b5\u30f3\u30d7\u30eb<\/strong>\u306e\u4e2d\u3067\u306e\u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8\u306e\u30ed\u30b8\u30c3\u30af\u3067\u306f\u3001<strong>100%\u306a\u3089<\/strong>\u306e\u3088\u3046\u306a\u8868\u73fe\u3092\u8272\u3005\u306a\u7b87\u6240\u3067\u4f7f\u3063\u3066\u3044\u307e\u3059\u304c\u3001\u5b9f\u969b\u306b\u6e21\u3055\u308c\u308b\u60c5\u5831\u3068\u4e00\u81f4\u3057\u306a\u3044\u305f\u3081<strong>\u671f\u5f85\u3057\u305f\u7d50\u679c\u306b\u306a\u3089\u306a\u3044<\/strong>\u3088\u3046\u3067\u3059\u3002<\/span><\/p>\n\n\n<p>\u5f15\u6570\u306b\u306f\u3001<strong>v<\/strong> \u3068 <strong>c<\/strong> \u304c\u6307\u5b9a\u3067\u304d\u3001\u4e21\u65b9\u6307\u5b9a\u3059\u308c\u3070\u96fb\u5727\u3068\u5bb9\u91cf\u304c\u3001\u5f53\u3066\u306b\u306a\u3089\u306a\u3044\u5c0f\u6570\u70b9\u4ee5\u4e0b\uff16\u6841\u3067\u3001<strong>3.498750V 9.480469%<\/strong> \u306e\u3088\u3046\u306b\u8868\u793a\u3055\u308c\u307e\u3059\u300210\u79d2\u6bce\u306b\u8aad\u307f\u53d6\u3063\u3066\u30ea\u30b9\u30c8\u306b\u3057\u3066\u78ba\u8a8d\u3057\u3066\u307f\u307e\u3057\u305f\u304c\u3001\u96fb\u5727\u306e\u5909\u5316\u3068\u5bb9\u91cf\u306e\u5909\u5316\u306b\u306f\u3042\u308b\u7a0b\u5ea6\u306e\u76f8\u95a2\u95a2\u4fc2\u304c\u3042\u308b\u3088\u3046\u3067\u3059\u3002<\/p>\n\n\n<p>\u5b9f\u969b\u306e\u5236\u5fa1\u30dc\u30fc\u30c9\u306b\u306f\u3001\u30d0\u30c3\u30c6\u30ea\u30fc\u306e\u5145\u96fb\u3084\u653e\u96fb\u306e\u72b6\u6cc1\u3092\u76f4\u63a5\u898b\u3048\u308b LED \u304c\u4ed8\u3051\u3089\u308c\u3066\u3044\u308b\u306e\u3067\u3059\u304c\u3001\u79c1\u304c\u6301\u3064\u500b\u4f53\u3067\u306f\u5b8c\u5168\u5145\u96fb\u3055\u308c\u3066\u3044\u3066\u3082\u305d\u308c\u3092\u8868\u3059\u8868\u793a\u306b\u306a\u308b\u3053\u3068\u304c\u306a\u3044\u3088\u3046\u3067\u3001\u304b\u306a\u308a\u3044\u3044\u52a0\u6e1b\u3067\u3059\u3002\u305d\u306e\u7a0b\u5ea6\u306b\u601d\u3063\u3066\u5229\u7528\u3057\u305f\u65b9\u304c\u826f\u3044\u3088\u3046\u3067\u3059\u3002<\/p>\n\n\n<p>\u3061\u306a\u307f\u306b\u3001\u30d0\u30c3\u30c6\u30ea\u30fc\u5bb9\u91cf\u304c 0.000000% \u3067\u3082\u52d5\u4f5c\u3057\u3066\u3044\u307e\u3059\u304c\u3001\u96fb\u5727\u5024\u304c\u30013.000000V \u3092\u4e0b\u56de\u3063\u305f\u9803\u306b\u3001\u4e00\u6c17\u306b\u96fb\u529b\u4e0d\u8db3\u3067\u30b7\u30b9\u30c6\u30e0\u304c\u7570\u5e38\u505c\u6b62\u3057\u3066\u3044\u308b\u3088\u3046\u3067\u3057\u305f\u3002\u30d0\u30c3\u30c6\u30ea\u30fc\u5bb9\u91cf\u304c <strong>5.000000% \u4ee5\u4e0b<\/strong>\u306b\u306a\u3063\u305f\u306e\u3092\u898b\u3066<strong>\u6b63\u5e38\u306a\u505c\u6b62\u51e6\u7406<\/strong>\u306b\u79fb\u884c\u3055\u305b\u305f\u65b9\u304c\u826f\u3055\u305d\u3046\u3067\u3059\u3002<\/p>\n\n\n<p>\u4f5c\u308d\u3046\u3068\u3057\u3066\u3044\u308b\u79c1\u306e\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u5171\u6709\u30b5\u30fc\u30d0\u30fc\u3068\u3057\u3066\u306e\u52d5\u4f5c\u74b0\u5883\u306f\u3001<strong>\u30e9\u30ba\u30d1\u30a41B+ <\/strong>\u3068 <strong>2TB 2.5\u30a4\u30f3\u30c1 HDD<\/strong> \u3067\u69cb\u6210\u3055\u308c\u3066\u3044\u307e\u3059\u3002\u30d5\u30eb\u5145\u96fb\u304b\u3089 5.0% \u307e\u3067\u5bb9\u91cf\u304c\u6e1b\u8870\u3059\u308b\u52d5\u4f5c\u7d99\u7d9a\u6642\u9593\u306f\u3001\u512a\u306b\uff11\u6642\u9593\u3092\u8d8a\u3048\u3066\u3044\u307e\u3059\u3002\u3042\u308b\u7a0b\u5ea6\u30d0\u30c3\u30c6\u30ea\u30fc\u304c\u52a3\u5316\u3057\u3066\u3082\u4f59\u88d5\u304c\u3042\u308a\u305d\u3046\u3067\u3059\u3002<\/p>\n\n\n<p>\u5148\u7a0b\u306e\u516c\u958b\u8cc7\u6599\u3067\u3059\u304c\u3001\u305d\u306e\u4e2d\u3067\u63d0\u4f9b\u3055\u308c\u3066\u3044\u308b\u30b5\u30f3\u30d7\u30eb\u306f\u3001\u307b\u307c <strong>python<\/strong> \u3067\u8a18\u8ff0\u3055\u308c\u3066\u3044\u3066\u3001I2C\u30a4\u30f3\u30bf\u30d5\u30a7\u30fc\u30b9\u304b\u3089\u30d0\u30c3\u30c6\u30ea\u30fc\u306e\u96fb\u5727\u3068\u5bb9\u91cf\u3092\u53d6\u5f97\u3059\u308b\u30eb\u30fc\u30c1\u30f3\u304c\u7d39\u4ecb\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n<hr class=\"wp-block-separator is-style-wide\"\/>\n\n\n<h4 class=\"wp-block-heading\">\u6b63\u5e38\u306a\u505c\u6b62\u51e6\u7406\u306b\u79fb\u884c\u3055\u305b\u308b\u306b\u306f<\/h4>\n\n\n<p>\u305d\u306e\u4e2d\u306b UPS \u306e\u30d0\u30c3\u30c6\u30ea\u30fc\u3092\u76e3\u8996\u3057\u3066 shutdown \u3092\u8d77\u52d5\u3059\u308b\u30b5\u30f3\u30d7\u30eb\u304c\u6b21\u306e\u9805\u76ee\u306b\u7d39\u4ecb\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n<p><strong>Driver and Sample code<\/strong><\/p>\n\n\n<ul><li>File:Rpi-ups-hat.zip<\/li><li>File:UserManual.pdf<\/li><\/ul>\n\n\n<p>zip \u3092\u89e3\u51cd\u3059\u308b\u3068\u3001rpi-ups-hat \u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u4e0b\u306b example.py \u3068 <span style=\"color: #008000;\">raspiupshat.so<\/span> \u304c\u3042\u308a\u307e\u3059\u3002<span style=\"color: #008000;\"><strong>raspiupshat.so<\/strong><\/span> \u304c\u3001UPS\u306e\u30d0\u30c3\u30c6\u30ea\u30fc<strong>\u96fb\u5727\u3068\u5bb9\u91cf\u3092\u53d6\u5f97\u3067\u304d\u308b\u30e9\u30a4\u30d6\u30e9\u30ea<\/strong>\u3067\u3059\u3002<\/p>\n\n\n<p>example.py \u3067\u306f\u3001\u305d\u306e\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u5229\u7528\u3057\u3066\u3001\u7121\u9650\u30eb\u30fc\u30d7\u3067\u5bb9\u91cf\u3092\u30c1\u30a7\u30c3\u30af\u3057\u3066\u30015% \u3092\u5207\u308b\u3068 shutdown \u30b3\u30de\u30f3\u30c9\u304c\u8d77\u52d5\u3055\u308c\u308b\u4f8b\u3068\u3057\u3066\u8a18\u8ff0\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n<p>\u6b8b\u5ff5\u306a\u3053\u3068\u306b\u30b5\u30f3\u30d7\u30eb\u3067\u306f\u3001<strong>os.system(&#8220;sudo shutdown&#8221;)<\/strong> \u306e\u884c\u3067\u3001\u30e9\u30a4\u30d6\u30e9\u30ea <strong>os<\/strong> \u304c import \u3055\u308c\u3066\u3044\u306a\u3044\u305f\u3081\u3001\u30a8\u30e9\u30fc\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u8868\u793a\u3057\u3066<strong>\u6b63\u5e38\u7d42\u4e86\u306b\u306f\u79fb\u884c\u305b\u305a\u3001\u30a2\u30d6\u30ce\u30fc\u30de\u30eb\u30a8\u30f3\u30c9<\/strong>\u3057\u3066\u3057\u307e\u3044\u307e\u3059\u3002<\/p>\n\n\n<p>UserManual.pdf \u306f\u3001\u82f1\u8a9e\u3068\u4e2d\u56fd\u8a9e?\u3067\u66f8\u304b\u308c\u305f\u5229\u7528\u6761\u4ef6\u306e\u8aac\u660e\u3067\u3059\u3002\u305d\u306e\u4e2d\u3067 <strong>wiringPi<\/strong> \u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u304c\u5fc5\u9808\u3068\u3057\u3066\u66f8\u304b\u308c\u3066\u3044\u307e\u3059\u304c\u3001\u6700\u65b0\u306e raspbian \u3067\u306f\u4e8b\u524d\u306b\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u3055\u308c\u3066\u3044\u308b\u3088\u3046\u3067\u3059\u3002<\/p>\n\n\n<p>\u3053\u308c\u3092\u6d41\u7528\u3055\u305b\u3066\u9802\u304d\u3001UPS\u5236\u5fa1\u3068\u3057\u3066\u7d44\u8fbc\u307f\u307e\u3059\u3002<\/p>\n\n\n<hr class=\"wp-block-separator is-style-wide\"\/>\n\n\n<h4 class=\"wp-block-heading\">\u30d0\u30c3\u30c6\u30ea\u30fc\u76e3\u8996\u306e\u5e38\u99d0\u30b5\u30fc\u30d3\u30b9<\/h4>\n\n\n<p><strong>systemd \u306e\u30b5\u30fc\u30d3\u30b9<\/strong>\u3068\u3057\u3066\u8d77\u52d5\u3059\u308b\u65b9\u6cd5\u306b\u3064\u3044\u3066\u306f\u3001\u6b21\u306e\u30b5\u30a4\u30c8\u3092\u53c2\u8003\u306b\u5236\u4f5c\u3057\u307e\u3059\u304c\u3001\u4e00\u5ea6\u79c1\u306e\u30ce\u30fc\u30c8PC\u3067\u4f5c\u6210\u3057\u305f\u7d4c\u9a13\u304c\u3042\u308b\u306e\u3067\u3001\u81ea\u5206\u306e\u5099\u5fd8\u9332\u3082\u898b\u8fd4\u3057\u306a\u304c\u3089\u306e\u4f5c\u696d\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n<p><a href=\"https:\/\/qiita.com\/tkato\/items\/6a227e7c2c2bde19521c\" target=\"_blank\" rel=\"noopener noreferrer\"><span style=\"color: #008000;\">\u53c2\u8003\u306b\u3057\u305f\u30b5\u30a4\u30c8\u306f\u3001\u4f5c\u308a\u65b9\u3092\u4e8b\u7d30\u304b\u304f\u8aac\u660e\u3057\u3066\u304f\u308c\u3066\u3044\u307e\u3059\u3002<\/span><\/a><\/p>\n\n\n<hr class=\"wp-block-separator is-style-wide\"\/>\n\n\n<h3 class=\"wp-block-heading\"><strong>\u3053\u3053\u304b\u3089\u304c\u4f5c\u696d\u306e\u672c\u984c<\/strong><\/h3>\n\n\n<p>Raspbian \u8d77\u52d5\u6642\u306b\u3001\u4e00\u5ea6\u3060\u3051\u8d77\u52d5\u3057\u3066\u5e38\u6642\u30d0\u30c3\u30c6\u30ea\u30fc\u3092\u76e3\u8996\u3057\u3066\u3001\u5bb9\u91cf\u304c 5% \u3092\u4e0b\u56de\u3063\u305f\u6642\u306b shutdown \u30d7\u30ed\u30bb\u30b9\u3092\u8d77\u52d5\u3055\u305b\u307e\u3059\u3002<\/p>\n\n\n<p>systemd \u306b\u767b\u9332\u3059\u308b\u30b5\u30fc\u30d3\u30b9\u306e\u6307\u793a\u66f8\u304c\u3001\u30e6\u30cb\u30c3\u30c8\u30d5\u30a1\u30a4\u30eb\u3068\u547c\u3070\u308c\u307e\u3059\u3002<\/p>\n\n\n<ul><li><strong>\u30d1\u30c3\u30b1\u30fc\u30b8\u540d: <span style=\"color: #ff00ff;\">UPS-Watch-shut<\/span><\/strong><\/li><li><strong>\u30e6\u30cb\u30c3\u30c8\u30d5\u30a1\u30a4\u30eb\u540d: <span style=\"color: #ff6600;\">ups-watching.service<\/span><\/strong><\/li><\/ul>\n\n\n<p>\u30b5\u30fc\u30d3\u30b9(\u30e6\u30cb\u30c3\u30c8\u30d5\u30a1\u30a4\u30eb)\u306e\u767b\u9332\u306f\u3001 <strong>\/etc\/systemd\/system\/<span style=\"color: #ff6600;\">ups-watching.service<\/span><\/strong> \u3067\u3001\u3053\u306e\u4e2d\u306b\u306f\u767b\u9332\u3059\u308b\u30b5\u30fc\u30d3\u30b9\u306e\u60c5\u5831\u3092\u6c7a\u3081\u3089\u308c\u305f\u66f8\u5f0f\u3067\u8a18\u8ff0\u3057\u307e\u3059\u3002<\/p>\n\n\n<p>\u305d\u3057\u3066\u5b9f\u969b\u306b\u52d5\u4f5c\u3055\u305b\u308b\u30d7\u30ed\u30b0\u30e9\u30e0\u306f\u3001\u30d1\u30c3\u30b1\u30fc\u30b8\u540d\u3067\u7ba1\u7406\u3059\u308b\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b\u96c6\u3081\u308b\u3088\u3046\u3067\u3001 <strong>\/opt\/<span style=\"color: #ff00ff;\">UPS-Watch-shut<\/span>\/bin<\/strong> \u306b\u7f6e\u304d\u307e\u3059\u3002\u30d0\u30c3\u30c6\u30ea\u30fc\u306e\u60c5\u5831\u3092\u53d6\u5f97\u3059\u308b\u30e9\u30a4\u30d6\u30e9\u30ea <span style=\"color: #008000;\"><strong>raspiupshat.so<\/strong><\/span> \u3082\u3053\u3053\u306b\u7f6e\u304d\u307e\u3059\u3002<\/p>\n\n\n<h4 class=\"wp-block-heading\">systemd \u306e\u30b5\u30fc\u30d3\u30b9\u3068\u3057\u3066\u7d44\u8fbc\u307f<\/h4>\n\n\n<p>\u30ab\u30ec\u30f3\u30c8\u3067\u4f5c\u6210\u3057\u3066\u3001\u305d\u308c\u3092\u8a72\u5f53\u3059\u308b\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b\u30b3\u30d4\u30fc\u3057\u3066\u3001\u6240\u6709\u8005\u3092 root \u306b\u5909\u66f4\u3057\u305f\u308a\u3001\u30a2\u30af\u30bb\u30b9\u6a29\u306e\u5909\u66f4\u3092\u3057\u307e\u3059\u3002<\/p>\n\n\n<p>\u307e\u305a\u306f\u3001\u30e6\u30cb\u30c3\u30c8\u30d5\u30a1\u30a4\u30eb\u306e\u4f5c\u6210\u3067\u3059\u3002<\/p>\n\n\n<pre class=\"wp-block-preformatted pre-s2\">$ <strong>vi <span style=\"color: #ff6600;\">ups-watching.service<\/span><\/strong>\n[Unit]\nDescription = UPS Watching AutoRun\nAfter=network-online.target remote-fs.target nss-lookup.target\nConditionPathExists=\/opt\/<strong><span style=\"color: #ff00ff;\">UPS-Watch-shut<\/span><\/strong>\/bin\n[Service]\nExecStart=\/opt\/<strong><span style=\"color: #ff00ff;\">UPS-Watch-shut<\/span><\/strong>\/bin\/<span style=\"color: #800080;\">startup-1st.sh<\/span>\nRestart=no\nType=simple\n[Install]\nWantedBy=multi-user.target\n<\/pre>\n\n\n<p>\u8ffd\u52a0\u3059\u308b\u30b5\u30fc\u30d3\u30b9\u306e\u6e96\u5099\u3092\u884c\u3044\u307e\u3059\u3002<\/p>\n\n\n<pre class=\"wp-block-preformatted pre-s2\">$ <strong>sudo cp <span style=\"color: #ff6600;\">ups-watching.service<\/span> \/etc\/systemd\/system<\/strong>\n$ <strong>sudo chown root:root \/etc\/systemd\/system\/<span style=\"color: #ff6600;\">ups-watching.service<\/span><\/strong>\n$ <strong>sudo chmod 644 \/etc\/systemd\/system\/<span style=\"color: #ff6600;\">ups-watching.service<\/span><\/strong><\/pre>\n\n\n<p>\u30b5\u30fc\u30d3\u30b9\u304b\u3089\u6700\u521d\u306b\u8d77\u52d5\u3059\u308b\u30e2\u30b8\u30e5\u30fc\u30eb\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<\/p>\n\n\n<pre class=\"wp-block-preformatted pre-s2\">$ <strong>vi <span style=\"color: #800080;\">startup-1st.sh<\/span><\/strong>\n<span class=\"span-st-n\">#!\/bin\/sh\nexec \/usr\/bin\/env python \/opt\/<span style=\"color: #ff00ff;\"><strong>UPS-Watch-shut<\/strong><\/span>\/bin\/<strong><span style=\"color: #3366ff;\">ups-shutdown.py\n<\/span><\/strong><\/span><\/pre>\n\n\n<p>\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u307e\u3068\u3081\u308b\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<\/p>\n\n\n<pre class=\"wp-block-preformatted pre-s2\">$ <strong>sudo mkdir -p \/opt\/<span class=\"span-st-n\" style=\"color: #ff00ff;\">UPS-Watch-shut<\/span>\/bin<\/strong>\n$ <strong>sudo chmod 755 \/opt\/<span class=\"span-st-n\" style=\"color: #ff00ff;\">UPS-Watch-shut<\/span>\/bin<\/strong>\n$ <strong>sudo cp <span style=\"color: #800080;\">startup-1st.sh<\/span> \/opt\/<span class=\"span-st-n\" style=\"color: #ff00ff;\">UPS-Watch-shut<\/span>\/bin<\/strong>\n$ <strong>sudo chown root:root \/opt\/<span class=\"span-st-n\" style=\"color: #ff00ff;\">UPS-Watch-shut<\/span>\/bin\/<span style=\"color: #800080;\">startup-1st.sh<\/span><\/strong>\n$ <strong>sudo chmod 755 \/opt\/<span class=\"span-st-n\" style=\"color: #ff00ff;\">UPS-Watch-shut<\/span>\/bin\/<span style=\"color: #800080;\">startup-1st.sh<\/span><\/strong><\/pre>\n\n\n<h4 class=\"wp-block-heading\">\u30b7\u30e3\u30c3\u30c8\u30c0\u30a6\u30f3\u30d7\u30ed\u30b0\u30e9\u30e0<\/h4>\n\n\n<p>\u63d0\u4f9b\u3055\u308c\u3066\u3044\u305f python \u306e\u30b5\u30f3\u30d7\u30eb\u30d7\u30ed\u30b0\u30e9\u30e0\u306f\u3001\u30b5\u30f3\u30d7\u30eb\u306e\u6307\u793a\u624b\u9806\u3067\u89e3\u51cd\u3059\u308b\u3068 python\u306e\u539f\u5f62\u3068\u30d0\u30c3\u30c6\u30ea\u30fc\u60c5\u5831\u53d6\u5f97\u30e9\u30a4\u30d6\u30e9\u30ea <span style=\"color: #008000;\"><strong>raspiupshat.so<\/strong><\/span> \u304c\u63d0\u4f9b\u3055\u308c\u3066\u3044\u307e\u3059\u3002\u5c11\u3057\u624b\u3092\u52a0\u3048\u3066\u3001\u52d5\u4f5c\u3059\u308b\u3088\u3046\u306b\u76f4\u3057\u3001\u5358\u4f53\u3067\u306f\u30b7\u30e3\u30c3\u30c8\u30c0\u30a6\u30f3\u304c\u884c\u308f\u308c\u308b\u3053\u3068\u3092\u78ba\u8a8d\u3067\u304d\u307e\u3057\u305f\u3002<\/p>\n\n\n<pre class=\"wp-block-preformatted pre-s2\">$ <strong>vi <span style=\"color: #333399;\">ups-shutdown.py<\/span><\/strong>\n<span class=\"span-st-n\">#!\/usr\/bin\/env python\n# Raspi UPS Hat\n# We only provide 2 interface to get battery information;\n#\n#Interface 1:\n#Function: get current battery voltage\n#Return value: battery voltage;\n#float getv();\n#Interface 2:\n#Function:    get battery capacity\n#Return value: 0~100+\n#float getsoc();\n#\nimport sys\n# import Raspi UPS Hat library\nimport raspiupshat\nimport os\nimport time\nimport datetime\n# init Raspi UPS Hat\nraspiupshat.init();\n# Get info\nnow = datetime.datetime.now()\nprint(\"{0:%Y-%m-%d %H:%M:%S} ; \".format(now) + \"Voltage:%5.2fV ; Battery:%5i%%\" % (raspiupshat.getv(), raspiupshat.getsoc()))\nif raspiupshat.getsoc() &gt;= 100:\n        print \"Battery FULL\"\nif raspiupshat.getsoc() &lt; 20:\n        print \"Battery LOW\"\nwhile 1:\n        if raspiupshat.getsoc() &lt; 5:\n                print \"System will shutdown now,bye!\"\n                os.system(\"sudo shutdown -h 0\")\n        <span style=\"color: #800080;\">#<\/span> now = datetime.datetime.now()\n        <span style=\"color: #800080;\">#<\/span> print(\"{0:%H:%M:%S} ; \".format(now) + \"Voltage:%5.2fV ; Battery:%5i%%\" % (raspiupshat.getv(), raspiupshat.getsoc()))\n        <span style=\"color: #800080;\">#<\/span> time.sleep(10)\n<\/span>\n<\/pre>\n\n\n<p>\u7121\u9650\u30eb\u30fc\u30d7\u5185\u306e\u6700\u5f8c\u306e\uff13\u884c\u306f\u3001\u78ba\u8a8d\u6642\u306b10\u79d2\u6bce\u306b\u6642\u9593\u3068\u30d0\u30c3\u30c6\u30ea\u30fc\u96fb\u5727\u5024\u3001\u30d0\u30c3\u30c6\u30ea\u30fc\u5bb9\u91cf\u3092\u8868\u793a\u3059\u308b\u305f\u3081\u306e\u3082\u306e\u3067\u3059\u3002\u5fc5\u8981\u306a\u3089\u5148\u982d\u306e\u30b3\u30e1\u30f3\u30c8 &#8216;<span style=\"color: #800080;\">#<\/span>&#8216; \u3092\u6d88\u3059\u3053\u3068\u3067\u30c7\u30d0\u30c3\u30b0\u884c\u306e\u8868\u793a\u304c\u3067\u304d\u307e\u3059\u3002<br \/>\u305d\u308c\u3068\u30d0\u30c3\u30c6\u30ea\u30fc\u60c5\u5831\u53ce\u96c6\u7528\u306e\u30e9\u30a4\u30d6\u30e9\u30ea<span style=\"color: #008000;\"> <strong>raspiupshat.so<\/strong><\/span> \u3092\u540c\u3058\u5834\u6240\u306b\u914d\u7f6e\u3057\u307e\u3059\u3002<\/p>\n\n\n<pre class=\"wp-block-preformatted pre-s2\">$ <strong>sudo cp <span style=\"color: #3366ff;\">ups-shutdown.py<\/span> \/opt\/<span style=\"color: #ff00ff;\">UPS-Watch-shut<\/span>\/bin\n<\/strong>$ <strong>sudo chown root:root \/opt\/<span style=\"color: #ff00ff;\">UPS-Watch-shut<\/span>\/bin\/<span style=\"color: #3366ff;\">ups-shutdown.py\n<\/span><\/strong>$ <strong>sudo chmod 755 \/opt\/<span style=\"color: #ff00ff;\">UPS-Watch-shut<\/span>\/bin\/<\/strong><span style=\"color: #3366ff;\"><strong>ups-shutdown.py<\/strong>\n<\/span>$ <strong>sudo cp <span style=\"color: #008000;\">raspiupshat.so<\/span> \/opt\/<span style=\"color: #ff00ff;\">UPS-Watch-shut<\/span>\/bin\n<\/strong>$ <strong>sudo chown root:root \/opt\/<span style=\"color: #ff00ff;\">UPS-Watch-shut<\/span>\/bin\/<span style=\"color: #008000;\">raspiupshat.so<\/span>\n<\/strong>$ <strong>sudo chmod 755 \/opt\/<span style=\"color: #ff00ff;\">UPS-Watch-shut<\/span>\/bin\/<span style=\"color: #008000;\">raspiupshat.so<\/span><\/strong><\/pre>\n\n\n<p>\u30b5\u30fc\u30d3\u30b9\u3068\u3057\u3066\u5b9a\u7fa9\u3057\u3066\u3044\u308b <strong><span style=\"color: #ff6600;\">ups-watching.service<\/span><\/strong> \u306b\u3088\u308a <strong><span style=\"color: #800080;\">startup-1st.sh<\/span><\/strong> \u304c\u8d77\u52d5\u3055\u308c\u307e\u3059\u3002\u305d\u306e\u4e2d\u3067\u5358\u7d14\u306b\u30b7\u30e3\u30c3\u30c8\u30c0\u30a6\u30f3\u30d7\u30ed\u30b0\u30e9\u30e0\u306e <strong><span style=\"color: #3366ff;\">ups-shutdown.py<\/span><\/strong> \u3092\u8d77\u52d5\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n<hr class=\"wp-block-separator is-style-wide\"\/>\n\n\n<h4 class=\"wp-block-heading\">\u30e6\u30cb\u30c3\u30c8\u30d5\u30a1\u30a4\u30eb\u3092 systemd \u306b\u767b\u9332<\/h4>\n\n\n<p>\u3053\u3053\u304b\u3089\u306f\u3001systemd \u3078\u306e\u30b5\u30fc\u30d3\u30b9(\u30e6\u30cb\u30c3\u30c8\u30d5\u30a1\u30a4\u30eb)\u306e\u767b\u9332\u3068\u691c\u8a3c\u4f5c\u696d\u3067\u3059\u3002\u30e6\u30cb\u30c3\u30c8\u30d5\u30a1\u30a4\u30eb\u7b49\u3092\u8ffd\u52a0\u3084\u5909\u66f4\u3057\u305f\u5f8c\u306b\u306f\u3001\u5fc5\u305a\u6b21\u306e\u30b3\u30de\u30f3\u30c9 <span style=\"color: #003366;\"><strong>sudo systemctl daemon-reload<\/strong><\/span> \u3092\u5b9f\u884c\u3057\u307e\u3059\u3002<\/p>\n\n\n<p>\u305d\u3057\u3066\u4e00\u7dd2\u306b\u30b9\u30c6\u30fc\u30bf\u30b9\u3082\u78ba\u8a8d\u3057\u3066\u304a\u304d\u307e\u3059\u3002<\/p>\n\n\n<pre class=\"wp-block-preformatted pre-s2\">$ <strong>sudo systemctl daemon-reload<\/strong>\n$ <strong>sudo systemctl status <span style=\"color: #ff6600;\">ups-watching.service<\/span><\/strong>\n<span class=\"span-st-n\">\u25cf ps-watching.service - UPS Watching AutoRun\n   Loaded: loaded (\/etc\/systemd\/system\/note-startup-1st.service; <span style=\"color: #ff0000;\">disabled<\/span>; vendor preset: enabled)\n   Active: inactive (dead)<\/span><\/pre>\n\n\n<p>\u30b9\u30c6\u30fc\u30bf\u30b9\u3067\u8868\u793a\u3055\u308c\u308b Loaded: \u884c\u306e\u30ab\u30c3\u30b3\u5185\u306e\uff11\u3064\u76ee\u3068\uff12\u3064\u76ee\u306e\u30bb\u30df\u30b3\u30ed\u30f3\u306e\u9593\u306e <span style=\"color: #ff0000;\">disabled<\/span> \u3068\u306a\u3063\u3066\u3044\u308b\u306e\u306f\u3001\u81ea\u52d5\u8d77\u52d5\u304c\u7121\u52b9\u306b\u306a\u3063\u3066\u3044\u308b\u3068\u3044\u3046\u3053\u3068\u306e\u3088\u3046\u3067\u3001\u81ea\u52d5\u8d77\u52d5\u3067\u304d\u308b\u3088\u3046\u306b\u8a2d\u5b9a\u3057\u307e\u3059\u3002<\/p>\n\n\n<h4 class=\"wp-block-heading\">\u81ea\u52d5\u8d77\u52d5\u304c\u884c\u308f\u308c\u308b\u3088\u3046\u306b\u8a2d\u5b9a<\/h4>\n\n\n<pre class=\"wp-block-preformatted pre-s2\">$ <strong>sudo systemctl enable <span style=\"color: #ff6600;\">ups-watching.service<\/span><\/strong>\n<span class=\"span-st-n\">Created symlink \/etc\/systemd\/system\/multi-user.target.wants\/ups-watching.service \u2192 \/etc\/systemd\/system\/ups-watching.service.<\/span>\n$ <strong>sudo systemctl status <span style=\"color: #ff6600;\">ups-watching.service<\/span><\/strong>\n<span style=\"background: #eeeeee none repeat scroll 0% 0%;\">\u25cf ups-watching.service - UPS Watching AutoRun\n<\/span><span style=\"background: #eeeeee none repeat scroll 0% 0%;\">Loaded: loaded (\/etc\/systemd\/system\/ups-watching.service;<\/span><span style=\"color: #002060; background: #eeeeee none repeat scroll 0% 0%;\"><span style=\"color: #00ff00;\"> enabled<\/span>; vendor preset: enabled)\nActive: inactive (dead)<\/span>\n<\/pre>\n\n\n<p>\u30e6\u30cb\u30c3\u30c8\u30d5\u30a1\u30a4\u30eb\u306e\u5b9a\u7fa9\u5185\u306b\u3001[ Install ] \u306e WantedBy= \u3067\u5b9a\u7fa9\u3057\u3066\u3044\u308b\u30e6\u30cb\u30c3\u30c8\u306b\u30ea\u30f3\u30af\u304c\u5f35\u3089\u308c\u3001\u5148\u307b\u3069\u306e \/etc\/systemd\/system\/ups-watching.service; \u306e\u5f8c\u306e <span style=\"color: #ff0000;\">disabled<\/span> \u304c <span style=\"color: #00ff00;\">enabled<\/span> \u306b\u5909\u308f\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n<p>\u3053\u308c\u3067\u518d\u7acb\u3061\u4e0a\u3052\u3067\u81ea\u52d5\u5b9f\u884c\u3055\u308c\u308b\u3088\u3046\u306b\u306a\u3063\u3066\u3044\u308b\u306f\u305a\u3067\u3059\u304c\u3001\u305d\u306e\u524d\u306b\u30b3\u30de\u30f3\u30c9\u3067\u8d77\u52d5\u3057\u3066\u78ba\u8a8d\u3057\u305f\u308a\u3001\u505c\u6b62\u3055\u305b\u308b\u64cd\u4f5c\u3092\u3057\u3066\u52d5\u4f5c\u3092\u78ba\u8a8d\u3057\u307e\u3059\u3002<\/p>\n\n\n<hr class=\"wp-block-separator is-style-wide\"\/>\n\n\n<pre class=\"wp-block-preformatted pre-s2\">$ <strong>ls -l \/opt\/<span style=\"color: #ff00ff;\">UPS-Watch-shut<\/span>\/bin\/<\/strong>\n<span class=\"span-st-n\">-rw-r--r-- 1 root root 7416 1\u6708 25 11:07 <span style=\"color: #008000;\"><strong>raspiupshat.so<\/strong><\/span>\n-rwxr-xr-x 1 root root   76 1\u6708 24 22:49 <span style=\"color: #800080;\"><strong>startup-1st.sh<\/strong><\/span>\n-rwxr-xr-x 1 root root  987 1\u6708 25 11:06 <span style=\"color: #0000ff;\"><strong>ups-shutdown.py<\/strong>\n<\/span><\/span>\n$ <strong>sudo systemctl daemon-reload<\/strong>\n$ <strong>sudo systemctl start <span style=\"color: #ff6600;\">ups-watching.service<\/span><\/strong>\n$ <strong>sudo systemctl status <span style=\"color: #ff6600;\">ups-watching.service<\/span><\/strong>\n<span style=\"color: #00ff00;\">\u25cf<\/span> ups-watching.service - UPS Watching AutoRun\nLoaded: loaded (\/etc\/systemd\/system\/ups-watching.service; enabled; vendor preset: enabled)\nActive: <span style=\"color: #00ff00;\">active (running)<\/span> since Sat 2019-01-26 08:57:28 JST; 5h 36min ago\nMain PID: 367 (python)\nCGroup: \/system.slice\/ups-watching.service\n\u2514\u2500367 python \/opt\/UPS-Watch-shut\/bin\/ups-shutdown.py\n1\u6708 26 14:32:48 rpi1-disk startup-1st.sh[367]: 14:31:08 ; Voltage: 4.34V ; Battery: 100%\n1\u6708 26 14:32:48 rpi1-disk startup-1st.sh[367]: 14:31:18 ; Voltage: 4.35V ; Battery: 100%\n1\u6708 26 14:32:48 rpi1-disk startup-1st.sh[367]: 14:31:28 ; Voltage: 4.35V ; Battery: 100%\n1\u6708 26 14:32:48 rpi1-disk startup-1st.sh[367]: 14:31:38 ; Voltage: 4.35V ; Battery: 100%\n1\u6708 26 14:32:48 rpi1-disk startup-1st.sh[367]: 14:31:48 ; Voltage: 4.35V ; Battery: 100%\n1\u6708 26 14:32:48 rpi1-disk startup-1st.sh[367]: 14:31:58 ; Voltage: 4.35V ; Battery: 100%\n1\u6708 26 14:32:48 rpi1-disk startup-1st.sh[367]: 14:32:08 ; Voltage: 4.35V ; Battery: 100%\n1\u6708 26 14:32:48 rpi1-disk startup-1st.sh[367]: 14:32:18 ; Voltage: 4.35V ; Battery: 100%\n1\u6708 26 14:32:48 rpi1-disk startup-1st.sh[367]: 14:32:28 ; Voltage: 4.35V ; Battery: 100%<\/pre>\n\n\n<p>\u4e0a\u8a18\u306e\u7d50\u679c\u3067\u306f\u3001\u5b9f\u969b\u306b <strong>shutdown<\/strong> \u52d5\u4f5c\u3092\u884c\u3046 <strong>python<\/strong> \u306e\u30d7\u30ed\u30b0\u30e9\u30e0\u306e <strong>&#8216;#&#8217;<\/strong> \u306e\u30b3\u30e1\u30f3\u30c8\u3092\u53d6\u308a\u9664\u304d\u3001\u30e1\u30c3\u30bb\u30fc\u30b8\u66f8\u304d\u51fa\u3057\u306e\u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8\u3092\u6709\u52b9\u306b\u3057\u7d44\u8fbc\u307f\u307e\u3057\u305f\u3002<\/p>\n\n\n<p><strong>systemd<\/strong> \u306e\u52d5\u4f5c\u306b\u4e0d\u6163\u308c\u3067\u3001\u6b63\u3057\u304f\u7406\u89e3\u3067\u304d\u3066\u3044\u306a\u3044\u306e\u3067\u3059\u304c\u3001<strong>systemctl status<\/strong> \u30b3\u30de\u30f3\u30c9\u3067\u306f\u3001\u51e6\u7406\u4e2d\u3067\u66f8\u304d\u51fa\u3055\u308c\u305f\u30e1\u30c3\u30bb\u30fc\u30b8\u304c\u76f4\u63a5\u8868\u793a\u3055\u308c\u3066\u3044\u308b\u308f\u3051\u3067\u306f\u306a\u3044\u3088\u3046\u3067\u3001\u5225\u306b <strong>journalctl -u<\/strong> \u30b3\u30de\u30f3\u30c9\u3067\u8868\u793a\u3067\u304d\u308b\u3088\u3046\u3067\u3059\u3002<\/p>\n\n\n<p>\u66f8\u304d\u51fa\u3055\u308c\u305f\u30e1\u30c3\u30bb\u30fc\u30b8\u304c\u3001\u30ad\u30e5\u30fc\u304b\u30d0\u30c3\u30d5\u30a1\u306e\u3088\u3046\u306a\u6240\u306b\u84c4\u7a4d\u3055\u308c\u3066\u3044\u3066\u3001 <strong>systemctl status<\/strong> \u306e\u5b9f\u884c\u6642\u306b\u79fb\u3055\u308c\u3066\u3001<strong>journalctl -u<\/strong> \u3067\u898b\u3089\u308c\u308b\u5834\u6240\u306b\u84c4\u7a4d\u3057\u3066\u3044\u304f\u3088\u3046\u306a\u611f\u3058\u3067\u3059\u3002\u305d\u306e\u305f\u3081\u3001\u6700\u65b0\u306e\u60c5\u5831\u3092\u78ba\u8a8d\u3059\u308b\u305f\u3081\u306b\u306f\u3001<strong>systemctl status<\/strong> \u3092\u5148\u306b\u5b9f\u884c\u3057\u3066\u304b\u3089 <strong>journalctl -u<\/strong> \u3092\u5b9f\u884c\u3057\u3066\u78ba\u8a8d\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b\u3088\u3046\u3067\u3059\u3002<\/p>\n\n\n<p>\u30e1\u30c3\u30bb\u30fc\u30b8\u306e\u5404\u884c\u5148\u982d\u306b\u306f\u3001<strong>systemctl status<\/strong> \u3067\u79fb\u3055\u308c\u305f\u65e5\u6642\u304c\u8a18\u8ff0\u3055\u308c\u3066\u3044\u308b\u3088\u3046\u3067\u3001\u524d\u56de\u306e\u78ba\u8a8d\u304b\u3089\u4eca\u56de\u65b0\u3057\u304f\u52a0\u3048\u3089\u308c\u305f\u884c\u3092\u5224\u5225\u3059\u308b\u3053\u3068\u304c\u53ef\u80fd\u306a\u3088\u3046\u3067\u3059\u3002\u306a\u304a\u3001\u64cd\u4f5c\u65b9\u6cd5\u306f less \u30b3\u30de\u30f3\u30c9\u306e\u64cd\u4f5c\u3068\u540c\u3058\u306a\u306e\u3067\u3001<strong>&#8216;\/&#8217;<\/strong> \u3067\u6587\u5b57\u5217\u3092\u691c\u7d22\u3057\u305f\u308a\u3001\u884c\u3092\u30b9\u30ad\u30c3\u30d7\u3057\u305f\u308a\u3001<strong>&#8216;1G&#8217;<\/strong> \u3067\u5148\u982d\u884c\u306b\u79fb\u52d5\u3057\u305f\u308a\u3001<strong>&#8216;G&#8217;<\/strong> \u3067\u6700\u7d42\u884c\u306b\u79fb\u52d5\u3059\u308b\u3053\u3068\u3082\u3067\u304d\u3001\u4e0a\u4e0b\u306e<strong>\u77e2\u5370\u30ad\u30fc<\/strong>\u3067\u524d\u5f8c\u306b\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u8fbf\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n<h4 class=\"wp-block-heading\">\u5b9f\u969b\u306e\u52d5\u4f5c\u691c\u8a3c\u4f5c\u696d<\/h4>\n\n\n<p>\u672c\u756a\u3067\u306e\u30b7\u30b9\u30c6\u30e0\u7d42\u4e86\u52d5\u4f5c\u3092\u78ba\u8a8d\u3059\u308b\u305f\u3081\u306b\u3001ssh \u3067\u30ea\u30e2\u30fc\u30c8\u63a5\u7d9a\u3057\u305f\u307e\u307e\u3001\u30d0\u30c3\u30c6\u30ea\u30fc\u306e\u60c5\u5831\u3092 10 \u79d2\u6bce\u306b\u8868\u793a\u3057\u3066\u78ba\u8a8d\u3057\u307e\u3057\u305f\u304c\u30015% \u306b\u306a\u3063\u305f\u5f8c\u306e\uff11\u5206\u5f8c\u304f\u3089\u3044\u306b\u30bb\u30c3\u30b7\u30e7\u30f3\u5207\u65ad\u306e\u30e1\u30c3\u30bb\u30fc\u30b8\u3068\u5171\u306b\u30014% \u3092\u8868\u793a\u3057\u3066\u505c\u6b62\u3057\u3066\u3044\u307e\u3057\u305f\u3002<\/p>\n\n\n<p>\u671f\u5f85\u3057\u305f\u30b7\u30b9\u30c6\u30e0\u7d42\u4e86\u304c\u884c\u308f\u308c\u3066\u3044\u308b\u3088\u3046\u3067\u4e00\u5b89\u5fc3\u3067\u3059\u3002\u30e1\u30c3\u30bb\u30fc\u30b8\u304c\u84c4\u7a4d\u3055\u308c\u3066\u3044\u308b journalctl -u \u30b3\u30de\u30f3\u30c9\u306e\u7d50\u679c\u4f8b\u3092\u6b21\u306b\u793a\u3057\u307e\u3059\u3002\u3053\u306e\u30b3\u30de\u30f3\u30c9\u306f\u4e00\u822c\u30e6\u30fc\u30b6\u30fc\u3067\u78ba\u8a8d\u3067\u304d\u308b\u3088\u3046\u3067\u3059\u3002<\/p>\n\n\n<pre class=\"wp-block-preformatted pre-s2\">$ <strong>journalctl -u <span style=\"color: #ff6600;\">ups-watching.service<\/span><\/strong>\n<span class=\"span-st-n\">\n 1\u6708 26 08:57:28 rpi1-disk systemd[1]: Started UPS Watching AutoRun.\n 1\u6708 26 09:14:56 rpi1-disk startup-1st.sh[367]: 2019-01-26 08:57:32 ; Voltage: 3.77V ; Battery:\n 1\u6708 26 09:14:56 rpi1-disk startup-1st.sh[367]: Battery LOW\n 1\u6708 26 09:14:56 rpi1-disk startup-1st.sh[367]: 08:57:32 ; Voltage: 3.77V ; Battery:    5%\n 1\u6708 26 09:14:56 rpi1-disk startup-1st.sh[367]: 08:57:42 ; Voltage: 3.78V ; Battery:    5%\n 1\u6708 26 09:14:56 rpi1-disk startup-1st.sh[367]: 08:57:52 ; Voltage: 3.77V ; Battery:    5%\n 1\u6708 26 09:14:56 rpi1-disk startup-1st.sh[367]: 08:59:54 ; Voltage: 3.77V ; Battery:    5%\n 1\u6708 26 09:14:56 rpi1-disk startup-1st.sh[367]: 09:00:04 ; Voltage: 3.77V ; Battery:    5%\n 1\u6708 26 09:14:56 rpi1-disk startup-1st.sh[367]: 09:00:14 ; Voltage: 3.78V ; Battery:    6%\n 1\u6708 26 09:14:56 rpi1-disk startup-1st.sh[367]: 09:00:24 ; Voltage: 3.78V ; Battery:    6%\n 1\u6708 26 09:14:56 rpi1-disk startup-1st.sh[367]: 09:00:34 ; Voltage: 3.78V ; Battery:    6%\n 1\u6708 26 09:14:56 rpi1-disk startup-1st.sh[367]: 09:00:44 ; Voltage: 3.78V ; Battery:    6%\n 1\u6708 26 09:14:56 rpi1-disk startup-1st.sh[367]: 09:00:54 ; Voltage: 3.78V ; Battery:    6%\n 1\u6708 26 09:14:56 rpi1-disk startup-1st.sh[367]: 09:01:05 ; Voltage: 3.78V ; Battery:    6%\n 1\u6708 26 09:14:56 rpi1-disk startup-1st.sh[367]: 09:01:15 ; Voltage: 3.78V ; Battery:    6%\n 1\u6708 26 09:14:56 rpi1-disk startup-1st.sh[367]: 09:01:25 ; Voltage: 3.78V ; Battery:    6%\n 1\u6708 26 09:14:56 rpi1-disk startup-1st.sh[367]: 09:01:35 ; Voltage: 3.78V ; Battery:    6%\n 1\u6708 26 09:14:56 rpi1-disk startup-1st.sh[367]: 09:01:45 ; Voltage: 3.78V ; Battery:    6%\n 1\u6708 26 09:14:56 rpi1-disk startup-1st.sh[367]: 09:01:55 ; Voltage: 3.78V ; Battery:    6%\n 1\u6708 26 09:14:56 rpi1-disk startup-1st.sh[367]: 09:02:05 ; Voltage: 3.78V ; Battery:    7%\n 1\u6708 26 09:14:56 rpi1-disk startup-1st.sh[367]: 09:02:15 ; Voltage: 3.78V ; Battery:    7%\nlines 1-22\n<\/span><\/pre>\n\n\n<p>\u4eca\u56de\u306eUPS\u30d0\u30c3\u30c6\u30ea\u30fc\u76e3\u8996\u3068 shutdown \u3067\u306f\u3001\u7279\u306b\u30d7\u30ed\u30b0\u30e9\u30e0\u3084\u30b5\u30fc\u30d3\u30b9\u306b\u3064\u3044\u3066\u306e\u4f9d\u5b58\u95a2\u4fc2\u306f\u7121\u3044\u306e\u3067\u3001\u3053\u308c\u3067\u5b8c\u4e86\u3067\u3059\u3002<\/p>\n\n\n<p>\u6b21\u306f\u3001UPS\u30d0\u30c3\u30c6\u30ea\u30fc\u306e\u5145\u653e\u96fb\u306b\u4f34\u3046\u643a\u5e2f\u30e1\u30fc\u30eb\u3078\u306e\u901a\u77e5\u306b\u3064\u3044\u3066\u306e\u5bfe\u7b56\u3092\u8003\u3048\u3066\u3044\u307e\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u76ee\u6307\u3059\u3082\u306e\u306f \u30e9\u30ba\u30d1\u30a41B+\u3092\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u5171\u6709\u30b5\u30fc\u30d0\u30fc\u3068\u3057\u3066\u3001\u30d0\u30c3\u30c6\u30ea\u30fc\u30d0\u30c3\u30af\u30a2\u30c3\u30d7\u3092\u884c\u3044\u306a\u304c\u3089\u5e38\u6642\u8d77\u52d5\u3057\u3066\u304a\u304f\u3053\u3068\u3092\u8003\u3048\u3066\u3044\u307e\u3059\u3002 \u5229\u7528\u3059\u308b\u90e8\u6750\u306f \u30a2\u30de\u30be\u30f3\u3067\u8cfc\u5165\u306e\u624b\u4f5c\u308aUPS\u306f\u30012,499\u5186\u3067\u8cfc\u5165\u3057\u307e\u3057\u305f\u3002\u6700\u8fd1\u51fa\u8377\u3055 &hellip; <a href=\"http:\/\/sunao-mita.pgw.jp\/blog\/?p=850\" class=\"more-link\">\u7d9a\u304d\u3092\u8aad\u3080 <span class=\"screen-reader-text\">\u30e9\u30ba\u30d1\u30a4\u306bUPS\u6a5f\u80fd\u3092\u7d44\u8fbc\u3080<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[5,13],"tags":[],"_links":{"self":[{"href":"http:\/\/sunao-mita.pgw.jp\/blog\/index.php?rest_route=\/wp\/v2\/posts\/850"}],"collection":[{"href":"http:\/\/sunao-mita.pgw.jp\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/sunao-mita.pgw.jp\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/sunao-mita.pgw.jp\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/sunao-mita.pgw.jp\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=850"}],"version-history":[{"count":0,"href":"http:\/\/sunao-mita.pgw.jp\/blog\/index.php?rest_route=\/wp\/v2\/posts\/850\/revisions"}],"wp:attachment":[{"href":"http:\/\/sunao-mita.pgw.jp\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=850"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/sunao-mita.pgw.jp\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=850"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/sunao-mita.pgw.jp\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=850"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}