Your submission was sent successfully! Close

Jump to main content
  1. Blog
  2. Article

Rhys Davies
on 30 April 2020

How to use the Raspberry Pi High Quality camera on Ubuntu Core

The new High Quality (HQ) camera from the people over at Raspberry Pi is now available. And as they say, it is really rather good. It has the option for interchangeable lenses, a 12 MP sensor, a distinct improvement from the previous 8MP V2 camera, and a tripod screw mount. In this post, I’ll walk you through the steps to stream video on Ubuntu Core and how to properly focus the camera for different lenses with and without the C mount.

What you will need

If you plan on following along with this guide, this is the list of things you will need:

  • A microSD card (4GB minimum, 8GB recommended)
  • A computer with a microSD card drive
  • A Raspberry Pi 2, 3 or 4
  • A micro-USB power cable (USB-C for the Pi 4)
  • A Wi-Fi network or an ethernet cable with an internet connection
  • A monitor with an HDMI interface
  • An HDMI cable for the Pi 2 & 3 and a micro HDMI cable for the Pi 4
  • A USB keyboard
  • The new HQ Raspberry Pi Camera
  • C and or CS-mount compatible lenses. 
These things, among others

Setting up Ubuntu Core with the HQ Camera

First, to get going with Ubuntu we’re going to need to install and set up Ubuntu Core on the Raspberry Pi. The best way to do this is to open the tutorial in a new tab, follow along to where you can SSH into the Pi, and come back when you’re done.

Once you’re in, we need to enable the camera for the board. This is a little hacky at the moment as you need to go into the config file to do it, but don’t worry. It’s nice and easy and we are working on making this process much more seamless. More on that later. 

Enable the camera to work with Ubuntu Core

Access the uboot config file with this command:

sudo vi /boot/uboot/config.txt

Once the file is open, scroll down to the last line and then type the following commands:


This will initiate insertion mode so you can add to the file. Next scroll to the bottom of the file and type:


This is the line that enables the camera. That’s it. Now to save and exit the file hit ‘Esc’ escape on your keyboard to exit insertion mode and type


to save and exit the file. To be clear: 

Next, we need to install picamera-demo-application. This is a snap in the snap store developed and maintained by Ogra, a Canonical engineer. To do this use the following command:

snap install picamera-streaming-demo

Connect the camera and connect to the web

Now we can wire the camera up to the Raspberry Pi. In this example, we use the Raspberry Pi 3 Model B. It is important to connect the camera in the right way, pay attention in the following image to the orientation of the ribbon cable. The blue side facing towards the USB ports.

To connect it in this way, pull the black tab gently upwards until you feel it click. Slot the ribbon, orientated as shown, into the space, and press the black tab back down to secure it.

For clarity, this is an example of how not to connect it (in the wrong port):

This would be foolish, that is not the CSI port for the camera. Always take pretty photos after you have set everything up and it’s working.

Once that’s connected, reboot the Raspberry Pi with:

sudo reboot

Wait a few moments and in your browser type:

http://<board IP address>:8000/

And you will be able to see what your camera sees in a web page like this:

This image was taken using the 6mm lens, with bad lighting and then saved using a screenshot tool so doesn’t show quite how quality these photos can be. 

Focusing with and without the C-mount

Being able to focus the camera, is of course, crucial. For a photography novice like me, it took a while to work out how to do it. The C-mount is a type of mount usually found on 16mm cameras. Of the two lenses I bought, one required the C-mount, the other a CS-mount. A CS-mount lens is designed to be mounted ~ 5mm closer to the image sensor than a C lens. It’s important to note this before playing around with the lenses and misplacing the C-mount bracket and wondering why your 16mm lens won’t focus for an hour or so.

C-mount bracket for focusing C-mount lenses

What’s next

We are working to do a lot more to improve the user experience of Ubuntu on Raspberry Pi. This tutorial was non-typical. Usually, tutorials live at, where you can find ‘how-tos’ on getting set up with Ubuntu Server, or other projects, like building a Raspberry Pi cluster using MicroK8s

This tutorial utilises Ubuntu Core, Ubuntu Core is not developer-friendly, we recommend its use for appliances, for fire-and-forget devices and for production. If you want to try other applications or build applications for the Raspberry Pi on Ubuntu we recommend you look into snaps and Ubuntu Server and take it from there. 

Related posts

6 July 2023

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

Desktop Article

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

2 June 2023

임베디드 Linux 배포판을 선택하는 데 도움이 필요하신요? 여기에서 안내를 받으세요

IoT Article

기업들은 소형 폼 팩터 컴퓨팅의 새로운 물결을 활용하고 엣지로 전환하는 길을 찾기 위해 모색하고 있습니다. 전 세계의 디바이스 제조사들은 제4차 산업혁명의 가능성을 구현할 임베디드, 커넥티드 디바이스를 구축하기 위해 경쟁하고 있습니다. 그중 많은 기업들이 데이터 기반 밸류 체인의 최적화, 예측 유지 관리 또는 새로운 디지털 고객 경험을 모색하고 있습니다. 하지만 현장의 디바이스를 최신 상태로 유지하는 것은 ...

Oliver Smith
31 May 2023

Ubuntu Core as an immutable Linux Desktop base

Desktop Article

Join us as we discuss the architecture of immutable operating systems and the role of Ubuntu Core in the future of the immutable Linux desktop. ...