Your submission was sent successfully! Close

  1. Blog
  2. Article

Vergil Yotov
on 23 September 2022

IoT Project Lifecycle: Efficient prototyping with Snaps and Ubuntu Core [Part I]

There is nothing more exciting than creating something new. Whether developing a new idea, coding a new software feature or creating a new product altogether. After a lot of hard work, we can finally see users interacting with the system and sharing their feedback. The quickest way to reach that point in a project is to start prototyping early.

With an abundance of hardware and software available, it has never been easier to create a working prototype. If a picture is worth a thousand words, then a prototype is worth a thousand meetings. Providing an interactive solution to stakeholders and potential users is the easiest and fastest way to convey and validate your ideas.

Being efficient

As far as IoT prototypes are concerned, creating a technical prototype is both overwhelming and fun. There are so many applications, services, software repositories and containers that can be tried and used directly. It is somehow easy to get distracted by all the options. And we haven’t even talked about hardware. The easiest thing to do is pick a few proven or promising solutions, mash them up together and quickly adapt them to suit your needs. With deadlines on your back, getting something done is the main priority.

But how transferable is that to production? It can be tempting not to think about it. Just make it work and worry about it later. With a mindset like that, the first thing to do after playing around with the prototype would be to throw it away and start from scratch. To make this process more efficient you would have to create something closer to the real solution. A better prototype would be something to iterate and build upon.

A good way to do that is to start with a blank sheet. Pick a sturdy software platform that you know is going to be there for decades to come. You can use existing hardware to validate your solution. Packaging your applications in an OS native format gives you the piece of mind that your solution will be directly deployable to production hardware. 

Snaps and Ubuntu Core give you exactly this. Learning how to package applications as snaps is an investment that is well worth it in the long run.

What do you need to get started?

A laptop or desktop of your choice and some free time! Let’s say an IoT developer has created a simple script for sensor acquisition or a more complex application with multiple microservices. It works fine on Ubuntu Desktop or in a VM and you are curious how it would work on an industrial device or a whole fleet of different devices. A manager would ask: how feasible would it be to support that application across a diverse range of platforms and how would it scale to thousands of devices? The answer is simple. Packaged as a snap, an application will run on all supported Ubuntu Flavours and versions. All snaps are distributed through the Snap Store, which can serve regular updates to millions of devices.

To get started you can check out the guide on snap creation. Snaps are packaged using the Snapcraft tool. Once installed, Snapcraft will help you package your application as defined with a YAML file. Development experience is great on Ubuntu Desktop, but snaps can be built on both MacOS and Windows too. If you want to speed up building and iterating snaps, it’s best to build using LXD.

To learn how to manage snaps locally on your system, you can check out the quickstart guide on There are a lot of features to play with and things to learn, but probably the most important concept is Snap confinement

Snap confinement level and permissions define how isolated an application is from the host operating system and the rest of its applications. Thinking early about security can be very helpful in avoiding any challenges further down a project. Knowing what permissions your application needs in advance can be difficult. To get started it’s best to check that your application is working properly and then apply additional security controls to it. The documentation page on debugging snaps can be really helpful. 

It’s amazing how much can be done after spending some quality time developing. However, an IoT prototype would not be complete without actual hardware running your brand new snaps. 

Photo by Tool., Inc on Unsplash

Try your prototype on real hardware

One of the best operating systems for running IoT applications is Ubuntu Core. Ubuntu Core consists entirely of snaps. This is great, because you can get the most out of the snap security and reliability features. A snap or a collection of snaps can be easily deployed to an Ubuntu Core installation, not just in a VM, but also on a range of supported platforms. The getting started documentation of Ubuntu Core is a good place to start. If you want to jump straight to using it, you can grab a Raspberry Pi or an Intel NUC or even an old desktop or a laptop and install Ubuntu Core on it. If you would like to see the whole process this video on getting started with Ubuntu Core on Raspberry Pi shows it all.

Once installed, you can log in to your Ubuntu Core device by using the SSH key associated with your Ubuntu SSO account. Since the operating system comes with a strict security configuration, password access over SSH is disabled by default. After login you can copy your snaps over SSH or install a range of wide available applications directly from the Snap Store.

In the field of IoT, the interaction between devices and the physical world is essential. This could happen through a variety of technologies like sensors, actuators or interfaces that monitor and control industrial machines. It’s a good idea to test such interfaces if they are available and make sure that your snap has permissions to use them. To see a real-life example of how custom hardware interfaces can be used securely,  check out this guide for using Raspberry Pi’s GPIO to control an external fan

Ready for production and scaling up

Prototyping can be hard work. Being able to transfer that to production can greatly speed up your development process. Snaps can be really helpful in that aspect. All effort spent prototyping snaps will be directly applicable to your production system. 

The best way to reach millions of devices with your application is to publish it on the Snap Store. Even a complex system of microservices can run securely on Ubuntu Core. A good example for this is the IoT framework EdgeX. Your applications, packaged as snaps, can be built remotely or as part of a CI/CD pipeline. This can streamline the delivery of new code straight to all devices that need it. 

In situations where you don’t want to expose your application publicly you can use a dedicated IoT Snap Store. The dedicated snap store gives you private software distribution at a global scale. You have the ability to manage the flow of software between your developers, devices, customers and partners. With it you can power a whole ecosystem of applications specifically suited for your needs. Sometimes, software needs to be deployed in challenging or sensitive environments. In such cases global distribution might not be the best solution. With the air gapped mode of the enterprise snap store you can distribute private applications that never leave your perimeter. 

Whatever the use case, snaps make great sense when creating easy to maintain IoT projects. With a strong security posture, wide platform compatibility and an integrated software distribution system, they make delivering IoT projects efficient and scalable. 

Learn more about other phases in the IoT project lifecycle

This blog post is the first in the series of blog posts on IoT lifecycle management. Stay tuned for the next parts to find out how to move to production hardware and beyond. Make sure to check out the guide on IoT lifecycle management

Further reading

Ready to get started with your IoT project and curious to find out what challenges might lie ahead? Read the white paper: Top 5 IoT challenges and how to solve them.

Why is Linux the OS of choice for IoT devices? Find out with the official guide to Linux for embedded applications

Working on a new IoT project, but unsure which OS to pick? Learn about the trade-offs between Yocto and Ubuntu Core.

Related posts

12 September 2023

이제 인텔 SoC에서 일반적으로 사용 가능한 최적화된 실시간 우분투

IoT Article

Canonical이 TSN 및 인텔 TCC를 지원하는 인텔 코어 프로세서에서 실시간 우분투를 제공 2023년 7월 26일, 런던: Canonical은 오늘 인텔 코어 프로세서에 최적화된 실시간 우분투를 이용할 수 있음을 발표했습니다. 이 솔루션을 통해 기업은 통신회사 워크로드에서 생명을 구하는 의료 장비 및 공장용 자동화 시스템에 이르기까지 광범위한 사용 사례에 인텔 실리콘에 최적화된 리눅스의 성능을 이용할 수 있습니다. Canonical의 ...

26 July 2023

Optimised Real-time Ubuntu is now generally available on Intel SoCs

IoT Article

Canonical delivers Real-time Ubuntu on Intel Core processors with TSN and Intel TCC support London, 26 July 2023: Canonical today announced the availability of Real-time Ubuntu optimised on Intel Core processors.  The solution enables enterprises to harness the power of optimised Linux on Intel silicon for a wide range of use cases, from ...

6 July 2023

불변의 리눅스 데스크톱 기반으로서의 우분투 코어(Ubuntu Core)

Desktop Article

캐노니컬(Canonical)은 IoT를 위한 완전한 컨테이너 플랫폼을 만들기 위해 2014년에 우분투 코어 개발을 시작했습니다. 우분투 코어에서는 도커(Docker) 및 LXC가 구축된 것과 동일한 커널 컨테이너 기술을 사용하여 잘 정의된 업그레이드 및 롤백을 통해 시스템의 모든 구성 요소를 안전한 샌드박스에 넣습니다. 저희는 자율적으로 연결된 사물 인터넷 장치가 사람의 개입 없이 적용할 수 있는 업데이트를 수신하여 에지에서 보안 및 ...