RPi 硬件基础设置

= 你需要拥有的典型硬件 = 你可能已经决定去买一个Raspberry Pi,因为觉得Pi很棒,如果你有一个想法来使用Pi,此处将帮助你.你购买了主板,但是你将需要另外一些部件来使用它.有些部件你可能身边就有直接使用,有些部件你可能需要从其他分发或出售的人那里购买,有些你需要自己购买.考虑到你的购买;相对便宜的设备,你可能从更贵的部件里面获取的收益很少.

Raspberry Pi 能被使用于常见的传统模式,带有监控,鼠标和显示器,或者使用于 "伺服" 模式,使用于网络上并被网络上的另外一台电脑所控制.你能在Pi上添加一系列额外的外围设备;本页第一章节包含了设置Pi的最小数量的外设以确保你能使其开始工作.额外的外设被包含在第二章节.

重要 对于需要使用大于100mA的USB装置，强烈建议你使用一个独立供电的USB集线器For USB devices other than a mouse and a simple wired keyboard (for USB devices drawing more than 100mA) a powered USB hub is strongly recommended. A technical discussion as to why can be found here. Specifically the RPi's built in USB hub is designed only for "Single current unit" USB devices. Note that when using Revision 2 (or later) boards the problem has been mitigated somewhat with the removal of the USB polyfuses, still due to the limited current the PI can provide to USB devices, due to its main polyfuse, its still recommended to use a hub for all USB peripherals requiring more than 100mA.

除此之外，其他硬件也包括:


 * 外壳
 * SD卡读卡器 - 如果你打算自己准备SD卡
 * 电源开关 - 如果你想找一个简单的方式来调节电源if you want an easy way to cycle power

供电
装置使用一个 Micro USB 连接来为其供电(仅供电引脚连接 - 所以此连接将不会传输数据). 一个标准的带有 micro-USB 连接的现代手机充电器即可使用,但是需要在 5v 时能至少提供 700mA 电流.仔细检查你的供电设备等级,及 当心廉价仿制品!.

Pi Hut 提供 5V 1500mA 供电,专为Raspberry Pi制造.此处有三个种类 :
 * UK
 * EU
 * USA

其他合适的电源适配器在此处提供 RPi 商店, 及eBay.ModMyPi's Raspberry Pi Shop 存有专为Raspberry Pi设计定制的 5V 2A 电源适配器.

你能使用一系列其他的电源(假定他们能够提供足够的电源 ~700mA):
 * 电脑 USB 端口或带供电 USB hub (将取决于供电输出)
 * 带有 USB 端口的特殊墙壁插座
 * 手机后备电池 (将取决于供电输出) (理论上 - 需认证)
 * 带有内置 USB 的现代电视 (例如, 已经被展示可工作于 Sony KDL-40HX723 和 KDL-55NX813)
 * 带有 USB 端口的 Internet 路由 (BT Home Hub 3 看起来使Pi运行的很好)

要使用以上电源,你将要需要一个 USB A '公口' 转 USB micro '母口' 线 - 它们通常是手机的数据线.

电源开关
另外,Raspberry Pi没有一个类似PC上通常能看到的on/off 开关.Pi Supply 出售 扩展板 提供这种功能,允许你简单的管理你的Raspberry Pi电源,无需磨损你的后背,或者Pi上的micro-USB 接口. 它同样提供了各异安全关闭开关以避免损坏你的SD卡.

如需关于电源需求的更详细信息见 RPi Hardware - Power.

移动电源
想要在四处奔走时使用你的Raspberry Pi?你需要一个移动电源!可充电移动电源让你在任何地方都能使用你的Raspberry Pi.已经在Pi Hut上有了 - Raspberry Pi可用的移动电源

已准备好操作系统的SD卡
RPi没有内置存储或内建启动代码,所以它需要一个SD卡设置用来启动RPi并加载操作系统.你应当阅读RPi Easy SD Card Setup页面来获得相关指引,包括购买一个已预装卡或创建一个你自己的安装的SD卡

键盘 & 鼠标
大部分标准USB键盘和鼠标都能工作在RPi上.无线键盘/鼠标应该也能工作,并且只需一个USB端口用于RF适配器.为了使用蓝牙键盘或鼠标,你需要使用一个蓝牙适配器,同样只占用一个端口.

记住 Model A 仅有一个USB端口,Model B 仅有两个(通常键盘和鼠标需要各用一个USB端口) - 见下面 USB Hub.

如需检查你的键盘和鼠标与Linux是否兼容,见 RPi Verified Peripherals.

显示设备
RPi有两种显示连接选择,HDMI (高分辨率) 和 Composite (低分辨率).


 * 高清电视和大多数液晶显示器可以使用全尺寸的“公”HDMI电缆连接，如果使用DVI，则可使用廉价的适配器进行连接. 支持HDMI版本1.3和1.4，建议使用1.4版本的电缆.  RPI通过HMDI输出音频和视频，但不支持HDMI输入.


 * 大多数较旧的电视可以使用复合（黄色至黄色的电缆）连接. 支持PAL和NTSC电视.  请注意，RCA输出是复合视频，不是RF，因此不能直接连接到电视机的天线输入端，需要使用RCA至SCART插头连接黄色视频输入连接器或SCART输入，（适配器）.

当使用复合视频时，可以从3.5mm（1/8英寸）的插座获得音频，并且可以将其发送到您的电视机或放大器. 要将音频发送到电视机，您将需要一个适用于3.5mm至双（红色和白色）RCA连接器的电缆. 这些红色和白色插头可以插入电视或立体声设备的红色和白色RCA插头输入，或上述的RCA到SCART插头. 播放音频的另一个选项（不使用HDMI时）是将3.5mm插孔插入放大扬声器组. 请勿将3.5 mm插孔直接连接到耳机，因为3.5 mm音频输出不适合驱动耳机，仅适用于放大器输入. 将低阻抗负载（如耳机）连接到立体声音频输出可能会导致声音失真.

使用HDMI至DVI-D（数字）适配器以及DVI至VGA适配器将无法正常工作. HDMI不具有转换为VGA所需的DVI-A（模拟） - 将HDMI或DVI-D源转换为VGA（或组件）需要有源转换器. （购买新的显示器可能还更便宜）. 如果电源不足并且转换器没有通过自己的电源供电则经常出问题. Pi Hut提供两个适配器，使Raspberry Pi可以使用多种显示器格式
 * 普通HDMI
 * VGA适配器
 * DVI适配器

更多资讯请见 Rpi Screens.

线缆
You will probably need a number of cables in order to connect your RPi up.
 * 1) Micro-B USB Power Cable (see above) picture. This has to be a high quality one.
 * 2) HDMI-A picture or Composite cable picture, plus DVI adaptor picture or SCART adaptor picture if required, to connect your RPi to the Display/Monitor/TV of your choice.
 * 3) Audio cable picture, this is not needed if you use a HDMI TV/monitor.
 * 4) Ethernet/LAN Cable (see below) picture.

The price you pay for an HDMI cable can very wildly and under most circumstances a low-cost cable from a reputable online or local supplier will be absolutely fine, but the definition of what constitutes 'low cost' can vary wildly - for example, in the UK, a 1m cable can be purchased for anything between £1 and £24.99. If, however, you want to drive a display some distance from the RPi (say greater than the ubiquitous 1.8m/6ft), or you are using a video switch to share a display between several devices, then higher quality cables might be wise - for example, a pair of 1m HDMI cables purchased in a UK 'pound shop' worked fine when directly connected between the RPi and a display, but would not give a stable picture when used via an HDMI switch. Replacing the £1 1m cable with a 1.5m cable bought online for £1.30 fixed the problem. For more insight: Why you don't need to spend more than £2 on an HDMI cable

Fully tested cables are available from Pi Supply, The Pi Hut's Raspberry Pi Store, and ModMyPi's Raspberry Pi Shop offers a range of High Quality coloured 'Noodle' cables.

网络 / Internet 连通
This may be an Ethernet/LAN cable (standard RJ45 connector) or a USB WiFi adaptor. The RPi ethernet port is auto-sensing which means that it may be connected to a router or directly to another computer (without the need for a crossover cable ).

Support for USB WiFi adaptors will vary - see RPi Verified Peripherals.

Note: If a Netgear router has a blank in the fourth box of the subnet mask, raspbian will interpret that as a 255, not as a '0' like Ubuntu. This will give you a subnet mask of 255.255.255.255 and a useless network connection. Changing the router's setting to put a '0' in the last field and reinitializing the network will fix this.

USB-Hub
In order to connect additional devices to the RPi, you may want to obtain a USB Hub, which will allow multiple devices to be used.

It is recommended that a powered hub is used - this will provide any additional power to the devices without affecting the RPi itself. The USB ports are fused at about 140ma each without an additional external power source. This not enough to power a hard drive, and you may even have trouble powering wireless adapters and other peripherals. There is enough current out there, however, for mice and most keyboards. (see RPi Hardware - Power section).

USB version 2.0 is recommended. USB version 1.1 is fine for keyboards and mice, but may not be fast enough for other accessories.

实时时钟
通过使用一个预装的,电池供电的 '实时时钟'(RTC),笔记本和电脑在断电后能保持时间.然而,实时时钟模块没有被包含在Raspberry Pi中.为了保持时间,Raspberry Pi自动依赖以太网或WiFi从互联网更新日期和时间.对于没有互联网连接的项目,你可以考虑添加一个低成本的电池供电RTC来帮助你的Pi保持时间.

Afterthought Software have released a 'Plug and Play' Real Time Clock designed specifically for the Raspberry Pi which, unlike other RTC's available, plugs directly in to the Raspberry Pi's GPIO Ports. The unit is available from ModMyPi and comes complete with an easy to follow Installation Guide.

另一台 PC
If you need to install the Operating System on your own SD Card you will need another PC, Laptop or Mac to do so (or get a friend or local group to do it for you). If you are running headless, you also need one, though for a lot of uses (but not all) you can use a tablet or smart phone. This does include another Pi!

= 连接到一起 =

You can use the diagram to connect everything together using the following instructions:


 * 1) Plug the SD Card loaded with the Operating System into the Pi.
 * 2) If required, plug the USB keyboard and mouse into the Pi, perhaps via a USB Hub. Connect the Hub to power, if necessary.
 * 3) If required, plug the video cable into the display and into the Pi.
 * 4) Plug in your Network cable, or WiFi dongle, if required.
 * 5) Ensure that your USB Hub (if any) and display are working.
 * 6) With your screen on, plug the other end of the power source into the Pi.
 * 7) Plug the power source into the main socket, and switch it on.
 * 8) If connected to a display, the Pi should boot up and display messages on the screen.
 * 9) If running headless, it should boot up. When the leds have stopped flashing, connect to the Pi from the remote computer. Whether this works will depend on the operating system you are using; the Raspian Linux operating system is configured to allow SSH connections by default.

It is always recommended to connect the MicroUSB Power to the unit last (while most connections can be made live, it is best practice to connect items such as displays and other connections with the power turned off).

If you use both a R-PI power supply and a powered hub, its recommended you connect them to the same switched power bar, and use the switch on the power bar to switch off both the R-PI and hub at the exact same time.

Also, always shutdown using the software shutdown function, not by pulling the plug. When not using a GUI, (with a GUI use the GUI command) you can use the command "sudo halt", and power off when all the LED's on the board (except the power LED) go off. This is especially important the first time you boot, as in the process the R-PI modifies the content of the SD-card, without a clean shutdown the contents of the card may be damaged.

The RPi may take a long time to boot when powered-on for the first time, so be patient, and cleanly shutdown afterwards, as described above!

= 附加的外设 = You may decide you want to use various other devices with your RPi, such as Flash Drives/Portable Hard Drives, Speakers etc.

For detailed information see RPi Verified Peripherals.

散热片
不是RPi的重要外设，但有助于在负载下降低CPU的温度. 可從 The Pi Hut's Raspberry Pi Store, Etsy, ModMyPi (在评论中有很多降低温度的提示和技巧) 或 eBay

外壳
Since the RPi is supplied without a case, it will be important to ensure that you do not use it in places where it will come into contact with conductive metal or liquids, unless suitably protected. Some form of case should be considered, and there is a Rpi case thread on the forum. Cases are also available from The Pi Hut's Raspberry Pi Store,ModMyPi's Raspberry Pi Shop and MobileApp Systems.

For detailed information see Rpi Cases.

SD卡读卡器
You may need an SD card reader to prepare an SD card, or read a second one, both for the Pi or the other computer if it does not have an integral SD card reader.

ModMyPi's Raspberry Pi Shop stocks a low cost (99p) SD Card Reader.

扩展 & 低级外设
If you plan on making use of the low level interfaces available on the RPi, then ensure you have suitable header pins for the GPIO (and if required JTAG) suitable for your needs.

Also if you have a particular low-level project in mind, then ensure you design in suitable protection circuits to keep your RPi safe (details will be made available within the RPi Projects, Guides & Tutorials section).

For detailed information see Rpi Low-level Peripherals.

= External Links =

For a verbose guide aimed at absolute beginners, see Peripherals You'll Need and Getting Started in h2g2's 'Introducing the Raspberry Pi'.

For a cautionary tale of '7 gotchas' to be on the lookout for (especially concerning the re-use of old monitors, keyboards, etc), see Raspbery Pi 'Gotchas' and new buyer tips

= References =