Orange Pi 新手起步指南
Orange Pi 树莓派
![如何获取并运行 Orange Pi](/data/attachment/album/201703/15/214158kqygd7xy7xicuqi9.jpg "How to get up and running with sweet Orange Pi")


随着开源驱动的硬件越来越成为主流，比如 [Arduino](https://en.wikipedia.org/wiki/Arduino) 和 [Raspberry Pi](https://en.wikipedia.org/wiki/Raspberry_Pi)，这些开源硬件的成本不断下降，给那些全新且具有创新性的[物联网](https://en.wikipedia.org/wiki/Internet_of_things)和[STEM](https://en.wikipedia.org/wiki/Science,_technology,_engineering,_and_mathematics)（LCTT译注：STEM 代表<ruby> 科学 <rp>  （ </rp> <rt>  Science </rt> <rp>  ） </rp></ruby>，<ruby> 技术 <rp>  （ </rp> <rt>  Technology </rt> <rp>  ） </rp></ruby>，<ruby> 工程 <rp>  （ </rp> <rt>  Engineering </rt> <rp>  ） </rp></ruby>，<ruby> 数学 <rp>  （ </rp> <rt>  Mathematics </rt> <rp>  ） </rp></ruby>）类软件打开了大门。我对两者都比较感兴趣，始终保持关注，以便能找到一些可以应用到教育产业的创新点，比如课堂教育和我女儿的[机器人小组](https://opensource.com/education/14/3/fighting-unicorns-robotics-team)。当听说 [Orange Pi 比 Raspberry Pi 更优秀](http://sprtechuk.blogspot.com/2015/09/15-computer-orange-pi-pc-is-powerful.html)时，我便开始关注 Orange Pi了。


尽管 Orange Pi 是个略带酸味儿的名字，但是我仍然被 Orange Pi Zero 迷住了。我最近刚购买了一个 Orange Pi Zero 并将在本文中分享我的第一体验。真情提示：我是真的着迷了。


### 为什么是 Orange Pi?


Orange Pi 是由 Linux 驱动的单板计算机家族的一员，由[深圳迅龙软件有限公司](http://www.xunlong.tv/)生产并在<ruby> <a href="https://www.aliexpress.com/store/1553371">  全球速卖通 </a> <rp>  （ </rp> <rt>  AliExpress </rt> <rp>  ） </rp></ruby>上售卖。在<ruby> 全球速卖通 <rp>  （ </rp> <rt>  AliExpress </rt> <rp>  ） </rp></ruby>上买东西需要有耐心，提前计划预留出 2 到 4 周的运输时间，因为这些产品都是从中国大陆直接发往全世界其它地方的。


与 Raspberry Pi 不同，Raspberry Pi 家族型号比较少，不过在逐步增加，为单板计算机家族添加了几个具有不同价位及功能特色的型号，但是相对而言 Orange Pi 的型号更丰富。好消息是可以在巨大的软件库中选择你需要的东西，但是坏消息就是选择范围实在太大了。以我的经验来看，使用 [Orange Pi Zero](http://www.orangepi.org/orangepizero/) 的 512 MB 版本足矣，因为该版本很好的平衡了功能与价格，适合中学及学术环境使用。


可以到 [Orange Pi Zero 网站](http://www.orangepi.org/orangepizero/) ，查看高清图及所有规格。


很明确的问题是，我希望这种设备的价格越便宜越好，但是要能做到开箱即用，并且能够直接联网以便 SSH 及物联网应用能正常使用。Orange Pi Zero 拥有板载的10/100 M 以太网及 802.11 b/g/n Wi-Fi 模块可以连接网络以满足需求。它还有 26 个与 Raspberry Pi 兼容的 [GPIO 端口](http://linux-sunxi.org/Xunlong_Orange_Pi_Zero#Expansion_Port)，用于连接物联网应用传感器。我使用的是 512 MB 版本的 Orange Pi Zero 而不是 256MB 版本，因为内存大带来的好处很多，并且这两个版本只相差了 2 美元。除此之外，运费还需要 $12.30，这笔花费对于那些鼓励积极实验及创造魔法烟雾的课堂特别划算。(LCTT 译注：“创造魔法烟雾”是幽默的说法，意即因未知原因设备停止工作，原多用于电气工程师和技术员，最近常被程序员们采用）。


与 $5 的 [Raspberry Pi Zero](https://www.raspberrypi.org/products/pi-zero/) 相比，Orange Pi Zero 只贵了几元钱，但是这个开箱后更容易上手使用，因为它拥有板载的 Internet 连接模块及 4 核 CPU，而不是单核。这个板载网口使得 Orange Pi Zero 比 Raspberry Pi Zero 更容易使用，因为 Raspberry Pi Zero 还需要一个 Micro-USB 转 USB 的转换器及一个 USB Wi-Fi 才能连上网。当赠送别人一个物联网设备作为礼物时，你当然希望对方能够尽快且容易的使用该产品，而不是送一个不完整的产品，那么这个礼物就只能躺在阁楼吃灰了。


### 开箱经验


起初对于 Orange Pi，我比较担心的问题是供应商及社区支持没有 Raspberry Pi 基金会和 Raspberry Pi 社区的好，用户不得不自己花费额外的精力把设备跑起来。如果这样的话，我是不会推荐 Orange Pi 作为课堂使用及礼物赠送的。然而好消息是 Orange Pi Zero 工作得非常好，且比 Raspberry 更容易跑起来。


订购两周后，Orange Pi 终于邮寄到家了。我拆开后在几分钟内就把设备运行起来了。其实这大部分时间都是在下载操作系统。Orange Pi 能够运行多种操作系统，从Android 到 Debian 系列都可以。我使用了 Orange Pi 粉丝推崇的 [Armbian](https://www.armbian.com/)。由于 Armbian 支持多种基于 ARM 的单板计算机，你需要选择[适合 Orange Pi Zero 的 Armbian 版本](https://www.armbian.com/orange-pi-zero/)。按照 Armbian 用户指南[开始部分](https://docs.armbian.com/User-Guide_Getting-Started/)操作即可以很容易做一个 microSD 镜像，然后插入 microSD 卡并接上网线，将我在 Raspberry Pi 中用的 3A Micro-USB 电源适配器插上供电，最后 SSH 登录上去即可使用了。


![Orange Pi interface](/data/attachment/album/201703/15/214159a3beaobzreupriep.png "Orange Pi interface")


*SSH 登录进 Orange Pi Zero*


通过以太网 SSH 连上后，我可以使用 [nmtui-connect](https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/Networking_Guide/sec-Networking_Config_Using_nmtui.html) 轻松连上我的无线接入点。然后执行 `apt-get update && apt-get upgrade` 命令，这个命令执行速度比 Raspberry Pi Zero 快，基本接近 [Raspberry Pi 3](https://www.raspberrypi.org/products/raspberry-pi-3-model-b/) 的表现了，其他人也[观察到类似的结果](https://openbenchmarking.org/result/1612154-TA-1603058GA04,1612151-MICK-MICKMAK70,1612095-TA-1603058GA97,1612095-TA-1603058GA50)。虽然 Orange Pi Zero 执行速度可能比不过Raspberry Pi 3，但是我也没有打算用它来计算基因排序或者挖比特币矿。Armbian 会自动调整 root 分区来使用整个 microSD 卡空间，而使用 Raspbian 的时候这是手动且很容易忘记的步骤。最后，和价值 $35 的 Raspberry Pi 3 相比，购买 $12 的 Orange Pi Zero 可以使得三倍多的学生有自己的学习工具，也可以将 Orange Pi Zero 作为礼物分享给三倍数量的朋友。


![Orange Pi Form Factor](/data/attachment/album/201703/15/214204ucww7gu46c7pw959.jpg "Orange Pi Form Factor")


*Orange Pi Zero与 Raspberry Pi 3 尺寸外形的比较*


### 最后的想法


Orange Pi 无疑是解决问题的很好解决方案。鉴于它的低成本、能够更快上手且运行迅速、相对更快速的表现及 GPIO 针脚兼容 Raspberry Pi 的特性，Orange Pi，特别是 Orange Pi Zero，绝对应该列在你工作室、教室或者机器人组的实验器材清单里面。


当然如果你已经厌烦了使用 Orange Pi，希望能够将你不喜欢的原因分享在下面。




---


作者简介：


David Egts - David Egts | 红帽公司北美公共部门首席技术专家。 喜欢玩打鼓，骑摩托车，电脑极客，是一名丈夫，父亲，传授教义者。关注我的推特 @davidegts并查看我正在主持的播客。




---


via: <https://opensource.com/article/17/1/how-to-orange-pi>


作者：[David Egts](https://opensource.com/users/daveegts) 译者：[beyondworld](https://github.com/beyondworld) 校对：[jasminepeng](https://github.com/jasminepeng)


本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译，[Linux中国](https://linux.cn/) 荣誉推出


OK
As open source-powered hardware like [Arduino](https://en.wikipedia.org/wiki/Arduino) and [Raspberry Pi](https://en.wikipedia.org/wiki/Raspberry_Pi) becomes more and more mainstream, its cost keeps dropping, which opens the door to new and innovative [IoT](https://en.wikipedia.org/wiki/Internet_of_things) and [STEM](https://en.wikipedia.org/wiki/Science,_technology,_engineering,_and_mathematics) applications. As someone who's passionate about both, I'm always on the lookout for new innovations that can be applied in industry, the classroom, and [my daughter's robotics team](https://opensource.com/education/14/3/fighting-unicorns-robotics-team). When I heard about the Orange Pi as being a "[Raspberry Pi killer](http://sprtechuk.blogspot.com/2015/09/15-computer-orange-pi-pc-is-powerful.html)," I paused to take notice.

Despite the sour sounding name, the Orange Pi Zero intrigued me. I recently got my hands on one and in this article share my first impressions. Spoiler alert: I was very impressed.

## Why Orange Pi?

Orange Pi is a family of Linux-powered, single board computers manufactured by [Shenzhen Xunlong Software Co., Limited](http://www.xunlong.tv/), and [sold on AliExpress](https://www.aliexpress.com/store/1553371). As with anything sold on AliExpress, be patient and plan ahead for shipping times of two to four or more weeks, because the products are shipped directly from mainland China to locations around the world.

Unlike the Raspberry Pi, which has had a small but growing family of single board computers for different price points, form factors, and features, the number of Orange Pi boards is much larger. The good news is that you have a tremendous amount of choice in the application you want, but the bad news is that amount of choice could be overwhelming. In my case, I went with the [Orange Pi Zero](http://www.orangepi.org/orangepizero/) 512MB version, because it has the right balance of features and is priced for use in high school, academic environments.

To see a high-resolution image with all the specs, go to the [Orange Pi Zero website](http://www.orangepi.org/orangepizero/).

Specifically, I needed the device to be as inexpensive as possible, but still useful out of the box, with Internet connectivity for SSH and IoT applications. The Orange Pi Zero meets these requirements by having onboard 10/100M Ethernet and 802.11 b/g/n Wi-Fi for Internet connectivity. It also has 26 Raspberry Pi-compatible [GPIO ports](http://linux-sunxi.org/Xunlong_Orange_Pi_Zero#Expansion_Port) for connecting sensors for IoT applications. I went with the 512MB version of the Orange Pi Zero over the 256MB version because more memory is typically better and it was only $2 more. Out the door, the unit was US $12.30 shipped, which makes it cost effective for classroom environments where experimentation and creating [magic smoke](https://en.wikipedia.org/wiki/Magic_smoke) is encouraged.

Compared to a $5 [Raspberry Pi Zero](https://www.raspberrypi.org/products/pi-zero/), the Orange Pi Zero is only a few dollars more expensive, but it is much more useful out of the box because it has onboard Internet connectivity and four CPU cores instead of one. This onboard networking capability also makes the Orange Pi Zero a better gift than a Raspberry Pi Zero because the Raspberry Pi Zero needs Micro-USB-to-USB adapters and a Wi-Fi USB adapter to connect to the Internet. When giving IoT devices as gifts, you want the recipient to enjoy the product as quickly and easily as possible, instead of giving something incomplete that will just end up on a shelf.

## Out of the box experience

One of my initial concerns about the Orange Pi is that the vendor and community support wouldn't be as strong as the Raspberry Pi Foundation's and its community's support, leaving the end user all alone putting in extra effort to get the device going. If that's the case, I'd be reluctant to recommend the Orange Pi for classroom use or as a gift. The good news is that the Orange Pi Zero worked well right away and was actually easier to get going than a Raspberry Pi.

The Orange Pi arrived in my mailbox two weeks after ordering. I unpacked it and got it up and running in a matter of minutes. Most of my time was spent downloading the operating system. The Orange Pi can run a variety of operating systems, ranging from Android to Debian variants. I went with [Armbian](https://www.armbian.com/) as it appeared to be the most popular choice for Orange Pi enthusiasts. Since Armbian supports many ARM-based single-board computers, you need to select [the right Armbian build for the Orange Pi Zero](https://www.armbian.com/orange-pi-zero/). By following the [Getting Started section](https://docs.armbian.com/User-Guide_Getting-Started/) of the Armbian User Guide, I was easily able to image a microSD card, insert the microSD card and Ethernet cable, power the unit with an existing 3A Micro-USB power adapter I use with my Raspberry Pis, and SSH into it.

SSHing into the Orange Pi Zero.

Once SSHed in via Ethernet, I was able to connect to my wireless access point easily using [nmtui-connect](https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/Networking_Guide/sec-Networking_Config_Using_nmtui.html). Then I performed an **apt-get update && apt-get upgrade** and noticed that the update ran much faster than a Raspberry Pi Zero and closer to the performance of a [Raspberry Pi 3](https://www.raspberrypi.org/products/raspberry-pi-3-model-b/). Others have [observed similar results](https://openbenchmarking.org/result/1612154-TA-1603058GA04,1612151-MICK-MICKMAK70,1612095-TA-1603058GA97,1612095-TA-1603058GA50), too. It may not be as fast as a Raspberry Pi 3, but I wasn't planning to sequence genomes or mine Bitcoin with it. I also noticed that Armbian automatically resizes the root partition to fill the entire microSD card, which is an explicit, manual, and sometimes forgotten step when using Raspbian. Finally, for the US $12 price, three times as many students can learn on their own Orange Pi Zero as compared to a $35 Raspberry Pi 3, and you can give an Orange Pi Zero to three times as many friends.

The Orange Pi Zero form factor compared with the Raspberry Pi 3.

## Closing thoughts

The Orange Pi is definitely a solution looking for problems. Given its low cost, ability to get up and running quickly, relatively quick performance, and GPIO-pin compatibility with Raspberry Pi, the Orange Pi, and Orange Pi Zero in particular, should definitely be on your short list for experimentation in your workshop, classroom, or robot.

Have you tried the Orange Pi? I'd love to hear about your experiences in the comments below.

## 14 Comments