
{"id":13884,"date":"2021-12-11T12:33:51","date_gmt":"2021-12-11T03:33:51","guid":{"rendered":"https:\/\/okiraku-camera.tokyo\/blog\/?p=13884"},"modified":"2021-12-19T16:59:32","modified_gmt":"2021-12-19T07:59:32","slug":"raspi4%e3%81%ae%e6%b8%a9%e5%ba%a6%e3%82%92%e6%b8%ac%e3%81%a3%e3%81%a6%e3%82%b0%e3%83%a9%e3%83%95%e3%81%ab%e3%81%99%e3%82%8b","status":"publish","type":"post","link":"https:\/\/okiraku-camera.tokyo\/blog\/?p=13884","title":{"rendered":"gpio-fan\u306e\u52b9\u679c\u3092\u898b\u308b\u305f\u3081\u3001raspi4\u306e\u6e29\u5ea6\u3092\u6e2c\u3063\u3066\u30b0\u30e9\u30d5\u306b\u3059\u308b"},"content":{"rendered":"<figure id=\"attachment_13834\" aria-describedby=\"caption-attachment-13834\" style=\"width: 552px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/okiraku-camera.tokyo\/blog\/wp-content\/uploads\/2021\/12\/9e8ee27996e9afad7cabf6d5ce427d16.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-large wp-image-13834\" src=\"https:\/\/okiraku-camera.tokyo\/blog\/wp-content\/uploads\/2021\/12\/9e8ee27996e9afad7cabf6d5ce427d16-552x414.jpg\" alt=\"\" width=\"552\" height=\"414\" \/><\/a><figcaption id=\"caption-attachment-13834\" class=\"wp-caption-text\">raspi \u51b7\u5374\u30d5\u30a1\u30f3<\/figcaption><\/figure>\n<h1>\u6982\u8981<\/h1>\n<ul style=\"list-style-type: circle;\">\n<li>raspi4\u306egpio-fan\u30aa\u30fc\u30d0\u30fc\u30ec\u30a4\u3092\u4f7f\u3063\u3066\u3001SoC\u30b3\u30a2\u304c\u4e00\u5b9a\u306e\u6e29\u5ea6\u306b\u306a\u3063\u305f\u3089\u51b7\u5374\u30d5\u30a1\u30f3\u3092\u56de\u3059\u3002<\/li>\n<li>\u30b3\u30a2\u6e29\u5ea6\u306e\u4e0a\u6607\u304c\u3069\u306e\u7a0b\u5ea6\u306a\u306e\u304b\u3001\u307e\u305f\u3001\u30d5\u30a1\u30f3\u306e\u52b9\u679c\u304c\u3069\u308c\u307b\u3069\u3042\u308b\u306e\u304b\u3092\u898b\u308b\u305f\u3081\u306b\u3001Google Chart\u3092\u4f7f\u3063\u3066\u30b0\u30e9\u30d5\u5316\u3059\u308b\u3002<\/li>\n<li>\u30d6\u30e9\u30a6\u30b6\u306b\u30b0\u30e9\u30d5\u3092\u8868\u793a\u3059\u308b\u90fd\u5408\u3067\u3001apache2\u3092\u5c0e\u5165\u3002<\/li>\n<\/ul>\n<h2>gpio-fan\u30aa\u30fc\u30d0\u30fc\u30ec\u30a4\u3068\u99c6\u52d5\u56de\u8def<\/h2>\n<p>\u30b9\u30b1\u30b8\u30e5\u30fc\u30e9\u30dc\u30fc\u30c9\u306e\u56de\u8def\u306e\u8a71\u3067\u3082\u66f8\u3044\u305f\u304c\u3001raspi4\u306e\/boot\/config.txt\u306b\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u884c\u3092\u8ffd\u52a0\u3059\u308b\u3053\u3068\u3067\u3001gpio-fan\u30aa\u30fc\u30d0\u30fc\u30ec\u30a4\u3092\u5229\u7528\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u3002<\/p>\n<pre class=\"lang:default decode:true \">dtoverlay=gpio-fan,gpiopin=21,temp=50000<\/pre>\n<p>\u3053\u306e\u3088\u3046\u306b\u6307\u5b9a\u3059\u308b\u3053\u3068\u3067\u3001SoC\u30b3\u30a2\u306e\u6e29\u5ea6\u304c50\u2103\u306b\u9054\u3059\u308b\u3068\u300110\u2103\u4e0b\u304c\u308b\u307e\u3067 GPIO21\u304cHIGH (\u7d04 +3.3V) \u306b\u306a\u308b\u3002\u305f\u3060\u3001GPIO\u30d4\u30f3\u304b\u3089\u6d41\u305b\u308b\u96fb\u6d41\u306f\u898f\u683c\u4e0a16mA\u4ee5\u4e0b\u3068\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b\u306e\u3067\u3001\u76f4\u63a5\u51b7\u5374\u30d5\u30a1\u30f3\u3092\u99c6\u52d5\u3059\u308b\u3053\u3068\u306f\u3067\u304d\u306a\u3044\u3002\u3053\u306e\u305f\u3081\u3001\u96fb\u6e90\u30b9\u30b1\u30b8\u30e5\u30fc\u30e9\u30dc\u30fc\u30c9\u306b\u306f\u3001GPIO\u306e\u30ed\u30b8\u30c3\u30af\u30ec\u30d9\u30eb\u306b\u5fdc\u3058\u3066\u30d5\u30a1\u30f3\u3092\u56de\u3059\u305f\u3081\u306e\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u56de\u8def\u3092\u7528\u610f\u3057\u305f\u3002<\/p>\n<figure id=\"attachment_13885\" aria-describedby=\"caption-attachment-13885\" style=\"width: 386px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/okiraku-camera.tokyo\/blog\/wp-content\/uploads\/2021\/12\/gpio-fan.png\"><img loading=\"lazy\" decoding=\"async\" class=\"waku wp-image-13885 size-full\" src=\"https:\/\/okiraku-camera.tokyo\/blog\/wp-content\/uploads\/2021\/12\/gpio-fan.png\" alt=\"\" width=\"386\" height=\"161\" \/><\/a><figcaption id=\"caption-attachment-13885\" class=\"wp-caption-text\">gpio-fan\u56de\u8def<\/figcaption><\/figure>\n<p>GPIO21\u304cHIGH\u306b\u306a\u308b\u3068\u30c8\u30e9\u30f3\u30b8\u30b9\u30bfQ2\u306e\u30d9\u30fc\u30b9\u306b\u96fb\u6d41\u304c\u6d41\u308c\u8fbc\u3093\u3067\u3001\u30b3\u30ec\u30af\u30bf-\u30a8\u30df\u30c3\u30bf\u9593\u304c\u30aa\u30f3\u306b\u306a\u308a\u30d5\u30a1\u30f3\u306b\u96fb\u6d41\u304c\u6d41\u308c\u308b\u3002\u62b5\u6297R4\u306f\u3001\u30d5\u30a1\u30f3\u306b\u6d41\u308c\u308b\u96fb\u6d41\u3092\u5236\u9650\u3059\u308b\u305f\u3081\u306e\u3082\u306e\u3067\u3001\u73fe\u5728\u4f7f\u3063\u3066\u3044\u308b\u30d5\u30a1\u30f3\u3067\u306f\u7d0485mA\u307b\u3069\u306e\u96fb\u6d41\u304c\u6d41\u308c\u308b\u3002R5\u306fraspi\u306eGPIO\u304b\u3089\u306e\u96fb\u6d41\u3092\u5236\u9650\u3057\u3066\u304a\u308a\u3001\u6700\u5927\u3067\u3082 3.3 \u00f7 1000 = 3.3mA\u304c\u30c8\u30e9\u30f3\u30b8\u30b9\u30bf\u306e\u30d9\u30fc\u30b9\u306b\u6d41\u308c\u308b\u3002\u30b7\u30e7\u30c3\u30c8\u30ad\u30fc\u30c0\u30a4\u30aa\u30fc\u30c9\u306eD4\u306f\u3001\u30e2\u30fc\u30bf\u30fc\u3092\u6b62\u3081\u308b\u3068\u304d\u306e\u8d77\u96fb\u529b\u306b\u914d\u616e\u3057\u305f\u3082\u306e\u3060\u304c\u3001\u4e0d\u8981\u304b\u3082\u3057\u308c\u306a\u3044\u3002<\/p>\n<h2>\u6e29\u5ea6\u3092\u53ce\u96c6\u3059\u308b\u30b9\u30af\u30ea\u30d7\u30c8<\/h2>\n<p>\u4ee5\u4e0b\u306e\u30b7\u30a7\u30eb\u30b9\u30af\u30ea\u30d7\u30c8 (temp_monitor.sh) \u30921\u5206\u9593\u9694\u3067\u5b9f\u884c\u3059\u308b\u3053\u3068\u3067\u3001\u6e29\u5ea6\u3092CSV\u30d5\u30a1\u30a4\u30eb\u306b\u5f97\u3066\u3044\u308b\u3002<\/p>\n<pre class=\"lang:default decode:true\">#!\/bin\/bash\r\n\r\ndir=\/var\/www\/temp_monitor\/\r\nfilename=${dir}temp_monitor.log\r\nbakname=${dir}temp_monitor.bak\r\n\r\n\r\nline=`date '+%F %H:%M:%S'`\",\"\\\r\n`\/usr\/bin\/vcgencmd measure_temp | \/usr\/bin\/tr -cd '0-9.'`\",\"\\\r\n`\/usr\/bin\/vcgencmd measure_temp pmic | \/usr\/bin\/tr -cd '0-9.'`\",\"\\\r\n`\/usr\/bin\/vcgencmd measure_volts core | \/usr\/bin\/tr -cd '0-9.'`\",\"\\\r\n`\/usr\/bin\/vcgencmd get_throttled | \/usr\/bin\/tr -cd ['0-9x\\n']`\r\n\r\nif [ \"$1\" = \"echo\" ]; then\r\necho $line\r\nexit 0\r\nfi\r\n\r\nlines=`\/usr\/bin\/wc -l $filename | \/usr\/bin\/cut -f 1 -d \" \"`\r\nif [ $lines -gt 2000 ]; then\r\n  \/usr\/bin\/cp -pf $filename $bakname\r\n  \/usr\/bin\/tail -n 1440 $bakname &gt; $filename\r\nfi\r\necho $line &gt;&gt; ${filename}\r\nexit 0<\/pre>\n<p><em>vcgencmd<\/em> \u30b3\u30de\u30f3\u30c9\u306f\u30d3\u30c7\u30aa\u30b3\u30a2\u306e\u52d5\u4f5c\u72b6\u6cc1\u3092\u5f97\u308b\u305f\u3081\u306e\u30b3\u30de\u30f3\u30c9\u3067\u3001\u52d5\u4f5c\u5185\u5bb9\u306f\u4ee5\u4e0b\u306e\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u3092\u53c2\u7167\u3057\u305f\u3002 <a href=\"https:\/\/www.raspberrypi.org\/documentation\/computers\/os.html#vcgencmd\" target=\"_blank\" rel=\"noopener\">https:\/\/www.raspberrypi.org\/documentation\/computers\/os.html#vcgencmd<\/a><\/p>\n<p>\u3053\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u3067\u306f\u3001\u30b3\u30a2\u3001PMIC\u306e\u6e29\u5ea6\u306e\u4ed6\u306b\u3001\u30b3\u30a2\u96fb\u5727\u3068 \u4f4e\u96fb\u5727\u8b66\u544a\u306e\u6709\u7121\u3082\u53d6\u5f97\u3057\u3066CSV\u30d5\u30a1\u30a4\u30eb\u306b\u66f8\u304d\u51fa\u3057\u3066\u3044\u308b\u3002temp_monitor.log \u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u5185\u5bb9\u306b\u306a\u308b\u3002<\/p>\n<pre class=\"lang:default decode:true\">...\r\n2021-12-11 11:05:01,39.9,38.2,0.8600,0x0\r\n2021-12-11 11:06:01,41.3,37.3,0.8600,0x0\r\n2021-12-11 11:07:01,43.3,39.2,0.8600,0x0\r\n2021-12-11 11:08:01,47.2,42.0,0.8600,0x0\r\n2021-12-11 11:09:01,49.1,43.9,0.8600,0x0\r\n2021-12-11 11:10:01,44.8,41.1,0.8600,0x50000\r\n2021-12-11 11:11:01,43.3,39.2,0.8600,0x50000\r\n2021-12-11 11:12:01,42.3,38.2,0.8600,0x50000\r\n...<\/pre>\n<p>\u30d5\u30a1\u30f3\u3092\u56de\u3059\u305f\u3081\u306b\u904e\u5927\u306a\u8ca0\u8377\u3092\u304b\u3051\u305f\u306e\u3067\u3001\u3061\u3087\u3046\u3069\u4f4e\u96fb\u5727\u8b66\u544a\u304c\u751f\u3058\u3066\u3044\u305f\u3002kern.log\u3092\u898b\u308b\u3068\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u306a\u3063\u3066\u3044\u305f\u3002<\/p>\n<pre class=\"lang:default decode:true\">Dec 11 11:09:17 raspberrypi kernel: [ 2353.868305] Under-voltage detected! (0x00050005)\r\nDec 11 11:09:23 raspberrypi kernel: [ 2360.108353] Voltage normalised (0x00000000)<\/pre>\n<p>\u4f4e\u96fb\u5727\u8b66\u544a\u304c\u4e00\u5ea6\u3067\u3082\u51fa\u308b\u3068\u5fa9\u5e30\u3057\u305f\u3042\u3068\u3082\u306f0x50000 \u304c\u8a18\u9332\u3055\u308c\u308b\u3002\u4f4e\u96fb\u5727\u8b66\u544a\u4e2d( throttled \u72b6\u614b) \u306e\u3068\u304d\u306f\u30010x50005\u00a0 \u3068\u8a18\u9332\u3055\u308c\u308b\u3002<\/p>\n<h3>\u4e00\u5b9a\u306e\u884c\u6570\u306b\u4fdd\u3064<\/h3>\n<p>\u30b9\u30af\u30ea\u30d7\u30c8\u306e\u5f8c\u534a\u306e\u4ee5\u4e0b\u306e\u90e8\u5206\u3067\u3001CSV\u30d5\u30a1\u30a4\u30eb\u306e\u884c\u6570\u304c2000\u884c\u306b\u9054\u3057\u305f\u3089\u3001\u6700\u65b0\u306e1440\u884c\u306b\u5207\u308a\u8a70\u3081\u3066\u3044\u308b\u3002<\/p>\n<pre class=\"lang:default decode:true \">lines=`\/usr\/bin\/wc -l $filename | \/usr\/bin\/cut -f 1 -d \" \"`\r\nif [ $lines -gt 2000 ]; then\r\n  \/usr\/bin\/cp -pf $filename $bakname\r\n  \/usr\/bin\/tail -n 1440 $bakname &gt; $filename\r\nfi<\/pre>\n<p>\u305f\u3068\u3048\u30701441\u884c\u306b\u306a\u3063\u305f\u30891440\u884c\u306b\u3059\u308b\u3068\u304b\u3084\u3063\u3066\u3057\u307e\u3046\u3068\u30011\u5206\u304a\u304d\u306b\u30d5\u30a1\u30a4\u30eb\u306e\u66f8\u304d\u76f4\u3057\u304c\u751f\u3058\u3066\u3057\u307e\u3063\u3066\u30ca\u30cb\u306a\u306e\u3067\u30012000\u884c\u306b\u9054\u3057\u3066\u304b\u3089\u66f8\u304d\u76f4\u3059\u3088\u3046\u306b\u3057\u305f\u3002<\/p>\n<p>\u3053\u306eraspi\u306f\u3001\u96fb\u6e90\u30b9\u30b1\u30b8\u30e5\u30fc\u30e9\u30dc\u30fc\u30c9\u306b\u8a2d\u5b9a\u3057\u305f\u30b9\u30b1\u30b8\u30e5\u30fc\u30eb\u306b\u5f93\u3063\u3066\u7a3c\u50cd\u3059\u308b\u306e\u3067\u3001\u5b9f\u969b\u306e\u3068\u3053\u308d1\u65e5\u6570\u6642\u9593\u7a0b\u5ea6\u3057\u304b\u52d5\u304b\u306a\u3044\u3002\u3053\u306e\u305f\u3081\u30012000\u884c\u306b\u9054\u3059\u308b\u307e\u3067\u306b2\u9031\u9593\u7a0b\u5ea6\u306f\u304b\u304b\u308b\u3002<\/p>\n<h3>crontab\u3067\u5b9f\u884c\u3059\u308b<\/h3>\n<p>\u3053\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u5b9a\u671f\u7684(1\u5206\u9593\u9694)\u3067\u5b9f\u884c\u3059\u308b\u305f\u3081\u3001\u30e6\u30fc\u30b6\u30fc pi \u306ecrontab\u306b\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u8a18\u8ff0\u3057\u305f\u3002<\/p>\n<pre class=\"lang:default decode:true \">*\/1 * * * * \/bin\/bash temp_monitor.sh 2&gt;&amp;1<\/pre>\n<h1>\u30b0\u30e9\u30d5\u8868\u793a<\/h1>\n<p>Google Chart\u3092\u4f7f\u3063\u3066\u30b3\u30a2\u3068PMIC\u306e\u6e29\u5ea6\u3092\u8868\u793a\u3059\u308b\u3088\u3046\u306b\u3057\u305f\u3002\u5ba4\u6e29\u304c\u4f4e\u3044\u306e\u3067\u3001\u30d5\u30a1\u30f3\u304c\u3088\u304f\u56de\u308b\u3088\u3046\u30b3\u30a2\u306b\u8ca0\u8377\u3092\u304b\u3051\u305f\u3068\u3053\u308d\u3001\u3053\u3093\u306a\u5177\u5408\u306e\u30b0\u30e9\u30d5\u306b\u306a\u3063\u305f(\u76f4\u8fd11\u6642\u9593\u306e\u30c7\u30fc\u30bf)\u3002<\/p>\n<figure id=\"attachment_13886\" aria-describedby=\"caption-attachment-13886\" style=\"width: 552px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/okiraku-camera.tokyo\/blog\/wp-content\/uploads\/2021\/12\/66c19942ab4ba346fdb64ccc04cde373-8.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-large wp-image-13886\" src=\"https:\/\/okiraku-camera.tokyo\/blog\/wp-content\/uploads\/2021\/12\/66c19942ab4ba346fdb64ccc04cde373-8-552x401.png\" alt=\"\" width=\"552\" height=\"401\" \/><\/a><figcaption id=\"caption-attachment-13886\" class=\"wp-caption-text\">raspi\u6e29\u5ea6\u30b0\u30e9\u30d5<\/figcaption><\/figure>\n<p>\u30b3\u30a2\u6e29\u5ea6\u304c\u6307\u5b9a\u4e0a\u9650\u306b\u9054\u3059\u308b\u3068\u3059\u3050\u306b\u30d5\u30a1\u30f3\u304c\u5468\u308a\u3060\u3059\u306e\u3067\u30011\u5206\u9593\u9694\u306e\u53d6\u5f97\u3067\u306f50\u2103\u304c\u30d5\u30a1\u30a4\u30eb\u8a18\u9332\u3055\u308c\u308b\u3053\u3068\u306f\u7a00\u3002\u4e0b\u9650\u306f40\u2103\u3060\u304c\u3001\u30d5\u30a1\u30f3\u304c\u6b62\u307e\u308b\u3068\u3059\u3050\u306b\u6e29\u5ea6\u304c\u4e0a\u304c\u308a\u59cb\u3081\u308b\u304b\u3089\u3001\u3084\u306f\u308a40\u2103\u306f\u306a\u304b\u306a\u304b\u8a18\u9332\u3055\u308c\u306a\u3044\u3002<\/p>\n<figure id=\"attachment_13889\" aria-describedby=\"caption-attachment-13889\" style=\"width: 552px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/okiraku-camera.tokyo\/blog\/wp-content\/uploads\/2021\/12\/66c19942ab4ba346fdb64ccc04cde373-9.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-large wp-image-13889\" src=\"https:\/\/okiraku-camera.tokyo\/blog\/wp-content\/uploads\/2021\/12\/66c19942ab4ba346fdb64ccc04cde373-9-552x395.png\" alt=\"\" width=\"552\" height=\"395\" \/><\/a><figcaption id=\"caption-attachment-13889\" class=\"wp-caption-text\">raspi\u6e29\u5ea6\u30b0\u30e9\u30d5<\/figcaption><\/figure>\n<p>\u51ac\u306a\u306e\u3067\uff1f \u8ca0\u8377\u3092\u304b\u3051\u308b\u306e\u3092\u3084\u3081\u305f\u308942\u2103\u524d\u5f8c\u306b\u843d\u3061\u7740\u3044\u305f\u3002\u590f\u306b\u306a\u3063\u305f\u3089gpio-fan\u30aa\u30fc\u30d0\u30fc\u30ec\u30a4\u306b\u4e0e\u3048\u308b\u30d1\u30e9\u30e1\u30fc\u30bf\u3082\u5909\u66f4\u3057\u3066\u3001\u30d5\u30a1\u30f3\u304c\u56de\u8ee2\u3092\u958b\u59cb\u3059\u308b\u6e29\u5ea6\u3092\u9ad8\u304f\u3057\u305f\u65b9\u304c\u3044\u3044\u306e\u3060\u308d\u3046\u3002<\/p>\n<h3>\u30b0\u30e9\u30d5\u8868\u793a\u7528\u306eshowlog.html (\u4fee\u6b63\u524d\u7248)<\/h3>\n<p>Google Chart\u3092\u4f7f\u3063\u3066\u30b0\u30e9\u30d5\u5316\u3059\u308b\u305f\u3081\u306b\u4ee5\u4e0b\u306e\u3088\u3046\u306aHTML\u30d5\u30a1\u30a4\u30eb\u3092\u7528\u610f\u3057\u305f\u3002showlog.html\u306f\u3001CSV\u30d5\u30a1\u30a4\u30eb\u306e temp_monitor.log \u3068\u540c\u3058 \/var\/www\/temp_monitor \u306b\u7f6e\u3044\u3066\u3044\u308b\u3002<\/p>\n<pre class=\"height-set:true lang:default decode:true\">&lt;HTML&gt;\r\n&lt;head&gt;\r\n&lt;meta charset=\"UTF-8\"\/&gt;\r\n&lt;title&gt;Raspi4 internal Temp.&lt;\/title&gt;\r\n&lt;script type=\"text\/javascript\" src=\"https:\/\/www.gstatic.com\/charts\/loader.js\"&gt;&lt;\/script&gt;\r\n&lt;style&gt;\r\ndiv#chart_div { height: 500px; width: 700px; border: 1px solid #000000; }\r\n&lt;\/style&gt;\r\n&lt;script&gt;\r\ngoogle.charts.load('current', {'packages':['line']});\r\n\r\nwindow.onload = function() {\r\n\tdocument.getElementById(\"range_sel\").value = 6;\r\n\tupdate_chart();\r\n}\r\n\r\nfunction show_chart(data, rows) {\r\n\tlet options = {\r\n\t\tchart: {\r\n\t\t\ttitle: \"raspi4 Internal Temperature (\" + rows + \" items)\",\r\n\t\t\tsubtitle: 'core and pmic (C)'\r\n\t\t},\r\n\t\tlineWidth: 1, \r\n\t\tfontSize: 14\r\n\r\n\t};\r\n\tvar chart = new google.charts.Line(document.getElementById(\"chart_div\"));\r\n\tchart.draw(data, options);\r\n}\r\n\r\nfunction tempchart(disp_period_h) {\r\n\tfetch(\"temp_monitor.log\").then(function(response) {\r\n\t\treturn response.text().then(function(text) { \r\n\t\t\tlet lines = text.split('\\n');\r\n\t\t\tif (lines.length &lt; 1) {\r\n\t\t\t\talert('no data');\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tlet data = new google.visualization.DataTable();\r\n\t\t\tdata.addRows(lines.length);\r\n\t\t\tdata.addColumn(\"date\", \"time\");\r\n\t\t\tdata.addColumn(\"number\", \"Core\");\r\n\t\t\tdata.addColumn(\"number\", \"PMIC\");\r\n\t\t\tlet rows = 0;\r\n\t\t\tlines.forEach(function(v, i){\r\n\t\t\t\tlet csv = v.split(',');\r\n\t\t\t\tlet tm = new Date(csv[0]);\r\n\t\t\t\tif (disp_period_h == 0) {\r\n\t\t\t\t\tdata.setValue(i, 0, tm);\r\n\t\t\t\t\tdata.setValue(i, 1, csv[1]);\r\n\t\t\t\t\tdata.setValue(i, 2, csv[2]);\r\n\t\t\t\t\trows++\r\n\t\t\t\t} else if (tm &gt; Date.now() - (disp_period_h * 60 * 60* 1000)) {\r\n\t\t\t\t\tdata.setValue(i, 0, tm);\r\n\t\t\t\t\tdata.setValue(i, 1, csv[1]);\r\n\t\t\t\t\tdata.setValue(i, 2, csv[2]);\r\n\t\t\t\t\trows++\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\tshow_chart(data, rows);\r\n\t\t});\r\n\t});\r\n}\r\n\r\nfunction update_chart() {\r\n\tlet period = document.getElementById(\"range_sel\").value;\r\n\ttempchart(period);\r\n\treturn 0;\r\n}\r\n&lt;\/script&gt;\r\n&lt;\/head&gt;\r\n&lt;body&gt;\r\n&lt;div  style=\"margin-left:8px; margin-bottom:12px; font-size:16px;vertical-align: middle;\"&gt;\r\nDisplay Range: \r\n&lt;select id=\"range_sel\" style=\"font-size:16px; \"&gt;\r\n&lt;option value=\"1\"&gt;1 hour&lt;\/option&gt;\r\n&lt;option value=\"2\"&gt;2 hours&lt;\/option&gt;\r\n&lt;option value=\"4\"&gt;4 hours&lt;\/option&gt;\r\n&lt;option value=\"6\"&gt;6 hours&lt;\/option&gt;\r\n&lt;option value=\"8\"&gt;8 hours&lt;\/option&gt;\r\n&lt;option value=\"12\"&gt;12 hours&lt;\/option&gt;\r\n&lt;option value=\"24\"&gt;24 hours&lt;\/option&gt;\r\n&lt;option value=\"48\"&gt;48 hours&lt;\/option&gt;\r\n&lt;option value=\"0\"&gt;ALL&lt;\/option&gt;\r\n&lt;\/select&gt;\r\n&lt;button id=\"bt_update\" type=\"button\" onclick=\"return update_chart();\"&gt;Update&lt;\/button&gt;\r\n&lt;\/div&gt;\r\n&lt;div id=\"chart_div\" style=\"display: block;\"&gt;&lt;\/div&gt;\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;\r\n<\/pre>\n<p>\u203b \u3053\u306ehtml\u306e show_chart() \u306b\u542b\u307e\u308c\u3066\u3044\u308b\u30b9\u30af\u30ea\u30d7\u30c8\u306b\u306f\u3001<strong>Material Chart\u3068\u5f93\u6765\u540c\u69d8\u306e &#8220;Classic&#8221; Line Chart\u306e\u8a18\u8ff0\u304c\u6df7\u5728<\/strong>\u3057\u3066\u3044\u3066\u3001\u3046\u307e\u304f\u3042\u308a\u307e\u305b\u3093\u3002\u30b0\u30e9\u30d5\u3068\u3057\u3066\u306f\u4e0a\u306b\u8f09\u305b\u305f\u3088\u3046\u306b\u8868\u793a\u3055\u308c\u3066\u307e\u3059\u304c\u3001options \u5185\u306e lineWidth: \u6307\u5b9a\u304c\u7121\u8996\u3055\u308c\u308b\u306a\u3069\u306e\u554f\u984c\u304c\u3042\u308a\u307e\u3057\u305f\u3002&#8221;Classic&#8221; LineChart \u306b\u66f8\u304d\u76f4\u3057\u305f\u3082\u306e\u3092\u6295\u7a3f\u306e\u6700\u5f8c\u306b\u8ffd\u52a0\u3057\u307e\u3057\u305f\u3002<\/p>\n<p><em>function tempchart()<\/em> \u304c\u4e3b\u8981\u90e8\u5206\u3067\u3001csv\u30d5\u30a1\u30a4\u30eb\u3092 <em>fetch()<\/em> \u3057\u3066\u5f97\u305f<em>response.text()<\/em> \u3092\u884c\u3054\u3068\u306b\u5206\u3051\u3001\u5404\u884c\u3054\u3068\u306bCSV\u3092\u5206\u89e3\u3057\u3066\u30b3\u30a2\u6e29\u5ea6\u3068PMIC\u6e29\u5ea6\u306e\u307f\u3092 <em>google.visualization.DataTable()<\/em> \u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u306b\u30bb\u30c3\u30c8\u3057\u3066\u3044\u308b\u3002\u3053\u306e\u3068\u304d\u306b\u3001\u73fe\u5728\u6642\u523b\u304b\u3089\u3069\u308c\u3060\u3051\u9061\u3063\u3066\u8868\u793a\u3059\u308b\u306e\u304b ( <em>disp_period_h<\/em> \u306b\u6642\u9593\u5358\u4f4d\u3067\u6307\u5b9a) \u306b\u5fdc\u3058\u3066\u3001\u30bb\u30c3\u30c8\u3059\u308b\u30c7\u30fc\u30bf\u3092\u9078\u629e\u3057\u3066\u3044\u308b\u3002<\/p>\n<p>HTML\u306eselect\/option \u3067\u8868\u793a\u3059\u308b\u6642\u9593\u3092\u6307\u5b9a\u3067\u304d\u308b\u3088\u3046\u306b\u3057\u3066\u3044\u308b\u3002\u524d\u306b\u3082\u66f8\u3044\u305f\u3088\u3046\u306b\u5fc5\u305a\u3057\u3082\u9023\u7d9a\u3057\u305f\u30c7\u30fc\u30bf\u3067\u306f\u306a\u3044\u306e\u3060\u304c\u3001Google Chart\u304c\u3046\u307e\u3044\u3053\u3068\u8868\u793a\u3057\u3066\u304f\u308c\u308b\u3002<\/p>\n<h2>Apache2\u304c\u5fc5\u8981<\/h2>\n<p>RHEL\u307f\u305f\u3044\u306bhttpd\u3092\u5c0e\u5165\u3059\u308b\u3093\u3060\u308d\u3046\u3068\u601d\u3063\u305f\u3089\u3001Apache2\u3060\u3063\u305f\u3057\u3001conf\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306e\u69cb\u6210\u3082\u9055\u3063\u3066\u3066\u3061\u3087\u3063\u3068\u6238\u60d1\u3063\u305f\u3002\u4e2d\u8eab\u306f\u540c\u3058\u306a\u3093\u3060\u308d\u3046\u3051\u3069\u3002<\/p>\n<p>\u4ee5\u4e0b\u306e temp_monitor.conf\u00a0 \u3092\u3001\/etc\/apach2\/conf-enabled \u306b\u683c\u7d0d\u3059\u308b\u3053\u3068\u3067\u3001\u540c\u3058\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u306ePC\u304b\u3089\u5229\u7528\u3067\u304d\u308b\u3088\u3046\u306b\u3057\u305f\u3002<\/p>\n<pre class=\"lang:default decode:true \">Alias \/temp_monitor \/var\/www\/temp_monitor\r\n\r\n&lt;Location \/temp_monitor&gt;\r\n    Order deny,allow\r\n    Allow from all\r\n    Allow from 127.0.0.1\r\n&lt;\/Location&gt;<\/pre>\n<h2>\u30b7\u30b9\u30ed\u30b0\u306b\u3064\u3044\u3066<\/h2>\n<p>\u95a2\u4fc2\u306a\u3044\u8a71\u306b\u601d\u3048\u308b\u304c\u3001<em>crontab<\/em>\u3092\u4f7f\u3046\u3088\u3046\u306b\u306a\u308a\u3001\u3057\u304b\u30821\u5206\u9593\u9694\u3067\u5b9f\u884c\u3055\u305b\u308b\u3068\u3001<em>syslog<\/em>\u30d5\u30a1\u30a4\u30eb\u306a\u3069\u306b\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306bcron\u30ed\u30b0\u304c\u5927\u91cf\u306b\u767a\u751f\u3059\u308b\u3002<\/p>\n<pre class=\"lang:default decode:true\">....\r\nDec 11 12:00:01 raspberrypi CRON[3769]: (pi) CMD (\/bin\/bash temp_monitor.sh 2&gt;&amp;1)\r\nDec 11 12:01:01 raspberrypi CRON[3856]: (pi) CMD (\/bin\/bash temp_monitor.sh 2&gt;&amp;1)\r\nDec 11 12:02:01 raspberrypi CRON[3880]: (pi) CMD (\/bin\/bash temp_monitor.sh 2&gt;&amp;1)\r\nDec 11 12:03:01 raspberrypi CRON[3903]: (pi) CMD (\/bin\/bash temp_monitor.sh 2&gt;&amp;1)\r\nDec 11 12:04:01 raspberrypi CRON[3927]: (pi) CMD (\/bin\/bash temp_monitor.sh 2&gt;&amp;1)\r\nDec 11 12:05:01 raspberrypi CRON[3952]: (pi) CMD (\/bin\/bash temp_monitor.sh 2&gt;&amp;1)\r\n....<\/pre>\n<p>\u307e\u305f\u3001<em>auth.log<\/em> \u30d5\u30a1\u30a4\u30eb\u306b\u3082\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u30ed\u30b0\u304c\u6b8b\u308b\u3002<\/p>\n<pre class=\"lang:default decode:true\">...\r\nDec 11 11:44:01 raspberrypi CRON[2056]: pam_unix(cron:session): session opened for user pi by (uid=0)\r\nDec 11 11:44:01 raspberrypi CRON[2056]: pam_unix(cron:session): session closed for user pi\r\nDec 11 11:45:01 raspberrypi CRON[2076]: pam_unix(cron:session): session opened for user root by (uid=0)\r\n...<\/pre>\n<p>\u3053\u308c\u306f\u3061\u3087\u3063\u3068\u8ff7\u60d1\u306a\u306e\u3067\u3001<em><span style=\"font-family: helvetica, arial, sans-serif;\">\/etc\/rsyslog.conf <\/span><\/em>\u3092\u7de8\u96c6\u3057\u3066\u300c\u9694\u96e2\u300d\u3059\u308b\u3053\u3068\u306b\u3057\u305f\u3002\u3064\u3044\u3067\u306b\u3001<em>rngd<\/em> \u306a\u3069\u3042\u307e\u308a\u6ce8\u76ee\u3057\u3066\u3044\u306a\u3044\u30c7\u30fc\u30e2\u30f3\u306e\u30ed\u30b0\u3082\u9694\u96e2\u3057\u305f\u308a\u3001snmpd\u304c\u5b9f\u884c\u6642\u306b\u51fa\u3059\u30a8\u30e9\u30fc\u3092\u6392\u9664\u3057\u305f\u308a\u3057\u3066\u3001rsyslog.conf \u306e\u4e3b\u8981\u90e8\u5206\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u306a\u3063\u305f\u3002<\/p>\n<pre class=\"lang:default decode:true\">#\r\n# First some standard log files.  Log by facility.\r\n#\r\nif $programname == 'snmpd' and $msg contains 'statfs' then stop\r\nif $syslogtag startswith \"CRON\" then {\r\n        action(type=\"omfile\" file=\"\/var\/log\/cron.log\")\r\n        stop\r\n}\r\nif $syslogtag startswith \"rngd\" then {\r\n        action(type=\"omfile\" file=\"\/var\/log\/rngd.log\")\r\n        stop\r\n}\r\nauth,authpriv.*                 \/var\/log\/auth.log\r\n*.*;auth,authpriv.none;kern.none        -\/var\/log\/syslog\r\n#cron.*                         \/var\/log\/cron.log\r\n# daemon.*                     -\/var\/log\/daemon.log\r\nkern.*                          -\/var\/log\/kern.log\r\n# lpr.*                                -\/var\/log\/lpr.log\r\nmail.*                          -\/var\/log\/mail.log\r\nuser.*                          -\/var\/log\/user.log<\/pre>\n<p>\u305d\u306e\u4ed6\u3001messages\u3084debug \u30d5\u30a1\u30a4\u30eb\u3078\u306e\u51fa\u529b\u3082\u6b62\u3081\u305f\u3002\u4e0a\u8a18\u306e\u3088\u3046\u306b\u8a2d\u5b9a\u3059\u308b\u3053\u3068\u3067\u3001syslog \u30d5\u30a1\u30a4\u30eb\u306e\u5185\u5bb9\u306f\u304b\u306a\u308a\u3055\u3063\u3071\u308a\u3057\u305f\u3082\u306e\u306b\u306a\u3063\u305f\u3002<\/p>\n<p><em>rsyslog.conf<\/em> \u306e\u8a2d\u5b9a\u5185\u5bb9\u306b\u3064\u3044\u3066\u306f\u3001\u00a0 <a href=\"https:\/\/www.rsyslog.com\/doc\/v8-stable\/configuration\/\" target=\"_blank\" rel=\"noopener\">https:\/\/www.rsyslog.com\/doc\/v8-stable\/configuration\/<\/a> \u3092\u53c2\u7167\u3057\u305f\u3002<\/p>\n<h4>logrotate\u3082\u8a2d\u5b9a\u5909\u66f4<\/h4>\n<p>\u307e\u305f\u3001<em><span style=\"font-family: helvetica, arial, sans-serif;\">\/etc\/logrotate.d\/rsyslog<\/span><\/em> \u3092\u5909\u66f4\u3057\u3001<em>cron.log<\/em> \u306f\u521d\u671f\u8a2d\u5b9a\u306eweekly\u30ed\u30fc\u30c6\u30fc\u30b7\u30e7\u30f3\u30674\u9031\u9593\u4fdd\u5b58\u3067\u306f\u306a\u304f\u3001syslog\u3068\u540c\u69d8\u306b\u6bce\u65e5\u30ed\u30fc\u30c6\u30fc\u30b7\u30e7\u30f3\u30677\u65e5\u9593\u4fdd\u5b58\u3068\u3057\u305f\u3002\u8ffd\u52a0\u3057\u305frngd.log \u3082\u540c\u69d8\u3002<\/p>\n<p>\u3044\u3061\u304a\u3046\u52d5\u4f5c\u72b6\u6cc1\u306f\u898b\u3048\u308b\u3088\u3046\u306b\u3057\u3066\u304a\u304d\u305f\u3044\u304c\u3001\u3055\u307b\u3069\u6ce8\u76ee\u3057\u3066\u3044\u306a\u3044\u306e\u3067\u3001\u3068\u3044\u3063\u305f\u8a2d\u5b9a\u3002<\/p>\n<h2>\u304d\u3087\u3046\u306e\u307e\u3068\u3081<\/h2>\n<p>\u96fb\u6e90\u30b9\u30b1\u30b8\u30e5\u30fc\u30e9\u306e\u30d7\u30ed\u30b0\u30e9\u30e0\u306e\u8a71\u3092\u66f8\u304f\u305f\u3081\u306b\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u8aad\u307f\u8fd4\u3057\u3066\u3044\u308b\u3068\u3001\u3069\u3046\u3057\u3066\u3082\u30d7\u30ed\u30b0\u30e9\u30e0\u81ea\u4f53\u3092\u76f4\u3057\u3066\u3057\u307e\u3063\u3066\u9032\u307e\u306a\u3044\u3002<\/p>\n<p>\u4ee5\u524d\u3001<a href=\"https:\/\/okiraku-camera.tokyo\/blog\/?p=4790\" target=\"_blank\" rel=\"noopener\">ESP-WROOM02\u3068\u6e29\u5ea6\u30bb\u30f3\u30b5\u30fc\u3067\u53d6\u5f97\u3057\u305f\u30c7\u30fc\u30bf\u3092\u30b0\u30e9\u30d5\u5316<\/a>\u3059\u308b\u3068\u304d\u3082Google Chart\u3092\u4f7f\u3063\u305f\u304c\u3001\u4f55\u5e74\u304b\u7d4c\u3063\u3066\u3044\u308b\u306e\u3067\u66f8\u304d\u65b9\u304c\u82e5\u5e72\u5909\u308f\u3063\u305f\u3088\u3046\u3060\u3063\u305f\u3002<\/p>\n<p>Apache2\u3092\u5165\u308c\u305f\u3064\u3044\u3067\u306b\u3001\u61d0\u304b\u3057\u306emrtg\u3082\u5165\u308c\u305f\u308a\u3057\u3066\u307f\u305f\u304c\u3001\u3082\u3046\u3061\u3087\u3063\u3068raspi\u3089\u3057\u3044\u3053\u3068\uff1f \u3057\u3066\u307f\u305f\u304f\u306f\u3042\u308a\u307e\u3059\u3002<\/p>\n<p>Google Chart \u3092\u8868\u793a\u3059\u308b\u30b3\u30fc\u30c9\u306b\u554f\u984c\u304c\u3042\u3063\u305f\u306e\u3067\u4fee\u6b63\u7248\u3092\u4f5c\u308a\u307e\u3057\u305f\u3002<\/p>\n<h2>\u8ffd\u8a18 &#8220;Classic&#8221;\u306aLineChart\u7248<\/h2>\n<p>Google Chart\u306b\u306f\u3001<strong>Material Design<\/strong> \u3068\u547c\u3070\u308c\u308b\u65b0\u3057\u3044\u30c1\u30e3\u30fc\u30c8\u63cf\u753b\u30aa\u30d7\u30b7\u30e7\u30f3(\u65b0\u3057\u3044\u3068\u3044\u3063\u3066\u30822014\u5e74\uff5e)\u3068\u3001\u5f93\u6765\u304b\u3089\u306e &#8220;Classic&#8221; Chart \u304c\u3042\u3063\u3066\u3001\u304a\u3082\u306b Options \u3068 \u6700\u521d\u306b\u30ed\u30fc\u30c9\u3059\u308bGoogle Visualization API \u306e\u30d1\u30c3\u30b1\u30fc\u30b8\u540d\u304c\u7570\u306a\u3063\u3066\u3044\u308b\u3002<\/p>\n<p>\u6700\u521d\u306b\u4f5c\u3063\u305f\u30b0\u30e9\u30d5\u306f\u3001\u5225\u306eMaterial Chart\u304b\u3089\u6d41\u7528\u3057\u305f\u3082\u306e\u3060\u3063\u305f\u306e\u3067\u3001\u305d\u308c\u3089\u306e\u305f\u3081\u306e\u6307\u5b9a\u304c\u6df7\u5728\u3057\u3066\u3057\u307e\u3044\u3001\u306a\u3093\u304b\u5999\u306a\u30b0\u30e9\u30d5\u306b\u306a\u3063\u3066\u3044\u305f\u3002<\/p>\n<h4>\u30d1\u30c3\u30b1\u30fc\u30b8\u540d<\/h4>\n<ul>\n<li>Classic\u7248\u3067\u306f<em>\u3001<strong>google.charts.load(&#8220;current&#8221;, {packages: [&#8220;corechart&#8221;]});<\/strong><\/em><\/li>\n<li>Material\u7248\u3067\u306f\u3001<strong><em> google.charts.load(&#8216;current&#8217;, {&#8216;packages&#8217;:[&#8216;line&#8217;]});<\/em><\/strong><\/li>\n<\/ul>\n<h5>\u30b0\u30e9\u30d5<\/h5>\n<p>\u4ee5\u524d\u306e\u30b0\u30e9\u30d5\u3068\u6bd4\u3079\u308b\u3068\u3001subtitle \u304c\u306a\u304f\u306a\u3063\u305f\u304c\u3001lineWidth\u6307\u5b9a\u306f\u6709\u52b9\u306b\u306a\u3063\u3066\u7dda\u304c\u7d30\u304f\u306a\u3063\u305f\u3002\u307e\u305f\u30c1\u30e3\u30fc\u30c8\u9818\u57df\u3068\u3057\u3066\u6307\u5b9a\u3057\u305fdiv\u5185\u306e\u5b9f\u969b\u306e\u30c1\u30e3\u30fc\u30c8\u306e\u5360\u3081\u308b\u4f4d\u7f6e\u3082\u660e\u793a\u7684\u306b\u6307\u5b9a\u3057\u3066\u3044\u308b(\u305d\u3046\u3057\u306a\u3044\u3068\u3001\u9699\u9593\u304c\u5927\u304d\u304b\u3063\u305f\u306e\u3067)\u3002<\/p>\n<figure id=\"attachment_13971\" aria-describedby=\"caption-attachment-13971\" style=\"width: 552px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/okiraku-camera.tokyo\/blog\/wp-content\/uploads\/2021\/12\/66c19942ab4ba346fdb64ccc04cde373-12.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-large wp-image-13971\" src=\"https:\/\/okiraku-camera.tokyo\/blog\/wp-content\/uploads\/2021\/12\/66c19942ab4ba346fdb64ccc04cde373-12-552x396.png\" alt=\"\" width=\"552\" height=\"396\" \/><\/a><figcaption id=\"caption-attachment-13971\" class=\"wp-caption-text\">raspi\u6e29\u5ea6\u30b0\u30e9\u30d5<\/figcaption><\/figure>\n<p>\u524d\u306b\u3084\u3063\u305f\u306e\u3068\u540c\u69d8\u306b\u3001raspi4\u306b\u904e\u5927\u306a\u8ca0\u8377\u3092\u304b\u3051\u3066gpio-fan \u3092\u3080\u308a\u3084\u308a\u56de\u3057\u3066\u307f\u305f\u3068\u3053\u308d\u3002\u73fe\u5728\u306f\u3001<strong>55\u2103\u3067\u30d5\u30a1\u30f3\u304c\u56de\u308b<\/strong>\u3088\u3046\u306b\u3057\u3066\u3044\u308b\u3002<\/p>\n<p>\u8ca0\u8377\u3092\u89e3\u9664\u3057\u3066\u3057\u3070\u3089\u304f\u3059\u308b\u3068\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u5e73\u71b1\uff1f\u306b\u623b\u3063\u305f\u3002<\/p>\n<figure id=\"attachment_13973\" aria-describedby=\"caption-attachment-13973\" style=\"width: 552px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/okiraku-camera.tokyo\/blog\/wp-content\/uploads\/2021\/12\/66c19942ab4ba346fdb64ccc04cde373-13.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-large wp-image-13973\" src=\"https:\/\/okiraku-camera.tokyo\/blog\/wp-content\/uploads\/2021\/12\/66c19942ab4ba346fdb64ccc04cde373-13-552x397.png\" alt=\"\" width=\"552\" height=\"397\" \/><\/a><figcaption id=\"caption-attachment-13973\" class=\"wp-caption-text\">raspi\u6e29\u5ea6\u30b0\u30e9\u30d5<\/figcaption><\/figure>\n<h5>showlog.html (Classic Line Chart\u7248)<\/h5>\n<p>\u4e0a\u306b\u8f09\u305b\u305f \u4e2d\u9014\u534a\u7aef\u306aMaterial \u7248\u3067\u306e\u6307\u5b9a\u306f\u30b3\u30e1\u30f3\u30c8\u3068\u3057\u3066\u6b8b\u3057\u305f\u3002<\/p>\n<pre class=\"height-set:true lang:default decode:true\">&lt;HTML&gt;\r\n&lt;head&gt;\r\n&lt;meta charset=\"UTF-8\"\/&gt;\r\n&lt;title&gt;Raspi4 internal Temp.&lt;\/title&gt;\r\n&lt;script type=\"text\/javascript\" src=\"https:\/\/www.gstatic.com\/charts\/loader.js\"&gt;&lt;\/script&gt;\r\n&lt;style&gt;\r\ndiv#chart_div { height: 500px; width: 700px; border: 1px solid #000000; }\r\n&lt;\/style&gt;\r\n&lt;script&gt;\r\n\/\/google.charts.load('current', {'packages':['line']});\r\ngoogle.charts.load(\"current\", {packages: [\"corechart\"]});\r\nwindow.onload = function() {\r\n    document.getElementById(\"range_sel\").value = 6;\r\n    update_chart();\r\n}\r\n\r\nfunction show_chart(data, rows) {\r\n    let options = {\r\n\/\/      chart: {\r\n\/\/          title: \"raspi4 Internal Temperature (\" + rows + \" items)\",\r\n\/\/          subtitle: 'core and pmic (C)'\r\n\/\/      },\r\n        title: \"raspi4 Internal Temperature (\" + rows + \" items)\",\r\n        titleTextStyle: {fontSize: 18, italic: 'yes'},\r\n        lineWidth: 1,\r\n        fontSize: 14,\r\n        chartArea: { left: 40, top: 60, width: '80%', height: '75%'}\r\n\r\n    };\r\n    var chart = new google.visualization.LineChart(document.getElementById(\"chart_div\"));\r\n\/\/  var chart = new google.charts.Line(document.getElementById(\"chart_div\"));\r\n    chart.draw(data, options);\r\n\/\/  chart.draw(data, google.charts.Line.convertOptions(options));\r\n}\r\nfunction tempchart(disp_period_h) {\r\n    fetch(\"temp_monitor.log\").then(function(response) {\r\n        return response.text().then(function(text) {\r\n            let lines = text.split('\\n');\r\n            if (lines.length &lt; 1) {\r\n                alert('no data');\r\n                return;\r\n            }\r\n            let data = new google.visualization.DataTable();\r\n            data.addRows(lines.length);\r\n            data.addColumn(\"date\", \"time\");\r\n            data.addColumn(\"number\", \"Core\");\r\n            data.addColumn(\"number\", \"PMIC\");\r\n            let rows = 0;\r\n            lines.forEach(function(v, i){\r\n                let csv = v.split(',');\r\n                let t = csv[0].split(' ');\r\n                let tm = new Date(t[0] + 'T' + t[1] + '.000+09:00');\r\n\r\n                if (disp_period_h == 0) {\r\n                    data.setValue(i, 0, tm);\r\n                    data.setValue(i, 1, csv[1]);\r\n                    data.setValue(i, 2, csv[2]);\r\n                    rows++\r\n                } else if (tm.getTime() &gt; (Date.now() - (disp_period_h * 60 * 60* 1000))) {\r\n                    data.setValue(i, 0, tm);\r\n                    data.setValue(i, 1, csv[1]);\r\n                    data.setValue(i, 2, csv[2]);\r\n                    rows++\r\n                }\r\n            });\r\n            show_chart(data, rows);\r\n        });\r\n    });\r\n}\r\nfunction update_chart() {\r\n    let period = document.getElementById(\"range_sel\").value;\r\n    tempchart(period);\r\n    return 0;\r\n}\r\n\r\n&lt;\/script&gt;\r\n&lt;\/head&gt;\r\n&lt;body&gt;\r\n&lt;div  style=\"margin-left:8px; margin-bottom:12px; font-size:16px;vertical-align: middle;\"&gt;\r\nDisplay Range:\r\n&lt;select id=\"range_sel\" style=\"font-size:16px; \"&gt;\r\n&lt;option value=\"1\"&gt;1 hour&lt;\/option&gt;\r\n&lt;option value=\"2\"&gt;2 hours&lt;\/option&gt;\r\n&lt;option value=\"4\"&gt;4 hours&lt;\/option&gt;\r\n&lt;option value=\"6\"&gt;6 hours&lt;\/option&gt;\r\n&lt;option value=\"8\"&gt;8 hours&lt;\/option&gt;\r\n&lt;option value=\"12\"&gt;12 hours&lt;\/option&gt;\r\n&lt;option value=\"24\"&gt;24 hours&lt;\/option&gt;\r\n&lt;option value=\"48\"&gt;48 hours&lt;\/option&gt;\r\n&lt;option value=\"0\"&gt;ALL&lt;\/option&gt;\r\n&lt;\/select&gt;\r\n&lt;button id=\"bt_update\" type=\"button\" onclick=\"return update_chart();\"&gt;Update&lt;\/button&gt;\r\n&lt;\/div&gt;\r\n\r\n&lt;div id=\"chart_div\" style=\"display: block;\"&gt;&lt;\/div&gt;\r\n\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;\r\n<\/pre>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6982\u8981 raspi4\u306egpio-fan\u30aa\u30fc\u30d0\u30fc\u30ec\u30a4\u3092\u4f7f\u3063\u3066\u3001SoC\u30b3\u30a2\u304c\u4e00\u5b9a\u306e\u6e29\u5ea6\u306b\u306a\u3063\u305f\u3089\u51b7\u5374\u30d5\u30a1\u30f3\u3092\u56de\u3059\u3002 \u30b3\u30a2\u6e29\u5ea6\u306e\u4e0a\u6607\u304c\u3069\u306e\u7a0b\u5ea6\u306a\u306e\u304b\u3001\u307e\u305f\u3001\u30d5\u30a1\u30f3\u306e\u52b9\u679c\u304c\u3069\u308c\u307b\u3069\u3042\u308b\u306e\u304b\u3092\u898b\u308b\u305f\u3081\u306b\u3001Google Chart\u3092\u4f7f &hellip; <a href=\"https:\/\/okiraku-camera.tokyo\/blog\/?p=13884\" class=\"more-link\">\u7d9a\u304d\u3092\u8aad\u3080 <span class=\"screen-reader-text\">gpio-fan\u306e\u52b9\u679c\u3092\u898b\u308b\u305f\u3081\u3001raspi4\u306e\u6e29\u5ea6\u3092\u6e2c\u3063\u3066\u30b0\u30e9\u30d5\u306b\u3059\u308b<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[69],"tags":[189,188,173],"class_list":["post-13884","post","type-post","status-publish","format-standard","hentry","category-programming","tag-google_chart","tag-gpio-fan","tag-raspberry_pi"],"_links":{"self":[{"href":"https:\/\/okiraku-camera.tokyo\/blog\/index.php?rest_route=\/wp\/v2\/posts\/13884","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/okiraku-camera.tokyo\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/okiraku-camera.tokyo\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/okiraku-camera.tokyo\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/okiraku-camera.tokyo\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=13884"}],"version-history":[{"count":0,"href":"https:\/\/okiraku-camera.tokyo\/blog\/index.php?rest_route=\/wp\/v2\/posts\/13884\/revisions"}],"wp:attachment":[{"href":"https:\/\/okiraku-camera.tokyo\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=13884"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/okiraku-camera.tokyo\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=13884"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/okiraku-camera.tokyo\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=13884"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}