1.安裝系統
利用balenaEtcher刷寫stretch版本固件到SD卡,完畢後,重新插入SD卡,新建一個ssh的文件
開啓root賬戶
sudo passwd root #爲root設置密碼
sudo passwd --unlock root解鎖root賬戶
會提示:password expiry information changed
sudo nano /etc/ssh/sshd_config
修改PermitRootLogin without-password->PermitRootLogin yes
2.換源
sudo nano /etc/apt/sources.list.d/raspi.list
deb https://mirrors.tuna.tsinghua.edu.cn/raspberrypi/ stretch main ui
包括raspi-config\minecraftpi\桌面環境、內核固件驅動等少量軟件
sudo nano /etc/apt/sources.list
deb https://mirrors.tuna.tsinghua.edu.cn/raspbian/raspbian/ stretch main contrib non-free rpi
3.設置樹莓派3 B+的靜態IP
修改/etc/dhcpcd.conf 文件
sudo nano /etc/dhcpcd.conf
interface eth0
static ip_address=192.168.0.10/24
static routers=192.168.0.1
static domain_name_servers=192.168.0.1
interface wlan0
static ip_address=192.168.0.200/24
static routers=192.168.0.1
static domain_name_servers=192.168.0.1
上面的配置文件中 , eth0是有線的配置 , wlan0是無線配置
ip_address就是靜態IP , 後面要接/24
routers是網關
static domain_name_servers是DNS
4.編譯安裝python3.7.3
sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade
安裝python依賴環境
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
下載python3.7.3版本源碼並解壓
wget https://www.python.org/ftp/python/3.7.3/Python-3.7.3.tar.xz
tar -xvf Python-3.7.3.tar.xz
cd Python-3.7.3
sudo ./configure --prefix=/usr/local/opt/python3.7
sudo make
sudo make install
安裝Python2.7
wget https://www.python.org/ftp/python/2.7.13/Python-2.7.13.tgz
tar -zxf Python-2.7.13.tgz
cd Python-2.7.13
sudo ./configure --prefix=/usr/local/opt/python2.7
sudo make
sudo make install
安裝python2.7的pip
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
sudo python get-pip.py
安裝homeassistant
cd /usr/local/opt/python3.7/bin
sudo ./pip3.7 install --upgrade pip
sudo ./pip3.7 install homeassistant
./hass
安裝MPD
https://bbs.hassbian.com/thread-5439-1-1.html
安裝MQTT
sudo apt-get install mosquitto
安裝NO
DERed
bash <(curl -sL https://raw.githubusercontent.com/node-red/linux-installers/master/deb/update-nodejs-and-nodered)
上面失效時
sudo apt install npm
npm update -g
npm install -g n
n latest
sudo npm install -g --unsafe-perm node-red
node-red
https://github.com/node-red/node-red