Error using raspi - raspi.inte​rnal.updat​eServer

조회 수: 1 (최근 30일)
Marek Cherubin
Marek Cherubin 2017년 12월 2일
댓글: Marek Cherubin 2019년 1월 22일
After successful installation of "MATLAB Support Package for Raspberry Pi Hardware"
- ssh working, targetupdater passed its upgrade process fine,
I get errors after executing
mypi = raspi()
Did anyone experienced similar problem and found the solution?
my system: Windows 7 x64
I found similar error described in "Comments and Ratings" here:
suggested FIX doesn't solve my problem
error message below:
### Updating Raspberry Pi I/O server...
### Connecting to board...
### Connected to 192.168.0.58...
### Creating server folder...
### Transferring source files...
### Building MATLAB I/O server...
Error using raspi.internal.updateServer (line 90)
Error executing command "make -C /opt/MATLAB/server_v17.2.0 -f Makefile". Details:
STDERR: In file included from /usr/include/string.h:630:0,
from devices.c:4:
devices.c:56:11: error: expected identifier or â€(’ before â€__extension__’
char *strndup(const char *s, size_t n)
^
make: *** [obj/devices.o] Error 1
STDOUT: make: Entering directory '/opt/MATLAB/server_v17.2.0'
[Compiling] auth.c
gcc -c -O2 -Wall -I/opt/userland -I/opt/userland/host_applications/linux/libs/bcm_host/include
-I/opt/userland/interface/vcos -I/opt/userland/interface/vcos/pthreads
-I/opt/userland/interface/vmcs_host/linux -I/opt/userland/host_applications/linux/apps/raspicam
-Winline -pipe -D_DEBUG -D_MATLABIO_ auth.c -o obj/auth.o
[Compiling] server.c
gcc -c -O2 -Wall -I/opt/userland -I/opt/userland/host_applications/linux/libs/bcm_host/include
-I/opt/userland/interface/vcos -I/opt/userland/interface/vcos/pthreads
-I/opt/userland/interface/vmcs_host/linux -I/opt/userland/host_applications/linux/apps/raspicam
-Winline -pipe -D_DEBUG -D_MATLABIO_ server.c -o obj/server.o
[Compiling] handler.c
gcc -c -O2 -Wall -I/opt/userland -I/opt/userland/host_applications/linux/libs/bcm_host/include
-I/opt/userland/interface/vcos -I/opt/userland/interface/vcos/pthreads
-I/opt/userland/interface/vmcs_host/linux -I/opt/userland/host_applications/linux/apps/raspicam
-Winline -pipe -D_DEBUG -D_MATLABIO_ handler.c -o obj/handler.o
[Compiling] devices.c
gcc -c -O2 -Wall -I/opt/userland -I/opt/userland/host_applications/linux/libs/bcm_host/include
-I/opt/userland/interface/vcos -I/opt/userland/interface/vcos/pthreads
-I/opt/userland/interface/vmcs_host/linux -I/opt/userland/host_applications/linux/apps/raspicam
-Winline -pipe -D_DEBUG -D_MATLABIO_ devices.c -o obj/devices.o
Makefile:46: recipe for target 'obj/devices.o' failed
make: Leaving directory '/opt/MATLAB/server_v17.2.0'
Error in raspi.updateServer (line 1205)
raspi.internal.updateServer(varargin{:});
Error in raspi/launchServer (line 805)
raspi.updateServer(obj.DeviceAddress,...
Error in raspi (line 205)
launchServer(obj);

답변 (1개)

Mulia Pratama
Mulia Pratama 2018년 1월 3일
Hi...I have exactly the same problems with you. But I managed to solve it by rather in a cowboy way. I realize that when we try to connect to Pi, matlab transfer some source files to be compiled and failed, in this case the 'devices.c' file. I also realize that when matlab transfers these files it simply overwrite the files that already exist in Pi at /opt/MATLAB/server folder from the previous connecting attempt. My idea is to replace original 'devices.c' with the modified one check : https://www.mathworks.com/matlabcentral/fileexchange/45145-matlab-support-package-for-raspberry-pi-hardware anyway...here is what I did:
1) After I execute the command: mypi=raspi('xxx.xxx.x.x','yy','zzzzzz')
2)Then I wait for the computer to transfer the source files to the Pi (you can see the status from the matlab command console). At this short time window, just before the file transfers finish, you should be able to replace the file 'devices.c' that has been modified by means of commenting out "#ifndef HAVE_STRNDUP ... #endif" section in devices.c in the '/opt/MATLAB/server_vxx.x.x'
yes, it should happen in a short time window to replace the file, including to click the overwrite button in the following pop up message. But, here is the trick...
at first attempt, the failed one, in your raspberry, you copy the file devices.c to other location and modify the file as mentioned before. After that, you right click and copy the modified file. point the file explorer to /opt/MATLAB and prepare/station your pointer position at the 'server' folder in left pane. Back to matlab in your computer, execute the command (step 1) and then wait for the right moment to paste the file in your raspberry. don't forget to hit the overwrite button.
I had to do this way two or three times before success.
  댓글 수: 2
afagh mohagheghi
afagh mohagheghi 2019년 1월 21일
Same issue here, tried everything suggested, it did'nt work, any suggestions?
Marek Cherubin
Marek Cherubin 2019년 1월 22일
My solution (worked in v2017b) based on replace of raspi.m and devices.c files.
Try to find correct versions.
After replacing of these files, execute the following commands at MATLAB command window:
clear pcode;
clear classes;
rehash path;
rehash toolbox;
rehash pathreset;
rehash toolboxreset;
rehash toolboxcache;

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

카테고리

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