不久之前饭玲,谷歌官方推出了Android Things捉片,支持樹莓派3韩容,作為前安卓程序當(dāng)然要買來把玩把玩
要準(zhǔn)備以下幾樣?xùn)|西
- 樹莓派3的板子
- 電源開關(guān)線
- tf卡(8GB以上)
- 網(wǎng)線
- 路由器
要下載以下幾樣?xùn)|西
- Win32DiskImager
- Raspbian鏡像或Android Things鏡像
- ipscan
- XShell或者putty(可以ssh連接的就行)
將鏡像寫入 tf卡
- 把 tf卡接入電腦
-
運(yùn)行 Win32DiskImager.exe
(右鍵點(diǎn)擊文件--選擇“以管理員身份運(yùn)行”). 你將看到下面的窗口:
這里寫圖片描述 - 如果tf卡 沒有被自動找到扣唱,那么在下拉選擇框中手動選擇tf卡相應(yīng)的驅(qū)動器
- 在Image File 選擇框選擇剛才下載的鏡像(xxx.img)文件
- 點(diǎn)擊“Write”按鈕
- 幾分鐘后tf卡就寫好了
SSH登錄樹莓派
在2016-11-25的Raspbian鏡像中藕坯,默認(rèn)是關(guān)閉ssh連接的团南,連接時會顯示Connection refused,所以必須在tf卡的boot分區(qū)中新建一個ssh文件夾
- 樹莓派插入tf卡炼彪,這時打開電源吐根,綠燈會閃爍
- 將樹莓派與路由器用網(wǎng)線連接
- 打開ipscan,將ip范圍設(shè)為192.168.1.0到192.168.1.255
-
掃描到主機(jī)名稱是raspberrypi.lan的ip就是樹莓派ip辐马,如下圖所示
這里寫圖片描述 - 用XShell或者putty使用ssh登錄拷橘,使用以上ip,端口22喜爷,用戶名pi,密碼raspberry
使用遠(yuǎn)程桌面
- sudo apt-get install tightvncserver
- 使用命令 vncpasswd設(shè)置密碼冗疮,那個view-only密碼可以不設(shè)。
- sudo vi /etc/init.d/tightvncserver檩帐,輸入以下內(nèi)容
### 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)
# 啟動命令行术幔。此處自定義分辨率、控制臺號碼或其它參數(shù)湃密。
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
4.然后給上述自啟動文件降權(quán)限勾缭,更新開機(jī)自啟動列表
sudo chmod 755 /etc/init.d/tightvncserver
sudo update-rc.d tightvncserver defaults
5.輸入命令 tightvncserver
6.打開windows自帶的遠(yuǎn)程桌面,使用上面掃描到的ip目养,用戶名pi,密碼raspberry
7.最后進(jìn)入到系統(tǒng)
這里寫圖片描述