Fantacity

Stand Alone Complex

玩树莓派

今日闲来无事,翻出N年前购买的树莓派2B+,还能开机,查了一下参数4核1G内存,看来还可以折腾下,开搞。标题取为“玩树莓派”,是因为目前还玩不转~

重装系统

之前树莓派的系统还是买来的时候老板帮忙装的,既然现在要自己玩树莓派了,当然是从头开始。树莓派官网给出了官方系统Raspbian,可以自己下载镜像烧录,也可以通过NOOBS工具安装。除此之外还有多种第三方系统可以选择,如:UBUNTU MATE, Windwos 10 IOT CORE等。这里还是选择Raspbian折腾一下。
镜像下载完之后,通过Win32DiskImager工具烧录一下,此处略过。

系统配置

烧录玩系统之后,需要对配置文件做一下修改,才能输出到外界显示器上。找到sd根目录的config.txt文件,加上这一行
hdmi_mode=69 #1920x1200 60Hz具体看外界显示的分辨率和刷新平频率。

hdmi_mode=1 640x350 85Hz
hdmi_mode=2 640x400 85Hz
hdmi_mode=3 720x400 85Hz
hdmi_mode=4 640x480 60Hz
hdmi_mode=5 640x480 72Hz
hdmi_mode=6 640x480 75Hz
hdmi_mode=7 640x480 85Hz
hdmi_mode=8 800x600 56Hz
hdmi_mode=9 800x600 60Hz
hdmi_mode=10 800x600 72Hz
hdmi_mode=11 800x600 75Hz
hdmi_mode=12 800x600 85Hz
hdmi_mode=13 800x600 120Hz
hdmi_mode=14 848x480 60Hz
hdmi_mode=15 1024x768 43Hz DO NOT USE
hdmi_mode=16 1024x768 60Hz
hdmi_mode=17 1024x768 70Hz
hdmi_mode=18 1024x768 75Hz
hdmi_mode=19 1024x768 85Hz
hdmi_mode=20 1024x768 120Hz
hdmi_mode=21 1152x864 75Hz
hdmi_mode=22 1280x768 reduced blanking
hdmi_mode=23 1280x768 60Hz
hdmi_mode=24 1280x768 75Hz
hdmi_mode=25 1280x768 85Hz
hdmi_mode=26 1280x768 120Hz reduced blanking
hdmi_mode=27 1280x800 reduced blanking
hdmi_mode=28 1280x800 60Hz
hdmi_mode=29 1280x800 75Hz
hdmi_mode=30 1280x800 85Hz
hdmi_mode=31 1280x800 120Hz reduced blanking
hdmi_mode=32 1280x960 60Hz
hdmi_mode=33 1280x960 85Hz
hdmi_mode=34 1280x960 120Hz reduced blanking
hdmi_mode=35 1280x1024 60Hz
hdmi_mode=36 1280x1024 75Hz
hdmi_mode=37 1280x1024 85Hz
hdmi_mode=38 1280x1024 120Hz reduced blanking
hdmi_mode=39 1360x768 60Hz
hdmi_mode=40 1360x768 120Hz reduced blanking
hdmi_mode=41 1400x1050 reduced blanking
hdmi_mode=42 1400x1050 60Hz
hdmi_mode=43 1400x1050 75Hz
hdmi_mode=44 1400x1050 85Hz
hdmi_mode=45 1400x1050 120Hz reduced blanking
hdmi_mode=46 1440x900 reduced blanking
hdmi_mode=47 1440x900 60Hz
hdmi_mode=48 1440x900 75Hz
hdmi_mode=49 1440x900 85Hz
hdmi_mode=50 1440x900 120Hz reduced blanking
hdmi_mode=51 1600x1200 60Hz
hdmi_mode=52 1600x1200 65Hz
hdmi_mode=53 1600x1200 70Hz
hdmi_mode=54 1600x1200 75Hz
hdmi_mode=55 1600x1200 85Hz
hdmi_mode=56 1600x1200 120Hz reduced blanking
hdmi_mode=57 1680x1050 reduced blanking
hdmi_mode=58 1680x1050 60Hz
hdmi_mode=59 1680x1050 75Hz
hdmi_mode=60 1680x1050 85Hz
hdmi_mode=61 1680x1050 120Hz reduced blanking
hdmi_mode=62 1792x1344 60Hz
hdmi_mode=63 1792x1344 75Hz
hdmi_mode=64 1792x1344 120Hz reduced blanking
hdmi_mode=65 1856x1392 60Hz
hdmi_mode=66 1856x1392 75Hz
hdmi_mode=67 1856x1392 120Hz reduced blanking
hdmi_mode=68 1920x1200 reduced blanking
hdmi_mode=69 1920x1200 60Hz
hdmi_mode=70 1920x1200 75Hz
hdmi_mode=71 1920x1200 85Hz
hdmi_mode=72 1920x1200 120Hz reduced blanking
hdmi_mode=73 1920x1440 60Hz
hdmi_mode=74 1920x1440 75Hz
hdmi_mode=75 1920x1440 120Hz reduced blanking
hdmi_mode=76 2560x1600 reduced blanking
hdmi_mode=77 2560x1600 60Hz
hdmi_mode=78 2560x1600 75Hz
hdmi_mode=79 2560x1600 85Hz
hdmi_mode=80 2560x1600 120Hz reduced blanking
hdmi_mode=81 1366x768 60Hz
hdmi_mode=82 1080p 60Hz
hdmi_mode=83 1600x900 reduced blanking
hdmi_mode=84 2048x1152 reduced blanking
hdmi_mode=85 720p 60Hz
hdmi_mode=86 1366x768 reduced blanking

由于第一次开机,只能接一下外接显示器来配置一下,之后就可以通过ssh等方式,不需要外接显示器了。
进入系统后,先把无线驱动装起来,这里用的是TL-WN725N外界USB,可以去这里了解详情。如果有条件直接连接有线,则下面步骤可以直接执行,否则的话,只能先在别的电脑下载好驱动,然后用U盘拷贝到树莓派上,在安装无线驱动了。
具体步骤如下:

1. uname -a 显示树莓派的内核版本,
如Linux raspberrypi 4.4.8-v7+
#881 SMP Sat Apr 30 12:16:50 BST 2016 armv7l GNU/Linux
2. 下载 8188eu-4.4.8-v7-881.tar.gz驱动包
3. 安装驱动

wget https://dl.dropboxusercontent.com/u/80256631/8188eu-4.4.8-v7-881.tar.gz
tar xzf 8188eu-4.4.8-v7-881.tar.gz
sudo ./install.sh
ifconfig

如果安装驱动成功,那么ifconfig驱动应该就可以看到对应的网卡设备了。对应配置可以参考这里

之后配置无线,使用nano编辑/etc/wpa_supplicant/wpa_supplicant.conf

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
ssid="Your-Network-Name"
psk="Your-Network-Password"
}

配置完成之后即可连上无线,然后愉快地使用ssh了。