Categories: BlogCanonicalUbuntu

Ubuntu 22.10 on the Raspberry Pi delivers new display support and the full MicroPython stack

When it comes to Raspberry Pi support, the theme of Ubuntu 22.10 is definitely embedded devices.

In this release, Ubuntu now supports a range of embedded display HATs as well as under-the-hood improvements to the GPIO stack as we transition from RPI.GPIO to lgpio (more about that later).

Sponsored

In addition we’ve worked hard to support the Raspberry Pi’s even smaller cousin, the Raspberry Pi Pico W with the full MicroPython stack now available in the Ubuntu repositories.

We’ll run through these highlights and more in the rest of this post, but as usual Dave ‘Waveform’ Jones, our resident Raspberry Pi engineer at Canonical, has put together a suite of detailed blog posts to provide additional backstory to each feature. Check them out as we go through.

Get hyped for Hyperpixels

Behind the scenes, the graphics stack for the Raspberry Pi has undergone a significant transition, moving from fake KMS (or fkms) which involved closed-source firmware running on the GPU separately from the Linux kernel, to the open-source ‘full’ KMS (or, confusingly, just kms) which puts the Linux kernel directly in charge.

This migration has made supporting display HATs easier since Ubuntu can now treat them as a standard display with only minor tweaks.

It means that with Ubuntu 22.10, you can now use the Hyperpixel display range, the Raspberry Pi Official Touchscreen Display and the Inky eInk series out of the box.

Whilst it’s not the ideal way to experience Ubuntu Desktop, it’s certainly a novelty to see it running on such a small screen, with touch support. Remember to bring your reading glasses!

Ubuntu 22. 10 on the raspberry pi delivers new display support and the full micropython stack 5
Ubuntu 22. 10 on the raspberry pi delivers new display support and the full micropython stack 6

For more serious embedded application work, try Kivy, a python based framework for touchscreen interfaces, available in the Ubuntu archive. Or Qt, a popular framework used in Kubuntu which is able to run outside of a full windowing environment without the need for Pi-specific drivers, making it lightweight, performant and portable.

For more information on these demo projects check out Hyping Pixels on Dave’s blog.

MicroPython for Microcontrollers

If you’re struggling to get your hands on a Raspberry Pi, now might be a good time to start experimenting with the Raspberry Pi Pico W. It’s smaller, cheaper and uses less power than a Raspberry Pi Zero 2 W. For industrial and IoT use cases, porting processes over to the Pico could deliver a significant advantage.

As a microcontroller, the Pico isn’t powerful enough to run a full operating system, but with languages like MicroPython you can run Python code directly on the hardware

Sponsored

For Ubuntu 22.10 we’ve included the full MicroPython developer stack in the Ubuntu repositories, enabling you to apt-install all the development tools you need to get started with Microcontroller development. This includes rshell and mpremote for remote development and Thonny, a mini Python IDE for beginners.

Preparing for the future: transitioning the GPIO interface

This release we’ve also made a big change behind the scenes to move Ubuntu from relying on the now deprecated sysfs-gpio to an lgpio solution. Similar to the fkms to kms transition (do you remember which is which?) lgpio gives the kernel control of the GPIO pins rather than letting libraries interact with them directly.

In the long term, this is a significant improvement in both security and application management as it prevents two applications from trying to access the same pins simultaneously. In the short term, many key libraries that Raspberry Pi HATs rely on, such as RPi.GPIO, assume the use of sysfs-gpio.

To ensure there is no interruption in support for existing HATs, Ubuntu 22.10 now ships with a compatibility shim, the creatively named RPi.LGPIO. This allows us to boldly move forward with lgpio without fear of breakages!

To enable the shim, run:

apt install python3-rpi-lgpio

This will remove the existing python3-rpi.gpio and run in its place for packages that depend on this library

The history of this migration is so long that Dave has written not one, but two blogs about the origins of this change and his journey to achieve this migration: 

That’s all folks!

We hope you enjoy all of the new tools available for IoT developers available in this latest release of Ubuntu and look forward to seeing the creative projects and applications that these enable

Share your work in the Raspberry Pi discourse channel or check out some of our past blogs and tutorials for more inspiration on how to get started with the Raspberry Pi.

Tutorials

Projects

Ubuntu Server Admin

Recent Posts

How to Install Google Cloud BigQuery Python client library on Linux

In this article, we will see how to Install Google Cloud BigQuery Python client library…

2 days ago

Wallpaper Contest for Xfce 4.20 open for voting

Nov 15,2024 Wallpaper Contest for Xfce 4.20 open for voting The submission phase for the…

2 days ago

Canonical announces the first MicroCloud LTS release

MicroCloud 2.1.0 LTS is now available, expanding the number of Canonical infrastructure solutions with a…

3 days ago

Join Canonical in Paris at Dell Technologies Forum

Canonical is thrilled to be joining forces with Dell Technologies at the upcoming Dell Technologies…

4 days ago

Bringing automation to open source 5G software at Ubuntu Summit 2024

In today’s massive private mobile network (PMN) market, one of the most common approaches to…

5 days ago

Ubuntu Weekly Newsletter Issue 865

Welcome to the Ubuntu Weekly Newsletter, Issue 865 for the week of November 3 –…

6 days ago