{"id":706,"date":"2020-08-13T22:48:19","date_gmt":"2020-08-13T14:48:19","guid":{"rendered":"https:\/\/www.iotch.xyz\/?p=706"},"modified":"2020-08-13T22:48:19","modified_gmt":"2020-08-13T14:48:19","slug":"%e6%a0%91%e8%8e%93%e6%b4%be%e5%ae%89%e8%a3%85homeassistant%e5%85%a8%e6%b5%81%e7%a8%8b","status":"publish","type":"post","link":"https:\/\/www.iotch.xyz\/?p=706","title":{"rendered":"\u6811\u8393\u6d3e\u5b89\u88c5homeassistant\u5168\u6d41\u7a0b"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">1.\u5b89\u88c5\u7cfb\u7edf<\/h2>\n\n\n\n<p>\u5229\u7528balenaEtcher\u5237\u5199stretch\u7248\u672c\u56fa\u4ef6\u5230SD\u5361\uff0c\u5b8c\u6bd5\u540e\uff0c\u91cd\u65b0\u63d2\u5165SD\u5361\uff0c\u65b0\u5efa\u4e00\u4e2assh\u7684\u6587\u4ef6<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u5f00\u542froot\u8d26\u6237<\/h2>\n\n\n\n<p>sudo passwd root #\u4e3aroot\u8bbe\u7f6e\u5bc6\u7801<\/p>\n\n\n\n<p>sudo passwd --unlock root\u89e3\u9501root\u8d26\u6237<\/p>\n\n\n\n<p>\u4f1a\u63d0\u793a\uff1apassword expiry information changed<\/p>\n\n\n\n<p>sudo nano \/etc\/ssh\/sshd_config<\/p>\n\n\n\n<p>\u4fee\u6539PermitRootLogin without-password-&gt;PermitRootLogin yes<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">2.\u6362\u6e90<\/h2>\n\n\n\n<p>sudo nano \/etc\/apt\/sources.list.d\/raspi.list<\/p>\n\n\n\n<p>deb https:\/\/mirrors.tuna.tsinghua.edu.cn\/raspberrypi\/ stretch main ui<\/p>\n\n\n\n<p>\u5305\u62ecraspi-config\\minecraftpi\\\u684c\u9762\u73af\u5883\u3001\u5185\u6838\u56fa\u4ef6\u9a71\u52a8\u7b49\u5c11\u91cf\u8f6f\u4ef6<\/p>\n\n\n\n<p>sudo nano \/etc\/apt\/sources.list<\/p>\n\n\n\n<p>deb https:\/\/mirrors.tuna.tsinghua.edu.cn\/raspbian\/raspbian\/ stretch main contrib non-free rpi<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">3.\u8bbe\u7f6e\u6811\u8393\u6d3e3 B+\u7684\u9759\u6001IP<\/h2>\n\n\n\n<p>\u4fee\u6539<em>\/etc\/dhcpcd.conf&nbsp;<\/em>\u6587\u4ef6<\/p>\n\n\n\n<p>sudo nano&nbsp;<em>\/etc\/dhcpcd.conf<\/em><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>interface eth0\n\nstatic ip_address=192.168.0.10\/24\nstatic routers=192.168.0.1\nstatic domain_name_servers=192.168.0.1\n\ninterface wlan0\n\nstatic ip_address=192.168.0.200\/24\nstatic routers=192.168.0.1\nstatic domain_name_servers=192.168.0.1<\/code><\/pre>\n\n\n\n<p>\u4e0a\u9762\u7684\u914d\u7f6e\u6587\u4ef6\u4e2d , eth0\u662f\u6709\u7ebf\u7684\u914d\u7f6e &nbsp;, wlan0\u662f\u65e0\u7ebf\u914d\u7f6e<\/p>\n\n\n\n<p>ip_address\u5c31\u662f\u9759\u6001IP , \u540e\u9762\u8981\u63a5\/24<\/p>\n\n\n\n<p>routers\u662f\u7f51\u5173<\/p>\n\n\n\n<p>static domain_name_servers\u662fDNS<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">4.\u7f16\u8bd1\u5b89\u88c5python3.7.3<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt-get update\nsudo apt-get upgrade\nsudo apt-get dist-upgrade<\/code><\/pre>\n\n\n\n<p>\u5b89\u88c5python\u4f9d\u8d56\u73af\u5883<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt-get install build-essential libsqlite3-dev sqlite3 bzip2 libbz2-dev libssl-dev openssl libgdbm-dev liblzma-dev libreadline-dev libncursesw5-dev libffi-dev\n<\/code><\/pre>\n\n\n\n<p>\u4e0b\u8f7dpython3.7.3\u7248\u672c\u6e90\u7801\u5e76\u89e3\u538b<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>wget https:\/\/www.python.org\/ftp\/python\/3.7.3\/Python-3.7.3.tar.xz\ntar -xvf Python-3.7.3.tar.xz\ncd Python-3.7.3\nsudo .\/configure --prefix=\/usr\/local\/opt\/python3.7\nsudo make \nsudo make install<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">\u5b89\u88c5Python2.7<\/h2>\n\n\n\n<p>wget https:\/\/www.python.org\/ftp\/python\/2.7.13\/Python-2.7.13.tgz<br>tar -zxf Python-2.7.13.tgz<br>cd Python-2.7.13<br>sudo .\/configure --prefix=\/usr\/local\/opt\/python2.7<br>sudo make&nbsp;<br>sudo make install<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u5b89\u88c5python2.7\u7684pip<\/h2>\n\n\n\n<p>&nbsp;curl https:\/\/bootstrap.pypa.io\/get-pip.py -o get-pip.py<br>sudo python get-pip.py<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u5b89\u88c5homeassistant<\/h2>\n\n\n\n<p>cd \/usr\/local\/opt\/python3.7\/bin<\/p>\n\n\n\n<p>sudo .\/pip3.7 install --upgrade pip<\/p>\n\n\n\n<p>sudo .\/pip3.7 install homeassistant<\/p>\n\n\n\n<p>.\/hass<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u5b89\u88c5MPD<\/h2>\n\n\n\n<figure class=\"wp-block-embed\"><div class=\"wp-block-embed__wrapper\">\nhttps:\/\/bbs.hassbian.com\/thread-5439-1-1.html\n<\/div><\/figure>\n\n\n\n<p>\u5b89\u88c5MQTT<\/p>\n\n\n\n<p>sudo apt-get install mosquitto<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u5b89\u88c5NO<\/h2>\n\n\n\n<h2 class=\"wp-block-heading\">DERed<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>bash &lt;(curl -sL https:\/\/raw.githubusercontent.com\/node-red\/linux-installers\/master\/deb\/update-nodejs-and-nodered)<\/code><\/pre>\n\n\n\n<p>\u4e0a\u9762\u5931\u6548\u65f6<\/p>\n\n\n\n<p>sudo apt install npm<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>npm update -g<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>npm install -g n<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>n latest<\/code><\/pre>\n\n\n\n<p>sudo npm install -g --unsafe-perm node-red<\/p>\n\n\n\n<p>node-red<\/p>\n\n\n\n<p><a href=\"https:\/\/github.com\/node-red\/node-red\" target=\"_blank\"  rel=\"nofollow\" >https:\/\/github.com\/node-red\/node-red<\/a><\/p>\n\n\n\n<p><\/p>\n<button class=\"simplefavorite-button\" data-postid=\"706\" 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>1.\u5b89\u88c5\u7cfb\u7edf \u5229\u7528balenaEtcher\u5237\u5199stretch\u7248\u672c\u56fa\u4ef6\u5230SD\u5361\uff0c\u5b8c\u6bd5\u540e\uff0c\u91cd\u65b0\u63d2\u5165SD\u5361\uff0c\u65b0\u5efa\u4e00\u4e2assh\u7684\u6587\u4ef6 \u5f00\u542fr &#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9,11],"tags":[],"class_list":["post-706","post","type-post","status-publish","format-standard","hentry","category-9","category-11"],"_links":{"self":[{"href":"https:\/\/www.iotch.xyz\/index.php?rest_route=\/wp\/v2\/posts\/706","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=706"}],"version-history":[{"count":0,"href":"https:\/\/www.iotch.xyz\/index.php?rest_route=\/wp\/v2\/posts\/706\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.iotch.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=706"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.iotch.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=706"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.iotch.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=706"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}