raspberry鏈接ssh和vnc

1。利用SDFormatter格式化移動硬盤linux

2。利用Win32DiskImag將raspbian的iso鏡像文件安裝在移動硬盤中ubuntu

3。使用SSH將樹莓派與電腦相連網絡

在DOS界面輸入arp -a,獲取樹莓派的IP地址。利用PuTTY登陸命令窗口(電腦網絡須要打開共享)。ssh

2016年11月後版本有登陸拒絕,緣由是官方默認禁止SSH,只需在根目錄下創建ssh空白文本便可ide

用戶名:pi,初始密碼:raspberry(在ubuntu中帳號及密碼均爲ubuntu)ui

從新設置密碼:this

password pi

輸入兩次所想設置的密碼spa

4。更新apt命令行

sudo apt-get update

5。添加vnc server:code

sudo apt-get install tightvncserver

安裝vnc

tightvncserver

提示輸入VNC登陸密碼兩次並要求重複確認,好比設置爲pi123456。

設置開機自啓動:
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  #仍是爲(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 800x600 :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
給tightvncserver文件加執行權限,並更新開機啓動列表。
sudo chmod 755 /etc/init.d/tightvncserver
sudo update-rc.d tightvncserver defaults
在Windows系統上下載vncviewer並運行。打開VNC Viewer,輸入樹莓派IP+:1,connect便可進入桌面模式。下次打開vnc時直接輸入tightvncserver,而後輸入IP:1便可。
 
 
 
查看IP:
ifconfig
6.調用攝像頭
sudo raspi-config
選項中選擇Enable camera
sudo nano /etc/modules
添加一行
bcm2835-v4l2

 

7.樹莓派更改時間
sudo dpkg-reconfigure tzdata
選擇asia->shanghai便可
 
關於圖像的顯示
能夠使用方法:HDMI轉AGV顯示,後者有時候輸入命令須要用SSH
相關文章
相關標籤/搜索