{"id":606,"date":"2020-07-02T11:23:38","date_gmt":"2020-07-02T03:23:38","guid":{"rendered":"https:\/\/www.iotch.xyz\/?p=606"},"modified":"2020-07-02T11:23:38","modified_gmt":"2020-07-02T03:23:38","slug":"pi-dashboard-pi-%e4%bb%aa%e8%a1%a8%e7%9b%98","status":"publish","type":"post","link":"https:\/\/www.iotch.xyz\/?p=606","title":{"rendered":"Pi Dashboard (Pi \u4eea\u8868\u76d8)"},"content":{"rendered":"\n<p>Pi Dashboard (Pi \u4eea\u8868\u76d8) \u662f\u4e00\u4e2a\u5f00\u6e90\u7684 IoT \u8bbe\u5907\u76d1\u63a7\u5de5\u5177\uff0c\u76ee\u524d\u4e3b\u8981\u9488\u5bf9\u6811\u8393\u6d3e\u5e73\u53f0\uff0c\u4e5f\u5c3d\u53ef\u80fd\u517c\u5bb9\u5176\u4ed6\u7c7b\u6811\u8393\u6d3e\u786c\u4ef6\u4ea7\u54c1\u3002\u4f60\u53ea\u9700\u8981\u5728\u6811\u8393\u6d3e\u4e0a\u5b89\u88c5\u597d PHP \u670d\u52a1\u5668\u73af\u5883\uff0c\u5373\u53ef\u65b9\u4fbf\u7684\u90e8\u7f72\u4e00\u4e2a Pi \u4eea\u8868\u76d8\uff0c\u901a\u8fc7\u70ab\u9177\u7684 WebUI \u6765\u76d1\u63a7\u6811\u8393\u6d3e\u7684\u72b6\u6001\uff01<\/p>\n\n\n\n<p>\u76ee\u524d\u5df2\u52a0\u5165\u7684\u76d1\u6d4b\u9879\u76ee\u6709\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>CPU \u57fa\u672c\u4fe1\u606f\u3001\u72b6\u6001\u548c\u4f7f\u7528\u7387\u7b49\u5b9e\u65f6\u6570\u636e<\/li><li>\u5185\u5b58\u3001\u7f13\u5b58\u3001SWAP\u5206\u533a\u4f7f\u7528\u7684\u5b9e\u65f6\u6570\u636e<\/li><li>SD\u5361\uff08\u78c1\u76d8\uff09\u7684\u5360\u7528\u60c5\u51b5<\/li><li>\u5b9e\u65f6\u8d1f\u8f7d\u6570\u636e<\/li><li>\u5b9e\u65bd\u8fdb\u7a0b\u6570\u636e<\/li><li>\u7f51\u7edc\u63a5\u53e3\u7684\u5b9e\u65f6\u6570\u636e<\/li><li>\u6811\u8393\u6d3eIP\u3001\u8fd0\u884c\u65f6\u95f4\u3001\u64cd\u4f5c\u7cfb\u7edf\u3001HOST \u7b49\u57fa\u7840\u4fe1\u606f<\/li><\/ul>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<h4 class=\"wp-block-heading\">\u4eea\u8868\u76d8\u9884\u89c8<\/h4>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"http:\/\/shumeipai.nxez.com\/wp-content\/uploads\/2017\/08\/20170831005933963-0.jpg\" alt=\"\" title=\"\"\/><\/figure>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<h4 class=\"wp-block-heading\">\u5b89\u88c5\u65b9\u6cd5<\/h4>\n\n\n\n<p>\u5b89\u88c5\u51712\u6b65\uff0c\u9996\u5148\u5b89\u88c5 Nginx\uff08\u6216 Apache\uff09\u548c PHP\u3002\u7136\u540e\u5728 Nginx \u76ee\u5f55\u901a\u8fc7 SFTP \u6216 GitHub \u90e8\u7f72\u597d\u672c\u9879\u76ee\u7684\u7a0b\u5e8f\u3002<\/p>\n\n\n\n<h5 class=\"wp-block-heading\">1.\u5b89\u88c5 Nginx \u548c PHP<\/h5>\n\n\n\n<p>\u5728 Pi \u7684\u7ec8\u7aef\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt-get update\nsudo apt-get install nginx php7.3-fpm php7.3-cli php7.3-curl php7.3-gd php7.3-cgi\nsudo service nginx start\nsudo service php7.3-fpm restart<\/code><\/pre>\n\n\n\n<p>\u5982\u679c\u5b89\u88c5\u6210\u529f\uff0c\u53ef\u901a\u8fc7 <code>http:\/\/\u6811\u8393\u6d3eIP<\/code> \u8bbf\u95ee\u5230 Nginx \u7684\u9ed8\u8ba4\u9875\u3002Nginx \u7684\u6839\u76ee\u5f55\u5728 <code>\/var\/www\/html<\/code>\u3002<br>\u8fdb\u884c\u4ee5\u4e0b\u64cd\u4f5c\u6765\u8ba9 Nginx \u80fd\u5904\u7406 PHP\u3002<br><code>sudo nano \/etc\/nginx\/sites-available\/default<\/code><\/p>\n\n\n\n<p>\u5c06\u5176\u4e2d\u7684\u5982\u4e0b\u5185\u5bb9<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>location \/ {\n                # First attempt to serve request as file, then\n                # as directory, then fall back to displaying a 404.\n                try_files $uri $uri\/ =404;\n        }<\/code><\/pre>\n\n\n\n<p>\u66ff\u6362\u4e3a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>location \/ {\nindex  index.html index.htm index.php default.html default.htm default.php;\n}\n \nlocation ~\\.php$ {\nfastcgi_pass unix:\/run\/php\/php7.3-fpm.sock;\n#fastcgi_pass 127.0.0.1:9000;\nfastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;\ninclude fastcgi_params;\n}<\/code><\/pre>\n\n\n\n<p>Ctrl + O \u4fdd\u5b58\u518d Ctrl + X \u9000\u51fa\u3002<\/p>\n\n\n\n<p><code>sudo service nginx restart<\/code><\/p>\n\n\n\n<p>\u6700\u540e\u91cd\u542f Nginx \u5373\u53ef\uff0c\u4ee5\u4e0a\u6b65\u9aa4\u5728\u6811\u8393\u6d3e Zero + <code>Linux version 4.9.41+<\/code> \u7cfb\u7edf\u7248\u672c\u4e0a\u6d4b\u8bd5\u901a\u8fc7\u3002<\/p>\n\n\n\n<p>\u5bf9\u5728\u6811\u8393\u6d3e\u4e0a\u90e8\u7f72 LNMP \u6709\u5174\u8da3\u53ef\u4ee5\u53c2\u8003\u8fd9\u7bc7\u66f4\u8be6\u7ec6\u7684\u4ecb\u7ecd\u300a<a target=\"_blank\" href=\"http:\/\/shumeipai.nxez.com\/2013\/08\/25\/install-and-config-lnmp.html\" rel=\"noreferrer noopener\" rel=\"nofollow\" >\u6811\u8393\u6d3e\u642d\u5efaLNMP\u73af\u5883<\/a>\u300b\u3002<\/p>\n\n\n\n<h5 class=\"wp-block-heading\">2.\u90e8\u7f72 Pi Dashboard<\/h5>\n\n\n\n<p>\u8fd9\u91cc\u4ecb\u7ecd\u4e24\u79cd\u65b9\u6cd5\u5c06 Pi Dashboard \u90e8\u7f72\u5728 Nginx \u4e0a\u3002<br><strong>2.1. SFTP \u4e0a\u4f20<\/strong><br>\u5728 GitHub \u4e0b\u8f7d\u672c\u9879\u76ee\u6e90\u7801\u3002<a target=\"_blank\" href=\"http:\/\/shumeipai.nxez.com\/2013\/09\/07\/use-the-remote-sftp-file-transfer-raspberry-pi.html\" rel=\"noreferrer noopener\" rel=\"nofollow\" >\u901a\u8fc7 FileZilla \u7b49 FTP \u8f6f\u4ef6<\/a>\u5c06\u89e3\u538b\u51fa\u6765\u7684\u76ee\u5f55\u4e0a\u4f20\u5230\u6811\u8393\u6d3e\u7684 <code>\/var\/www\/html<\/code> \u76ee\u5f55\u4e0b\u3002<br>\u90a3\u4e48\u53ef\u4ee5\u901a\u8fc7 <code>http:\/\/\u6811\u8393\u6d3eIP\/pi-dashboard<\/code> \u8bbf\u95ee\u90e8\u7f72\u597d\u4e86\u7684 Pi Dashboard\u3002<\/p>\n\n\n\n<p>\u5982\u679c\u9875\u9762\u65e0\u6cd5\u663e\u793a\uff0c\u53ef\u4ee5\u5c1d\u8bd5\u5728\u6811\u8393\u6d3e\u7ec8\u7aef\u7ed9\u6e90\u7801\u6dfb\u52a0\u8fd0\u884c\u6743\u9650\uff0c\u4f8b\u5982\u4f60\u4e0a\u4f20\u4e4b\u540e\u7684\u8def\u5f84\u662f <code>\/var\/www\/html\/pi-dashboard<\/code>\uff0c\u5219\u8fd0\u884c\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>cd \/var\/www\/html\nsudo chown -R www-data pi-dashboard<\/code><\/pre>\n\n\n\n<p><strong>2.2. GitHub \u90e8\u7f72<\/strong><br>\u5982\u679c\u4f60\u4e86\u89e3\u8fc7 GitHub \u7684\u57fa\u672c\u64cd\u4f5c\uff0c\u901a\u8fc7 GitHub \u6765\u4e0b\u8f7d\u672c\u9879\u76ee\u5230 Pi \u4e0a\u4f1a\u76f8\u5f53\u65b9\u4fbf\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#\u5982\u679c\u5df2\u5b89\u88c5\u8fc7 git \u5ba2\u6237\u7aef\u53ef\u4ee5\u8df3\u8fc7\u4e0b\u4e00\u884c\nsudo apt-get install git\ncd \/var\/www\/html\nsudo git clone https:\/\/github.com\/spoonysonny\/pi-dashboard.git<\/code><\/pre>\n\n\n\n<p>\u5373\u53ef\u901a\u8fc7 <code>http:\/\/\u6811\u8393\u6d3eIP\/pi-dashboard<\/code> \u8bbf\u95ee\u90e8\u7f72\u597d\u4e86\u7684 Pi Dashboard\u3002<\/p>\n\n\n\n<p>\u540c\u6837\u5982\u679c\u9875\u9762\u65e0\u6cd5\u663e\u793a\uff0c\u53ef\u4ee5\u5c1d\u8bd5\u5728\u6811\u8393\u6d3e\u7ec8\u7aef\u7ed9\u6e90\u7801\u6dfb\u52a0\u8fd0\u884c\u6743\u9650\uff0c\u4f8b\u5982\u4f60\u4e0a\u4f20\u4e4b\u540e\u7684\u8def\u5f84\u662f <code>\/var\/www\/html\/pi-dashboard<\/code>\uff0c\u5219\u8fd0\u884c\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>cd \/var\/www\/html\nsudo chown -R www-data pi-dashboard<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<h4 class=\"wp-block-heading\">\u5e38\u89c1\u95ee\u9898<\/h4>\n\n\n\n<p>Q\uff1a\u6211\u7684\u6811\u8393\u6d3e\u5b89\u88c5\u4e0d\u4e86PHP5\uff0fPHP7\u600e\u4e48\u529e\uff1f<br>A\uff1a\u53ef\u4ee5\u53c2\u8003\u8fde\u63a5\u8868\u4e2d\u7684\u6587\u7ae0\u94fe\u63a5\uff0c\u9488\u5bf9\u4e0d\u540c\u7684PHP\u7248\u672c\u8fdb\u884c\u64cd\u4f5c\u3002<\/p>\n\n\n\n<p>Q\uff1aPi Dashboard \u7684 WebUI \u652f\u6301\u5728\u54ea\u4e9b\u7ec8\u7aef\u4e0a\u67e5\u770b\uff1f<br>A\uff1a\u4efb\u4f55\u5e26\u6709\u6d4f\u89c8\u5668\u7684\u7ec8\u7aef\u90fd\u53ef\u4ee5\u67e5\u770b\uff0c\u65e0\u8bba\u662f\u5728\u5185\u7f51\u8fd8\u662f\u5916\u7f51\u7684\u7535\u8111\u3001Pad\u6216\u662f\u667a\u80fd\u624b\u673a\u4e0a\u3002Pi Dashboard \u5bf9\u4e0d\u540c\u7684\u8bbe\u5907\u505a\u4e86\u54cd\u5e94\u5f0f\u5e03\u5c40\uff0c\u80fd\u5f88\u597d\u517c\u5bb9\u624b\u673a\u6d4f\u89c8\u3002<\/p>\n\n\n\n<p>Q\uff1a\u6211\u6ca1\u6cd5\u901a\u8fc7\u5916\u7f51IP\u8bbf\u95ee\u5230\u600e\u4e48\u529e\uff1f<br>A\uff1a\u56fd\u5185\u5f88\u591a\u5730\u533a\u7684ISP\u90fd\u4e0d\u63d0\u4f9b\u72ec\u7acb\u7684\u5916\u7f51IP\u4e86\uff0c\u53ef\u4ee5\u901a\u8fc7\u82b1\u751f\u58f3\u7b49\u5de5\u5177\u5b9e\u73b0\u5916\u7f51\u8bbf\u95ee\u3002\u5bf9\u4e8e\u5df2\u6709\u5916\u7f51\u72ec\u7acbIP\u7684\u7528\u6237\uff0c\u53ef\u4ee5\u5c1d\u8bd5\u628a Nginx \u670d\u52a1\u7aef\u53e3\u4ece 80 \u6539\u6210\u5176\u4ed6\u7aef\u53e3\u53f7\uff0c\u518d\u5728 IP \u5730\u5740\u540e\u6dfb\u52a0\u7aef\u53e3\u53f7\u8bbf\u95ee\u3002\u8fd9\u662f\u56e0\u4e3a\u56fd\u5185ISP\u666e\u904d\u7981\u7528\u4e8680\u7aef\u53e3\u3002<\/p>\n\n\n\n<p>Q\uff1a\u6211\u6709\u4e00\u4e2a\u57df\u540d\uff0c\u5982\u4f55\u5c06\u57df\u540d\u7ed1\u5b9a\u5230\u6811\u8393\u6d3e\u4e0a\uff1f<br>A\uff1a\u53ef\u4ee5\u53c2\u8003<a target=\"_blank\" href=\"http:\/\/shumeipai.nxez.com\/2013\/09\/17\/dnspod-update-dynamic-ip-resolution.html\" rel=\"noreferrer noopener\" rel=\"nofollow\" >DNSPod\u52a8\u6001IP\u89e3\u6790\u66f4\u65b0\u7a0b\u5e8f<\/a>\u548c<a target=\"_blank\" href=\"http:\/\/shumeipai.nxez.com\/2013\/08\/25\/install-and-config-lnmp.html\" rel=\"noreferrer noopener\" rel=\"nofollow\" >\u6811\u8393\u6d3e\u642d\u5efaLNMP\u73af\u5883<\/a>\u3002\u5c06\u57df\u540d\u6307\u5411\u6811\u8393\u6d3eIP\u540e\u9700\u8981\u4fee\u6539 Nginx \u7f51\u7ad9\u914d\u7f6e\u7684 servername \u8fd9\u9879\u4e3a\u4f60\u7684\u57df\u540d\u5373\u53ef\u3002<\/p>\n\n\n\n<p>Q\uff1a\u4f7f\u7528\u9047\u5230\u95ee\u9898\u53ef\u4ee5\u63d0\u4f9b\u6280\u672f\u652f\u6301\u5417\uff1f<br>A\uff1a\u53ef\u4ee5\u901a\u8fc7 <a target=\"_blank\" href=\"https:\/\/talk.quwj.com\/\" rel=\"noreferrer noopener\" rel=\"nofollow\" >https:\/\/talk.quwj.com\/<\/a> \u53d1\u5e16\u83b7\u5f97\u5e2e\u52a9\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<h4 class=\"wp-block-heading\">\u4f7f\u7528\u6761\u6b3e<\/h4>\n\n\n\n<p>\u672c\u9879\u76ee\u662f\u5f00\u6e90\u9879\u76ee\uff0cNXEZ.com \u4fdd\u7559\u4f5c\u4e3a\u53d1\u8d77\u8005\u7684\u6743\u5229\u3002<br>\u5141\u8bb8\u5728 GPL v3.0 \u534f\u8bae\u4e0b\u5bf9\u9879\u76ee\u8fdb\u884c\u4f7f\u7528\u3002\u8bf7\u52a1\u5fc5\u5728\u4fdd\u8bc1\u9879\u76ee\u7684\u51fa\u5904\u3001\u58f0\u660e\u3001\u8d85\u94fe\u63a5\u7b49\u5185\u5bb9\u5b8c\u6574\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<h4 class=\"wp-block-heading\">\u5b8c\u5584\u8ba1\u5212<\/h4>\n\n\n\n<p>\u6b22\u8fce\u6709\u5174\u8da3\u7684\u670b\u53cb\u901a\u8fc7 GitHub \u53c2\u4e0e\u5230\u672c\u9879\u76ee\u7684\u5b8c\u5584\u3002\u4e0b\u9762\u662f\u9879\u76ee\u540e\u7eed\u5b8c\u5584\u7684\u51e0\u4e2a\u65b9\u5411\u3002<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>\u8ba1\u5212\u5b8c\u5584 Device \u578b\u53f7\u8bc6\u522b\uff0c\u9700\u8981\u6536\u96c6\u5404\u79cd Device \u7684\u786c\u4ef6\u7279\u5f81\u3002<\/li><li>\u5bf9\u901a\u7528 Linux \u7cfb\u7edf\u505a\u9002\u914d\u4f18\u60e0\u3002<\/li><li>\u4e0d\u540c\u98ce\u683c UI \u7684\u52a0\u5165\u3002<\/li><\/ul>\n\n\n\n<h5 class=\"wp-block-heading\">\u94fe\u63a5\u8868<\/h5>\n\n\n\n<ul class=\"wp-block-list\"><li><a rel=\"noreferrer noopener\" target=\"_blank\" href=\"https:\/\/github.com\/spoonysonny\/pi-dashboard\" rel=\"nofollow\" >GitHub<\/a><\/li><li><a rel=\"noreferrer noopener\" target=\"_blank\" href=\"https:\/\/make.quwj.com\/page\/13\" rel=\"nofollow\" >NGINX+PHP5 \u4e0b\u7684\u914d\u7f6e\u65b9\u6cd5<\/a><\/li><li><a rel=\"noreferrer noopener\" target=\"_blank\" href=\"http:\/\/shumeipai.nxez.com\/2017\/08\/31\/pi-dashboard-released.html\" rel=\"nofollow\" >NGINX+PHP5 \u4e0b\u7684\u914d\u7f6e\u65b9\u6cd5\uff0c\u6811\u8393\u6d3e\u5b9e\u9a8c\u5ba4<\/a><\/li><li><a rel=\"noreferrer noopener\" target=\"_blank\" href=\"http:\/\/shumeipai.nxez.com\/2018\/04\/25\/install-pi-dashboard-with-nginx-php7-on-pi.html\" rel=\"nofollow\" >NGINX+PHP7 \u4e0b\u7684\u914d\u7f6e\u65b9\u6cd5\uff0c\u6811\u8393\u6d3e\u5b9e\u9a8c\u5ba4<\/a><\/li><li><a rel=\"noreferrer noopener\" target=\"_blank\" href=\"https:\/\/shumeipai.nxez.com\/2020\/03\/21\/install-pi-dashboard-with-nginx-php73-on-pi.html\" rel=\"nofollow\" >\u5728 \u201cRaspbian \u4e0a\u90e8\u7f72 LNMP + Pi Dashboard\uff0cPHP7.3<\/a><\/li><\/ul>\n\n\n\n<p>\u539f\u6587\u94fe\u63a5\uff1a<a href=\"https:\/\/make.quwj.com\/project\/10\" target=\"_blank\"  rel=\"nofollow\" >https:\/\/make.quwj.com\/project\/10<\/a><\/p>\n<button class=\"simplefavorite-button\" data-postid=\"606\" data-siteid=\"1\" data-groupid=\"1\" data-favoritecount=\"0\" style=\"\">\u6536\u85cf <i class=\"sf-icon-star-empty\"><\/i><\/button>","protected":false},"excerpt":{"rendered":"<p>Pi Dashboard (Pi \u4eea\u8868\u76d8) \u662f\u4e00\u4e2a\u5f00\u6e90\u7684 IoT \u8bbe\u5907\u76d1\u63a7\u5de5\u5177\uff0c\u76ee\u524d\u4e3b\u8981\u9488\u5bf9\u6811\u8393\u6d3e\u5e73\u53f0\uff0c\u4e5f\u5c3d\u53ef\u80fd\u517c\u5bb9\u5176\u4ed6\u7c7b\u6811\u8393\u6d3e\u786c &#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11],"tags":[],"class_list":["post-606","post","type-post","status-publish","format-standard","hentry","category-11"],"_links":{"self":[{"href":"https:\/\/www.iotch.xyz\/index.php?rest_route=\/wp\/v2\/posts\/606","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.iotch.xyz\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.iotch.xyz\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.iotch.xyz\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.iotch.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=606"}],"version-history":[{"count":0,"href":"https:\/\/www.iotch.xyz\/index.php?rest_route=\/wp\/v2\/posts\/606\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.iotch.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=606"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.iotch.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=606"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.iotch.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=606"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}