美文网首页树莓派
树莓派4刷入respbian

树莓派4刷入respbian

作者: Hoffmana | 来源:发表于2020-03-14 11:39 被阅读0次

1.准备一个16G左右MINISD卡
2.格式化SD卡
3.写入镜像。下载镜像地址:

https://www.raspberrypi.org/downloads/          //respbian下载地址

4.写入镜像:2020-XX-XX-raspbian-buster-full.img

https://sourceforge.net/projects/win32diskimager    //写入工具

5.创建ssh。打开SD根目录,文件地址栏输入cmd
输入:

touch ssh

6.为无显示器准备wifi。创建文件:wpa_supplicant.conf

touch wpa_supplicant.conf

7.编辑wpa_supplicant.conf,贴入以下内容,注意替换你自己的wifi账号密码,然后保存

country=CN
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
    ssid="YOUR-WIFI-ID"
    psk="YourPassWD"
    key_mgmt=WPA-PSK
    priority=1
}

8.打开路由器管理查看:DHCP服务器—客户端列表——
客户端名:raspberrypi,记录该IP

192.168.X.X     //一般为这个格式

9.putty链接SSh 下载VNC并使开机启动,改默认密码: passwd

image.png
输入账号:pi
密码:raspberry

改默认密码:

passwd
输入原密码:raspberry
输入新密码:YourPW

安装VNC:

sudo apt-get install tightvncserver   //安装
sudo vncpasswd -service  //service密码  
sudo vncpasswd -users  //用户的 


sudo nano /etc/init.d/tightvncserver // 第一步

//第二步开始
#!/bin/sh
### BEGIN INIT INFO
# Provides:          tightvncserver
# Required-Start:    $local_fs
# Required-Stop:     $local_fs
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: Start/stop tightvncserver
### END INIT INFO
 
# More details see:
# http://www.penguintutor.com/linux/tightvnc
 
### Customize this entry
# Set the USER variable to the name of the user to start tightvncserver under
export USER='pi'
### End customization required
 
eval cd ~$USER
 
case "$1" in
  start)
    # 启动命令行。此处自定义分辨率、控制台号码或其它参数。
    su $USER -c '/usr/bin/tightvncserver -depth 16 -geometry 1024x768 :1'
    echo "Starting TightVNC server for $USER "
    ;;
  stop)
    # 终止命令行。此处控制台号码与启动一致。
    su $USER -c '/usr/bin/tightvncserver -kill :1'
    echo "Tightvncserver stopped"
    ;;
  *)
    echo "Usage: /etc/init.d/tightvncserver {start|stop}"
    exit 1
    ;;
esac
exit 0
//第二步结束。鼠标右键自动粘贴,ctrl+s -CTRL+X 回车


//第三步
sudo chmod 755 /etc/init.d/tightvncserver   //加755权限

//第四步
sudo update-rc.d tightvncserver defaults

//重启
sudo reboot

参考
https://www.jianshu.com/p/6c6d6d6413d6

相关文章

网友评论

    本文标题:树莓派4刷入respbian

    本文链接:https://www.haomeiwen.com/subject/patlshtx.html