Connect Matlab with RaspberryPi 3, Firmware 4.4.9

1 次查看(过去 30 天)
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