Switching to Matlab 2024b allowed me to succesfully set it up, but the desktop is still changed from the default which I would like to change back so I can have shortcuts for RPi connect and other things.
sudo: raspi-config: command not found when setting up matlab support package for Raspbery Pi
19 次查看(过去 30 天)
显示 更早的评论
I have reimaged and retried setting up the Matlab support package for Raspbery Pi so many times, and I keep getting different errors that include "sudo: raspi-config: command not found" when I get to the configure peripheral models step. If I reinstall raspi-config the peripheral models show up, but then I get an error that says, "Dot indexing is not suported for variables of this type."
I set up passwordless sudo via the instructions from matlab and allowed connection via SSH.
I have tried 32 and 64 bit Rasbian (bookworm), have a Raspberry Pi 5, and am running Matlab R2025a.
Also, when I install the required packages and libraries, if I reboot my Pi it boots to a command prompt, and from Google all I can find to get back to the desktop is using "startx", which brings up a desktop that I don't like as much as the default Raspian desktop, and I can't find a way to switch back.
I am working with Raspberry Pi for the first time and have spent hours trying to fix this, but any help I find on the topic is before Raspberry Pi 5 was compatible with Matlab.
回答(1 个)
Ruchika Parag
2025-7-21
Hi @Evan, from everything you’ve described while setting up the MATLAB Support Package on your Raspberry Pi 5, I think I’ve figured out what’s causing the issues and how you can fix them:
1. Operating System Compatibility
While MATLAB R2025a includes support for Raspberry Pi 5, this support is limited to the 32-bit version of Raspberry Pi OS (Bookworm). The 64-bit variant or headless builds are not currently supported and may result in missing tools such as raspi-config, which are required during the peripheral configuration process.
Recommended Action:
Please reimage your SD card using the official 32-bit Raspberry Pi OS (Bookworm), which can be downloaded from the Raspberry Pi Foundation’s website.2. Missing raspi-config Utility
The error message "sudo: raspi-config: command not found" indicates that your current OS installation either does not include the raspi-config utility or has removed it. This utility is essential for MATLAB to configure peripherals like GPIO, I2C, and SPI interfaces.
Resolution:
Once your system is running the supported OS, execute the following commands in the terminal:
sudo apt-get update
sudo apt-get install raspi-config
This will restore the required configuration tool.3. MATLAB Error: "Dot indexing is not supported for variables of this type"
This error typically occurs when the raspi() function fails to return a properly initialized Raspberry Pi object, often due to unsupported OS configurations or missing support package dependencies.
To verify initialization:
r = raspi('hostname','pi','yourpassword');
class(r)
If the result is not raspberrypi, the initialization has not succeeded. Reinstalling the support package after setting up the correct OS environment should resolve this issue.
Missing Desktop Environment
If, after rebooting, your Raspberry Pi boots to a terminal and not the usual graphical desktop, it’s likely that the desktop environment is missing or was not installed.
To restore the standard Raspberry Pi desktop environment:
sudo apt-get update
sudo apt-get install raspberrypi-ui-mods
sudo reboot
This will reinstall the LXDE-based GUI that ships with the full version of Raspberry Pi OS.Recommended Setup Procedure
- Reflash the Raspberry Pi with the official 32-bit Raspberry Pi OS (Bookworm).
- Upon initial setup, run the following commands:
sudo apt-get update
sudo apt-get install raspi-config raspberrypi-ui-mods
sudo reboot
3. In MATLAB R2025a, initiate the connection:
r = raspi('your-ip-address', 'pi', 'your-password');
class(r) % Should return 'raspberrypi'
4. Proceed with the MATLAB Hardware Setup tool to configure hardware interfaces.
Hope this resolves the issues you've encountered
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 MATLAB Support Package for Raspberry Pi Hardware 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!