Error in opening MATLAB device file for LED trigger source.

Hi, I am using the 'MATLAB support package for Raspberry Pi hardware' using MATLAB 2023a. I have installed all the necessary files on the Pi. I began following the tutorial here:
I got to the first step, ran the code
rpi = raspi('IP Address','username','password');
and was met with the following error (Practice_1 is the name of the script):
Error using Practice_1
Cannot open the device file for LED trigger source.
Any help please? I followed the tutorials accurately on the MathWorks website

6 件のコメント

Walter Roberson
Walter Roberson 2023 年 4 月 13 日
I see a hint that just maybe your raspberry pi might already have a startup program that is using ROS (robot operating system) and so the node might already be busy
This is a bit of a stretch, but it is not impossible.
If something like this were true then removing the startup program should work. Or flip to a new mini-SD memory card and reinstall the operating system.
Syed Hadi
Syed Hadi 2023 年 4 月 14 日
I saw that post and tried the steps suggested but it wasn't working. I installed a brande new OS before starting this procedure.
When I try the following in my Pi terminal:
rostopic list
I'm told "bash: rostopic: command not found". This is the same with any other command from that post.
If this is the startup program, it doesn't seem to exist. If that's the case, what's the next step? Any suggestions?
Walter Roberson
Walter Roberson 2023 年 4 月 14 日
Sorry, I do not know.
Joaquin Dillen
Joaquin Dillen 2023 年 4 月 23 日
i got the same issue... any news about this??
Syed Hadi
Syed Hadi 2023 年 4 月 26 日
Hi, no I haven't got any response, I'm in contact with MathWorks about this, so I'll update this thread once we come to a solution.
Atakan Aral Ormanci
Atakan Aral Ormanci 2023 年 4 月 27 日
I am getting the same error, i have checked the /sys/class/leds directory, it doesn't have led0 led1 led2. This might be causing the problem, i believe it has a function that when matlab is connected to RPi, it uses the leds, but in the connection phase, becouse it doesn't have the led0 activation command in the directory, it doesn't allow the connection.
But its just a guess.

サインインしてコメントする。

 採用された回答

Syed Hadi
Syed Hadi 2023 年 5 月 9 日
編集済み: Syed Hadi 2023 年 5 月 9 日

2 投票

Hi guys,
I've been in contact with MathWorks support and we've solved this issue.
Basically, if you follow the link below:
You can see a list of OS for Raspberry Pi. MATLAB doesn't support the latest versions of the OS.
What you need to do is follow the link below:
And download the file named "2022-09-22-raspios-bullseye-armhf.img.xz".
Then, you can install the OS onto your SD Card using the normal method.
I used balenaEtcher to decompress and flash the OS onto the SD card.
The development team are now aware of this issue and will look into fixing it for future OS.
Hope this helps.

2 件のコメント

Beryl Wicaksono
Beryl Wicaksono 2023 年 6 月 5 日
Hi Syed Hadi,
are you facing ssh certificate issue after installing 2022-09-22-raspios-bullseye-armhf.img.xz? How do you resolve it?
Thanks
Prasanth Sunkara
Prasanth Sunkara 2023 年 9 月 11 日
編集済み: Walter Roberson 2024 年 6 月 30 日
In my opinion using the official Raspberry Pi Imager tool is a better way to setup an image.
Please ensure you have enabled SSH and assigned proper hostname and user credentials. You may optionally enter the WiFi details as well.
There is an option in the Raspberry Pi imager tool to flash images from your PC too. Towards the end the list

サインインしてコメントする。

その他の回答 (2 件)

MathWorks MATLAB Hardware Team
MathWorks MATLAB Hardware Team 2023 年 5 月 8 日
移動済み: Walter Roberson 2023 年 5 月 8 日

5 投票

Hi All,
Follow these steps to resolve the issue,
  • Open Raspberry Pi terminal and execute
  • $ cd /opt/MATLAB/
  • $ sudo pkill mwUnifiedSrvr
  • $ sudo rm -rf *
  • Download and extract following zip files
  • In MATLAB, change your working directory to the above extracted files
  • Run >> applyPath.m file
  • Create a raspi object in matlab
  • >> r = raspi("myAddress",'pi','raspberry');
Thanks,
MathWorks
MATLAB Hardware Team

4 件のコメント

Syed Hadi
Syed Hadi 2023 年 5 月 9 日
I haven't tried this, but I just uploaded the solution I found with MathWorks.
Has anyone else tried this to see if it works?
Antonios Gementzopoulos
Antonios Gementzopoulos 2023 年 5 月 17 日
I have just tried it and it works as advertised.
Beryl Wicaksono
Beryl Wicaksono 2023 年 6 月 29 日
This solution is also work. I have tried it.
sajid ali
sajid ali 2024 年 6 月 29 日
wonderful, it worked for me as well, thank you guys

サインインしてコメントする。

Sandin Taci
Sandin Taci 2023 年 5 月 4 日

0 投票

Hey @Syed Hadi, try "raspberrypi instead of "raspi":
rpi = raspberrypi('IP Address','username','password')

3 件のコメント

Atakan Aral Ormanci
Atakan Aral Ormanci 2023 年 5 月 4 日
I just checked and it worked. it says its connected.
But there is still a problem. I just tried the starter kit, but it gives the same error. cannot open or find LED.
Sandin Taci
Sandin Taci 2023 年 5 月 4 日
Can you go through these steps again, I guess you skipped a step. Your hardware tab in the Simulink model does not look customized.
https://www.mathworks.com/help/supportpkg/raspberrypi/ref/getting-started-with-raspberry-pi-hardware.html
Atakan Aral Ormanci
Atakan Aral Ormanci 2023 年 5 月 4 日
編集済み: Atakan Aral Ormanci 2023 年 5 月 4 日
i just did the steps again and then i realised the problem is with the led.
i then tried to control a servo and it worked.

サインインしてコメントする。

カテゴリ

ヘルプ センター および File ExchangeMATLAB Support Package for Raspberry Pi Hardware についてさらに検索

質問済み:

2023 年 4 月 13 日

編集済み:

2024 年 6 月 30 日

Community Treasure Hunt

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

Start Hunting!

Translated by