3

I'm trying to enable i2c on my raspberry pi 3B running Ubuntu 18.04 server for arm64. The standard method (using raspi-config) fails because the command cannot be found nor installed (unable to locate package raspi-config). I realize raspi-config is just a convenience feature and theoretically I could edit some files by hand, couldn't find any tutorials for doing this on Ubuntu 18.04. Is there a guide somewhere to enable i2c on a pi 3 running Ubuntu 18.04 server?

anvoice
  • 453

2 Answers2

5

Here is how I managed to install raspi-config on the Pi 3 B running Ubuntu 18.04 server for ARM64:

wget -4 https://archive.raspberrypi.org/debian/pool/main/r/raspi-config/raspi-config_20210604_all.deb -P /tmp
apt-get install libnewt0.52 whiptail parted triggerhappy lua5.1 alsa-utils -y
apt-get install -fy
dpkg -i /tmp/raspi-config_20210604_all.deb

After these commands, raspi-config (albeit seemingly an older version) was installed on the Raspberry Pi. It does give a warning that it's only meant to work on Raspbian, but it seems to have done the job for me. After installing raspi-config, I had to mount the boot partition:

sudo mount /dev/mmcblk0p1 /boot

And then use sudo raspi-config, following the prompts to enable i2c (in Advanced Settings->i2c). Then ls /dev/i2c* responds with /dev/i2c-1, indicating that i2c is enabled. I then managed to detect my i2C device using sudo i2cdetect -y 1. I found the instructions for installing raspi-config in a script here.

waldyrious
  • 2,207
anvoice
  • 453
0

Add the ubuntu-pi-flavour-makers repository.

sudo add-apt-repository ppa:ubuntu-pi-flavour-makers/ppa

This will install the ppa and the pgp key to your apt keystore.
If you are using eoan (Ubuntu 19.10), then you need to edit /etc/apt/sources.list.d/ubuntu-pi-flavour-makers-ubuntu-ppa-eoan.list with your favorite text editor as root.

sudo nano /etc/apt/sources.list.d/ubuntu-pi-flavour-makers-ubuntu-ppa-eoan.list

Replace eoan with bionic so the file content is as shown below. Uncomment (remove the #) if you want the source code repository added, this is usually not needed unless you want to have a look at or make changes to the code.

deb http://ppa.launchpad.net/ubuntu-pi-flavour-makers/ppa/ubuntu bionic main
# deb-src http://ppa.launchpad.net/ubuntu-pi-flavour-makers/ppa/ubuntu bionic main

Then you can install the raspi-config package and all it's dependencies with the apt package manager:

sudo apt update
sudo apt install raspi-config
FalcoGer
  • 925