Connect Matlab with RaspberryPi 3, Firmware 4.4.9

1 vue (au cours des 30 derniers jours)
s p
s p le 26 Mai 2016
Commenté : Walter Roberson le 18 Oct 2016
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 commentaires
Venkatachala Sarma
Venkatachala Sarma le 30 Mai 2016
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 le 1 Juin 2016
  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^^

Connectez-vous pour commenter.

Réponses (1)

Shogo Muramatsu
Shogo Muramatsu le 9 Sep 2016
Modifié(e) : Shogo Muramatsu le 9 Sep 2016
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 commentaires
Xingchi Su
Xingchi Su le 18 Oct 2016
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 le 18 Oct 2016
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.

Connectez-vous pour commenter.

Catégories

En savoir plus sur MATLAB Support Package for Raspberry Pi Hardware dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by