Uploaded September 2025 | Updated September 2026, 2 weeks ago
Step by step tutorial how to enable I2C on Raspberry Pi and use it on an image of a custom Linux distribution built with the Yocto Project and OpenEmbedded. Enable I2C and autoload I2C Linux kernel modules by adding the following two lines in conf/local.conf:
ENABLE_I2C = "1"
KERNEL_MODULE_AUTOLOAD:rpi += "i2c-dev i2c-bcm2708"
Include packages to scan for I2C devices and interact with mini OLED SSD1306 I2C display:
IMAGE_INSTALL:append = " i2c-tools ssd1306"
To use the ssd1306 open source app and show test on the display execute:
ssd1306_bin -n 1 -I 128x64
ssd1306_bin -n 1 -c
ssd1306_bin -n 1 -r 0
ssd1306_bin -n 1 -x 1 -y 1
ssd1306_bin -n 1 -l "Hello World"
ssd1306_bin -n 1 -x 1 -y 2
ssd1306_bin -n 1 -l "The Yocto Project"
ssd1306_bin -n 1 -x 1 -y 3
ssd1306_bin -n 1 -l "on Raspberry Pi 5"
⚙️ Hardware
===
ANAVI Info uHAT
crowdsupply.com/anavi-technology/anavi-info-uhat
eu.mouser.com/c/?q=anavi%20info%20uhat
Yellow-blue Mini OLED I2C Display SSD1306
https://mou.sr/4m9jNu3
🔗 Related Videos
===
Episode 1: Building an Embedded GNU Linux Distribution
youtu.be/fY7u6PiV8qA?si=goTZ5V7I2dwa33a-
Episode 2: SSH for Remote Network Access
youtu.be/ltckiBV9FXg?si=DJwsKLDhHkDIqCIn
Episode 3: The Yocto Project on Raspberry Pi 5 Episode 3: Running Docker Containers
youtu.be/kQnOidK_U3M?si=5KiS1FK87OwfdQ0m
Episode 4: The Yocto Project on Raspberry Pi 5 Episode 4: U-Boot Bootloader
youtu.be/9tohomiv1Ug?si=kylUv0uT_BFmXt5g
Episode 5: Modifying U-Boot Environment in Linux with fw_setenv
youtu.be/SB5NvIF1IEU?si=0So6Gfv9hQR7gQgY
Episode 6: Runtime Package Management with apt and deb Packages
youtu.be/6i5UtF7fiaA?si=8DuUHUxywVEEtdyN
Episode 7: Create a New Layer, a New Recipe (.bb) and .bbappend
youtu.be/W5J1W_Cy14Y?si=ftu5WpeGqel8BZhf
Episode 8: Using ConnMan Network Manager for Wi-Fi Connectivity
youtu.be/ib8a0PeOGAU?si=jOPOYReA1woIZOJF
📚 Useful Links
===
yoctoproject.org
docs.yoctoproject.org
openembedded.org/wiki/Main_Page
github.com/armlabs/ssd1306_linux
meta-raspberrypi.readthedocs.io/en/latest/extra-build-config.html#enable-i2c
📑 Chapters
===
0:00 Intro
0:22 Enable I2C
2:22 How Does It Work
4:01 Hardware Setup
5:10 I2C Scan
7:09 SSD1306
10:14 Summary
11:17 Conclusions
Step by step tutorial how to enable I2C on Raspberry Pi and use it on an image of a custom Linux distribution built with the Yocto Project and OpenEmbedded. Enable I2C and autoload I2C Linux kernel modules by adding the following two lines in conf/local.conf:
ENABLE_I2C = "1"
KERNEL_MODULE_AUTOLOAD:rpi += "i2c-dev i2c-bcm2708"
Include packages to scan for I2C devices and interact with mini OLED SSD1306 I2C display:
IMAGE_INSTALL:append = " i2c-tools ssd1306"
To use the ssd1306 open source app and show test on the display execute:
ssd1306_bin -n 1 -I 128x64
ssd1306_bin -n 1 -c
ssd1306_bin -n 1 -r 0
ssd1306_bin -n 1 -x 1 -y 1
ssd1306_bin -n 1 -l "Hello World"
ssd1306_bin -n 1 -x 1 -y 2
ssd1306_bin -n 1 -l "The Yocto Project"
ssd1306_bin -n 1 -x 1 -y 3
ssd1306_bin -n 1 -l "on Raspberry Pi 5"
⚙️ Hardware
===
ANAVI Info uHAT
crowdsupply.com/anavi-technology/anavi-info-uhat
eu.mouser.com/c/?q=anavi%20info%20uhat
Yellow-blue Mini OLED I2C Display SSD1306
https://mou.sr/4m9jNu3
🔗 Related Videos
===
Episode 1: Building an Embedded GNU Linux Distribution
youtu.be/fY7u6PiV8qA?si=goTZ5V7I2dwa33a-
Episode 2: SSH for Remote Network Access
youtu.be/ltckiBV9FXg?si=DJwsKLDhHkDIqCIn
Episode 3: The Yocto Project on Raspberry Pi 5 Episode 3: Running Docker Containers
youtu.be/kQnOidK_U3M?si=5KiS1FK87OwfdQ0m
Episode 4: The Yocto Project on Raspberry Pi 5 Episode 4: U-Boot Bootloader
youtu.be/9tohomiv1Ug?si=kylUv0uT_BFmXt5g
Episode 5: Modifying U-Boot Environment in Linux with fw_setenv
youtu.be/SB5NvIF1IEU?si=0So6Gfv9hQR7gQgY
Episode 6: Runtime Package Management with apt and deb Packages
youtu.be/6i5UtF7fiaA?si=8DuUHUxywVEEtdyN
Episode 7: Create a New Layer, a New Recipe (.bb) and .bbappend
youtu.be/W5J1W_Cy14Y?si=ftu5WpeGqel8BZhf
Episode 8: Using ConnMan Network Manager for Wi-Fi Connectivity
youtu.be/ib8a0PeOGAU?si=jOPOYReA1woIZOJF
📚 Useful Links
===
yoctoproject.org
docs.yoctoproject.org
openembedded.org/wiki/Main_Page
github.com/armlabs/ssd1306_linux
meta-raspberrypi.readthedocs.io/en/latest/extra-build-config.html#enable-i2c
📑 Chapters
===
0:00 Intro
0:22 Enable I2C
2:22 How Does It Work
4:01 Hardware Setup
5:10 I2C Scan
7:09 SSD1306
10:14 Summary
11:17 Conclusions










