Connect Matlab with RaspberryPi 3, Firmware 4.4.9

조회 수: 1 (최근 30일)
s p
s p 2016년 5월 26일
댓글: Walter Roberson 2016년 10월 18일
Hey guys, i want to connect my raspberry pi 3 with matlab using the command mypi=raspi('169.254.0.2','pi','password'). It worked really fine until i made an update on the raspberry from v4.1.19 to v4.4.9 If i undo this update, i can connect it again, but i need the update. Here you can see the error report:
Index exceeds matrix dimensions.
Error in raspi/getLEDConfiguration (line 684)
trigger = ret{1}
do you have any ideas, why this happens and what i can do to connect it?
  댓글 수: 2
Venkatachala Sarma
Venkatachala Sarma 2016년 5월 30일
1. Which version of MATLAB are you using?
2. Are you using Raspbian or any other OS. Could you provide a link from where you are downloading the OS?
3. Could you try the steps provided in the following link and let us know which step is throwing the error?
s p
s p 2016년 6월 1일
  1. Matlab 2016a/Windows 7 und Windows 10
  2. the OS comes from the support package
  • Im pretty sure it has something to do with the newest firmware of my raspi, but i found a little workaround: in raspi.m in function getAvaiablePeripherals(obj) I removed/commented the line 897
obj.LED.(id).Trigger=getLEDConfiguration(obj,name)
Now everthing works nicely again, except the onboard LED. I cant talk to it with Matlab, but i can live with that^^

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

답변 (1개)

Shogo Muramatsu
Shogo Muramatsu 2016년 9월 9일
편집: Shogo Muramatsu 2016년 9월 9일
Empty "ret" is the reason.
On your raspberry pi, check the contents of the following file:
/sys/class/leds/led0/trigger
If you find "[mmc0]" after 80 letters in the file, lookfor the following file:
/opt/MATLAB/server v16.1.0/LED.c
find the line 88,
ret = read(fd, (void *)trigger, 80);
and increase the 3rd argument so that "[mmc0]" in "trigger" file is succesfully returned.
Finally, execute the following commands on your raspberry pi:
$ cd /opt/MATLAB/server_v16.1.0
$ sudo make
$ sudo kill -KILL `pgrep MATLABIOserver`
You'd be able to uncomment the line 897 in raspi.m.
  댓글 수: 2
Xingchi Su
Xingchi Su 2016년 10월 18일
I have followed your procedure, but the errors still exist. Could you please show how did you changed the 3rd argument in
ret = read(fd, (void *)trigger, 80);
Thanks a lot!
Walter Roberson
Walter Roberson 2016년 10월 18일
Search the /sys/class/leds/led0/trigger file and figure out the character position at which the string '[mmc0]' ends in it -- the number of the last character position for it. Now increase that 80 of the read() to be at least as large as that character position.

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

카테고리

Help CenterFile 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!

Translated by