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 Center および File ExchangeMATLAB 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