failure to connect with raspberry pi 4 with 'raspi'
33 views (last 30 days)
Show older comments
when using raspi for a new connection i get an error that gpiod.h is not found.
i have followed all the suggections of copilot at no avail.
0 Comments
Answers (3)
Ran Zeimer
on 9 Dec 2025 at 0:42
2 Comments
Taylor
on 9 Dec 2025 at 16:10
Try
% Run this on your Raspberry Pi, NOT MATLAB
sudo apt-get update
sudo apt-get install gpiod libgpiod-dev
This will install command line tools and install header files and libraries. Then try connecting to the Raspberry Pi again.
Walter Roberson
on 9 Dec 2025 at 16:29
According to https://www.mathworks.com/help/matlab/supportpkg/install-support-for-raspberry-pi-hardware.html there is currently compatibility with
- 32-bit Buster OS
- 32-bit and 64-bit Bullseye OS
- 32-bit and 64-bit Bookworm OS
The support for Stretch was roughly R2021b. Jessie support started from R2016a (but ended before R2021b.)
Ran Zeimer
on 10 Dec 2025 at 1:19
1 Comment
Taylor
ungefär 5 timmar ago
Sounds like an libgpiod API mismatch. Start by confirming what version you have on the Raspberry Pi. Again, run the following code in SSH/terminal not MATLAB
# Shows the version provided by pkg-config (if installed)
pkg-config --modversion libgpiod || echo "pkg-config not found"
# Shows installed and candidate versions
apt-cache policy libgpiod-dev libgpiod2
# Peek at the header to see which API it exposes
grep -n "gpiod_line_request_output" /usr/include/gpiod.h || echo "v1 symbol not found"
grep -n "gpiod_line_settings_new" /usr/include/gpiod.h || echo "v2-only symbol not found"
If you see 2.x in apt-cache policy and the header lacks gpiod_line_request_output, you’re on libgpiod v2 headers. MATLAB’s server expects v1 symbols; v2 is not source-compatible with those calls. To install the v1 headers:
sudo apt-get update
# Install (or reinstall) the v1 dev and runtime packages from the current repo
# On Raspberry Pi OS Bookworm these resolve to 1.6.3
sudo apt-get install --yes --allow-downgrades libgpiod-dev libgpiod2
# (Optional) prevent an unintended upgrade to v2 later
sudo apt-mark hold libgpiod-dev libgpiod2
Then reconnect to your board with the raspi command in MATLAB.
See Also
Categories
Find more on Introduction to Installation and Licensing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!