利用balenaEtcher刷写stretch版本固件到SD卡,完毕后,重新插入SD卡,新建一个ssh的文件
sudo passwd root #为root设置密码
sudo passwd --unlock root解锁root账户
会提示:password expiry information changed
sudo nano /etc/ssh/sshd_config
修改PermitRootLogin without-password->PermitRootLogin yes
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
修改/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
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
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
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
sudo python get-pip.py
cd /usr/local/opt/python3.7/bin
sudo ./pip3.7 install --upgrade pip
sudo ./pip3.7 install homeassistant
./hass
https://bbs.hassbian.com/thread-5439-1-1.html
安装MQTT
sudo apt-get install mosquitto
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