Copyright 2018 Wolfram Donat. All rights reserved.
Published by
Maker Media, Inc.
1700 Montgomery Street, Suite 240
San Francisco, CA 94111
Maker Media books may be purchased for educational, business, or sales promotional use. Online editions are also available for most titles (safaribooksonline.com). For more information, contact our corporate/institutional sales department: 800-998-9938 or corporate@oreilly.com.
Editorial Director: Roger Stewart
Editor: Patrick DiJusto
Copy Editor: Elizabeth Welch, Happenstance Type-O-Rama
Proofreader: Scout Festa, Happenstance Type-O-Rama
Cover and Interior Designer: Maureen Forys, Happenstance Type-O-Rama
All the circuit and component diagrams in this book are created using Fritzing (http://fritzing.org/home).
June 2018: First Edition
Revision History for the First Edition
2018-06-18 First Release
See oreilly.com/catalog/errata.csp?isbn=9781680455229 for release details.
Make:, Maker Shed, and Maker Faire are registered trademarks of Maker Media, Inc. The Maker Media logo is a trademark of Maker Media, Inc. Jumpstarting the Onion Omega2 and related trade dress are trademarks of Maker Media, Inc. Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks. Where those designations appear in this book, and Maker Media, Inc. was aware of a trademark claim, the designations have been printed in caps or initial caps. While the publisher and the author have used good faith efforts to ensure that the information and instructions contained in this work are accurate, the publisher and the author disclaim all responsibility for errors or omissions, including without limitation responsibility for damages resulting from the use of or reliance on this work. Use of the information and instructions contained in this work is at your own risk. If any code samples or other technology this work contains or describes is subject to open source licenses or the intellectual property rights of others, it is your responsibility to ensure that your use thereof complies with such licenses and/or rights.
978-1-680-45522-9
Safari Books Online
Safari Books Online is an on-demand digital library that delivers expert content in both book and video form from the worlds leading authors in technology and business. Technology professionals, software developers, web designers, and business and creative professionals use Safari Books Online as their primary resource for research, problem solving, learning, and certification training. Safari Books Online offers a range of plans and pricing for enterprise, government, education, and individuals. Members have access to thousands of books, training videos, and prepublication manuscripts in one fully searchable database from publishers like OReilly Media, Prentice Hall Professional, Addison-Wesley Professional, Microsoft Press, Sams, Que, Peachpit Press, Focal Press, Cisco Press, John Wiley & Sons, Syngress, Morgan Kaufmann, IBM Redbooks, Packt, Adobe Press, FT Press, Apress, Manning, New Riders, McGraw-Hill, Jones & Bartlett, Course Technology, and hundreds more. For more information about Safari Books Online, please visit us online.
How to Contact Us
Please address comments and questions to the publisher:
Maker Media, Inc.
1700 Montgomery Street, Suite 240
San Francisco, CA 94111
You can send comments and questions to us by email at books@makermedia.com .
Maker Media unites, inspires, informs, and entertains a growing community of resourceful people who undertake amazing projects in their backyards, basements, and garages. Maker Media celebrates your right to tweak, hack, and bend any Technology to your will. The Maker Media audience continues to be a growing culture and community that believes in bettering ourselves, our environment, our educational systemour entire world. This is much more than an audience, its a worldwide movement that Maker Media is leading. We call it the Maker Movement.
To learn more about Make: visit us at makezine.com. You can learn more about the company at the following websites:
Maker Media: makermedia.com
Maker Faire: makerfaire.com
Maker Shed: makershed.com
Maker Share: makershare.com
Introduction
I n the proud tradition of computers named after fruitthe Apple, the Raspberry Pi, the Banana Pi, the Pine (okay, maybe not that last one)comes a new entry into the small, single-board computer (SBC) market: the Onion Omega2.
Lets ignore the fact that an onion is a vegetable, not a fruit, and talk about the Onion Omega2s origins for a moment. The Onion Omega2 (and its big brother, the Omega2+) are the second offering from a company called, appropriately enough, Onion. The original Omega cost about $18 and ran on a Qualcomm Atheros AR9331 chip. Onion ran a Kickstarter campaign in 2016 to replace the Omega with the Omega2, using a different system on a chip, the MediaTek MT7688. They were ultimately successful, raising well over their goal of $440,000, and the Omega2 shipped late in 2016. A nice feature of the newer version was the price drop the new board started at $5, though it was later increased to $7.50. The Omega2+ is only $9.
The Omega2 is an SBC geared for the Internet of Things (IoT) market, billed as the worlds smallest Linux server. It runs a variant of Linux known as OpenWRT, which is most commonly found on embedded devices like routers. Its low power and really tiny at 43mm26mm10mm, its just a little larger than an Arduino Pro Mini.
Dont let that fool you into thinking its not a real computer, however. Its surprisingly powerful for the size, with its MIPS processor running at 580MHz. It supports up to 256MB of RAM, and it can support SD card storage. It supports 802.11b/g/n 2.4GHz WiFi and 10/100M Ethernet, as well as a multitude of other protocols like UART, I2S, I2C, and SPI. It operates at 3.3V, but its docks and expansion boards come with a convenient onboard voltage regulator, which means you can power it with a variety of power supplies without having to worry about blowing it up.
There are just a few differences between the Omega2 and the Omega2+, since they have the same processor. The O2 has 64MB of DDR2 DRAM memory, whereas the O2+ has 128. The O2 has 16MB of onboard flash storage, and the O2+ has 32. Finally, the O2+ has a microSD card slot, which gives you significantly more room for programs. Given the small difference in price, I suggest you pick up the O2+, but all of the projects in this book will work on either model, so if youve already purchased the O2, not to worry.
I would like to interject a small observation here. If you really go back and look at those specs, it is insane how far weve come when it comes to putting computing power into small packages. My first computer was a Commodore VIC-20, which had a whopping 5KB of RAM. Thats less than the size of a standard image thumbnail on the web today, and almost thirteen thousand times smaller than the Omega2s DRAM package.
Quite a few expansion boards and docks are available youre going to need at least one right off the bat, as the Onions headers are at a 2mm pitch instead of the more common 0.1 pitch, which means you cant just plug it into your breadboard. Youll have to use either a dock or a breadboard expansion piece, so my suggestion is to purchase the power dock (). It allows you to power the board and whatever add-ons you happen to have using not just a microUSB cable, but also a 2-pin JST-PH connectorthe standard connector on many lithium-ion (Li-ion) batteries. None of the expansion boards are very expensive, so its worth the time to look around and see whats available when youre shopping for your Onion.
Next page