Image

Ubuntu Core 16 Enables Snappy IoT

Nov. 18, 2016
Ubuntu Core 16 targets embedded applications such as the Internet of Things with its compact, modular architecture.

1. Ubuntu Core is built around snaps that are modules with a defined interface for connecting to other snaps. For example, a MySQL database server could be a provider to an application that consumes data from a database.

Ubuntu Core 16 is now available. It is a tiny, transactional implementation of Ubuntu Linux that targets embedded applications such as the Internet of Things (IoT). It uses a new packaging system with modules called snaps that include metadata about their connectivity and interface requirements (Fig. 1).

A snap can have one or more interfaces that are either a plug or a slot providing connections between snaps. A snap exists as a read-only, immutable, compressed squashFS blob, while an instance also includes a private, writeable directory. Communication with the operating system services uses the interface mechanism. Snaps can be given access to other directories.  

Ubuntu Core is a more limited, compact Linux, but it includes features such as transactional over-the-air updates with full rollback support. This is key for all IoT aspects, from consumer to industrial IoT (IIoT).

Security is also part of the mix, using Ubuntu’s AppArmor support that matches that found on the standard version of Ubuntu Linux. The security system applies to snaps and their automatic connectivity and configuration. A snap is confined to its published interfaces. Much of this is done by restricting directory and file access very similar to how the Inferno operating system worked.

2. A snap file is a specially formatted compressed zip file that includes metadata in addition to code.

A nice thing about the open-source Ubuntu Core is that it is free. It can be distributed at no cost. There is also an app (snap) store that can be used to distribute applications to consumers, as well as for developers.

The snap file used for distribution is actually a specially formatted, compressed zip file (Fig. 2). This includes a metadata file that includes the interface and security information to put the snap into context within an Ubuntu Core system. Snaps can include native code, as well as interpreted code like Python, PHP, and even Bash scripts.

Ubuntu Core 16 matches the usual Ubuntu 16.04 LTS (long-term support) platform in terms of the base kernel (Fig. 3). The difference is in package isolation. For example, shared libraries cannot go across snap boundaries.

3. Ubuntu Core 16 shares the same kernel as Ubuntu 16.04, but the packaging system is different. (Click image to enlarge)

Public collections of snaps and their source can be found on GitHub. Ubuntu Core is available for download for a range of target platforms that include Raspberry Pi 2 and 3, Intel NUC and Joule, Samsung’s Artik, Qualcomm Snapdragon, BeagleBone, Gumstix, and more. Essentially the system needs an x86 or a ARMv7 or better processor. This fits most Cortex-A systems. 128 Mbytes of RAM is a good starting point, with about 4 Gbytes of non-volatile storage. A Raspberry Pi 2 Model B has a Cortex-A7, 1 Gbyte of RAM, and an microSD card slot.

It is even possible to run Ubuntu Core 16 on virtual machines like Linux’s KVM. Although Ubuntu Core targets small footprint IoT applications, it is an interesting alternative to containers as a thin OS for more modular systems.

Once a system is running Ubuntu Core, it can use its connectivity to maintain and update the system’s snap collection. Snaps are available for most IoT-related protocols like MQTT and links to many cloud-based IoT services.

Ubuntu Core has a lot of competition, such as Windows 10 IoT Core, embedded RTOSes, and various Linux incarnations like Tizen Linux. It has the advantage of familiar Ubuntu underpinnings and development tools and the snappy module system.

About the Author

William G. Wong | Senior Content Director - Electronic Design and Microwaves & RF

I am Editor of Electronic Design focusing on embedded, software, and systems. As Senior Content Director, I also manage Microwaves & RF and I work with a great team of editors to provide engineers, programmers, developers and technical managers with interesting and useful articles and videos on a regular basis. Check out our free newsletters to see the latest content.

You can send press releases for new products for possible coverage on the website. I am also interested in receiving contributed articles for publishing on our website. Use our template and send to me along with a signed release form. 

Check out my blog, AltEmbedded on Electronic Design, as well as his latest articles on this site that are listed below. 

You can visit my social media via these links:

I earned a Bachelor of Electrical Engineering at the Georgia Institute of Technology and a Masters in Computer Science from Rutgers University. I still do a bit of programming using everything from C and C++ to Rust and Ada/SPARK. I do a bit of PHP programming for Drupal websites. I have posted a few Drupal modules.  

I still get a hand on software and electronic hardware. Some of this can be found on our Kit Close-Up video series. You can also see me on many of our TechXchange Talk videos. I am interested in a range of projects from robotics to artificial intelligence. 

Sponsored Recommendations

Comments

To join the conversation, and become an exclusive member of Electronic Design, create an account today!