上电, 插上网线, 在路由器里面查找, rpi的ip
经过ssh链接
默认user:pi
,默认密码:raspberry
windows
--> MobaXterm,(不推荐putty, 功能和实用性一个天, 一个地无法比)mac x
--> iTerm2shell
国内的的速度太慢了, 能够改成国内的源, 比较不错的就是阿里的源, 速度至关的快vim
备份当前的源windows
sudo cp /etc/apt/sources.list /etc/apt/sources.list.backup
修改源缓存
sudo vi /etc/apt/sources.list
把默认的源屏蔽掉,加入下面的源网络
deb http://mirrors.aliyun.com/raspbian/raspbian/ jessie main non-free contrib deb-src http://mirrors.aliyun.com/raspbian/raspbian/ jessie main non-free contrib
保存退出ssh
sudo apt-get update sudo apt-get upgrade
sudo raspi-config
选择Expand FileSystem
重启ui
不扩容的话, 常常会提示缓存空间不够code
scanip
pi@raspberrypi:~ $ sudo iw wlan0 scan | grep 'SSID' SSID: MERCURY_EF2F4A SSID: ViewTool SSID: wl8080 SSID: CU_nsD9 SSID: NETGEAR SSID: 10-8 SSID: xiaoyu SSID: CU_CuYN SSID: MERCURY_5326
链接路由
sudo vim /etc/wpa_supplicant/wpa_supplicant.conf
在结尾加上这样的字段
network={ ssid="MERCURY_EF2F4A" psk="EF2F4A2014" }
从新打开wlan0或者重启
sudo ifdown wlan0 sudo ifup wlan0
sudo init 6
=推荐重启, 喝一杯水的时间, 再查看网络状态
ifconfig
若包含下面的字段, 说明链接成功
wlan0 Link encap:Ethernet HWaddr b8:27:eb:44:a0:d9 inet addr:192.168.1.200 Bcast:192.168.1.255 Mask:255.255.255.0 inet6 addr: fe80::ba27:ebff:fe44:a0d9/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:10873 errors:0 dropped:6237 overruns:0 frame:0 TX packets:2940 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:3138985 (2.9 MiB) TX bytes:364954 (356.4 KiB)
若是不成功请登陆到gui界面链接wlan
sudo vim /etc/hostname
须要在hosts文件里面加上一句话
sudo vim /etc/hosts
127.0.1.1 [你的hostname]
若是只是修改hostname, 每次使用sudo会弹出
sudo: unable to resolve host myhostname
su
su <username>