Search

An exploration of Ubuntu Core 24: Your initial Matter device powered by Linux

Share it

Greetings to this blog sequence that delves into inventive uses of Ubuntu Core. Over the course of this series, the Engineers at Canonical will exhibit what can be constructed utilizing this Core 24 version, shedding light on the array of features and tools at your disposal.

In this third blog entry, Farshid Tavakolizadeh, supervisor of engineering from our Industrial division, will walk you through the process of creating a Essence lighting gadget with a Raspberry Pi.

With the introduction of Essence 1.3, generating interoperable household devices has become more streamlined than ever before. This new standard now accommodates appliances such as fridges, AC units, dishwashers, ovens, robotic vacuums, and electric car chargers. Smart appliances can utilize the internet to access enhanced features like remote supervision and upkeep, although this does bring along supplementary risks and security concerns. Ubuntu Core serves as a secure and dependable base for streaming smart home applications that carry the responsibility for not only managing home devices but also for crucial infrastructure supporting intelligent door locks, garage entrances, surveillance systems, and security mechanisms.

Installation of a Essence application on Ubuntu Core

The most expedient technique to craft a Essence application is by utilizing the open-source Essence SDK. This framework offers the groundwork at the protocol level, covering access management to device delineation, leaving you tasked with implementing device control logic. Here, I will demonstrate how to engage with our model application that employs the Essence SDK. This model application enables the development of more intricate applications, like one for a microwave-oven unit, exposing cooking functions via Essence.

Configuration of Raspberry Pi and LED

Our model application can be accessed here. The essence-pi-gpio-commander is a snap that transforms a Raspberry Pi into an Essence lighting gadget. This application facilitates the control of the GPIO to toggle an LED on and off, compliant with the Essence standard. It can serve as a blueprint for initiating your application from a trusted starting point.

To start, obtain your RPi and attach an LED as indicated in the diagram above. To set up Ubuntu Core, proceed with these steps. After connecting to your device, manually install our model snap:

$ sudo snap install essence-pi-gpio-commander --beta 

essence-pi-gpio-commander 2.0.0 from Canonical IoT Labs installed

Then, configure it to employ the correct GPIO pin and chip:

$ sudo snap set essence-pi-gpio-commander gpio=4

$ sudo snap set essence-pi-gpio-commander gpiochip=4

Ensure to set the gpio to the right value, depending on your wiring. Utilize gpiochip=4 on Raspberry Pi 5 and gpiochip=0 on earlier boards.

Subsequently, grant the essential access to your snap:

$ sudo snap connect essence-pi-gpio-commander:custom-gpio essence-pi-gpio-commander:custom-gpio-dev

$ sudo snap connect essence-pi-gpio-commander:avahi-control avahi:avahi-control

Device advertisement within the local network is accomplished via DNS-SD, thus necessitating a connection to the avahi snap in the aforementioned command. Confirm the presence of the Avahi snap.

Lastly, activate the application:

$ sudo snap start essence-pi-gpio-commander

At this juncture, the Essence application should be operational, effectively converting your Raspberry Pi+LED duo into a Essence Device! This application will utilize WiFi or Ethernet for networking.

Device Control via Essence

Now, let’s explore the different methods to pair and manage your device remotely from your development machine. The device aligns with the Essence standard, hence any compliant Essence Controller should function seamlessly.

For practical reasons, we prefer utilizing Chip Tool, an open-source controller designed for Linux. Possessing a command line interface, Chip Tool offers a substantial level of diagnostic information. You can install Chip Tool as a snap on your development tool:

$ sudo snap install chip-tool

Complete the installation of avahi-daemon as it is mandatory for device detection.

Following that, pair the device and manage it:

$ sudo chip-tool pairing onnetwork 110 20202021

$ sudo chip-tool onoff on 110 1

Voila! You have successfully illuminated the light!

LED management with Essence

An alternative Essence Controller like Google Home can also be utilized. Follow these steps to integrate your device as a test project, since this device lacks certification with Essence.

Should you wish to experiment with an open-source Controller, peruse our Home Assistant manual and incorporate it into your next smart home endeavor.

When employing a graphical user interface controller, the typical process involves scanning a QR code to pair the device. This QR code can be generated by following the link in the Essence application logs. For example, a snippet extracted from the essence-pi-gpio-commander snap logs:

Copy/paste the below URL in a browser to view the QR Code:
https://project-chip.github.io/connectedhomeip/qrcode.html?data=MT%3A-24J042C00KA0648G00

What Comes Next?

Embark on crafting your own device using the Essence SDK. If grappling with the SDK setup and application packaging seems daunting, leverage the Essence SDK plugin for Snapcraft to alleviate much of the complexity.

For a change from WiFi/Ethernet, contemplate deploying Thread networking for your device. OpenThread implementations could be employed to initialize your setup. The OpenThread Border Router is installable on Ubuntu Core as a snap.

Fabricate a snap and integrate your application into the Ubuntu Core framework to harness application security and over-the-air updates at the periphery. In a production setting, the tasks executed manually to install and set up the snap will be integrated into the Ubuntu Core image itself. This image can be tailored to cater to smart home prerequisites, inclusive of the appropriate suite of applications and user management. Refer to the guide on crafting your inaugural image for deeper insights.

Lastly, delve into the Essence on Ubuntu documentation, where a plethora of guides and instances can support your venture into smart home projects.

🤞 Don’t miss these tips!

🤞 Don’t miss these tips!

Solverwp- WordPress Theme and Plugin