Hi,
I’m using a Raspberry Pi 5 with the fresh latest OS and the MATLAB Support Package for Raspberry Pi. Last week I made a simple visualisaztion for gyroscope through i2c and it worked nicely. But today I had problem with this error when i try to do raspi
mypi = raspi('192.168.0.212', 'admin', 'raspberry');
Cannot query I2C bus speed.
Caused by:
Error using matlabshared.internal.ssh2client/execute
Error executing command "sudo cat /sys/module/i2c_bcm2708/parameters/baudrate". Details:
STDERR: cat: /sys/module/i2c_bcm2708/parameters/baudrate: No such file or directory
STDOUT:
So i looked everywhere, made a fresh OS install, flashed a bootloader. I tried enabling via GUI, raspi-config and matlab. Nothing worked. Interestingly when I disable i2c interface on pi I no longer get this error and can do things in matlab.
My /boot/config.txt correctly enables I2C and sets the baudrate:

댓글 수: 1

Patrik
Patrik 2025년 6월 18일
I also want to add that in linux I can acces the sensor without a problem.

댓글을 달려면 로그인하십시오.

 채택된 답변

Patrik
Patrik 2025년 6월 18일
편집: Walter Roberson 2025년 6월 18일

3 개 추천

So I finally figure it out by
sudo modprobe i2c-bcm2708
that creates that baudrate file that Matlab is trying to read.

댓글 수: 1

Xiaoxing Wang
Xiaoxing Wang 2025년 9월 13일
편집: Xiaoxing Wang 2025년 9월 13일
Great answer. I had the same symptom and now my Raspberry Pi 5 works.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 MATLAB Support Package for Raspberry Pi Hardware에 대해 자세히 알아보기

제품

릴리스

R2025a

태그

질문:

2025년 6월 18일

편집:

2025년 9월 13일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by