I am trying to connect my raspberry pi to MATLAB but I get following error. What should I do?

6 views (last 30 days)
I am trying to connect my raspberry pi to MATLAB but I get following error.
mypi = raspi('10.19.9.112','pi','raspberry')
### Updating Raspberry Pi I/O server...
### Connecting to board...
### Connected to 10.19.9.112...
### Installing nanomsg Library (this might take a while)...
### Creating server folder...
### Transferring source files...
### Building MATLAB I/O server...
Error executing command "make -C /opt/MATLAB/server_v18.1.0 -f
Makefile". Details:
STDERR: server.c: In function ‘bindSocket’:
server.c:44:13: warning: pointer targets in passing argument 1
of ‘sprintf’ differ in signedness [-Wpointer-sign]
sprintf(serverAddr, "tcp://*:%d",port);
^~~~~~~~~~
In file included from server.c:1:0:
/usr/include/stdio.h:366:12: note: expected ‘char *
restrict’ but argument is of type ‘unsigned char *’
extern int sprintf (char *__restrict __s,
^~~~~~~
server.c:55:25: warning: pointer targets in passing argument 2
of ‘nn_bind’ differ in signedness [-Wpointer-sign]
ret = nn_bind(sock, serverAddr);
^~~~~~~~~~
In file included from server.c:14:0:
/usr/local/include/nanomsg/nn.h:352:15: note: expected ‘const
char *’ but argument is of type ‘unsigned char *’
NN_EXPORT int nn_bind (int s, const char *addr);
^~~~~~~
server.c: In function ‘main’:
server.c:128:15: warning: unused variable ‘thread’
[-Wunused-variable]
pthread_t thread;
^~~~~~
server.c:127:15: warning: unused variable ‘clientSock’
[-Wunused-variable]
int sock, clientSock;
^~~~~~~~~~
handler.c: In function ‘receiveRequest’:
handler.c:232:26: warning: passing argument 2 of ‘sockRecv’
from incompatible pointer type [-Wincompatible-pointer-types]
ret = sockRecv(sock, req, sizeof(REQUEST_Header_t));
^~~
handler.c:116:12: note: expected ‘char *’ but argument is
of type ‘REQUEST_t * {aka struct <anonymous> *}’
static int sockRecv(int sock, char *req, int size)
^~~~~~~~
handler.c: In function ‘executeCommand’:
handler.c:588:13: warning: this ‘while’ clause does not
guard... [-Wmisleading-indentation]
while(fgets(tempBuff,40 ,fp)!=NULL);
^~~~~
handler.c:589:13: note: ...this statement, but the latter is
misleadingly indented as if it is guarded by the ‘while’
{
^
handler.c:694:60: warning: pointer targets in passing argument
1 of ‘strlen’ differ in signedness [-Wpointer-sign]
resp->response.payloadSize = (uint32_T)
strlen(payload)+1;
^~~~~~~
In
file
included
from
handler.c:23:0:
/usr/include/string.h:394:15:
note:
expected
‘const
char
*’
but
argument
is
of
type
‘uint8_T
*
{aka
unsigned
char
*}’
extern
size_t
strlen
(const
char
*__s)
^~~~~~
handler.c:750:57:
warning:
passing
argument
3
of
‘pthread_create’
from
incompatible
pointer
type
[-Wincompatible-pointer-types]
pthread_create(&current->tid,
NULL,
gpioRead,
(void
*)current->pData);
/*
Response:
send
status
*/
^~~~~~~~
In
file
included
from
handler.c:25:0:
/usr/include/pthread.h:233:12:
note:
expected
‘void
*
(*)(void
*)’
but
argument
is of
type
‘void
*
(*)(struct
peripheralData
*)’
extern int pthread_create (pthread_t *__restrict __newthread,
^~~~~~~~~~~~~~
handler.c:757:53: warning: passing argument 3 of
‘pthread_create’ from incompatible pointer type
[-Wincompatible-pointer-types]
pthread_create(&current->tid ,
NULL,udpReadThread , (void *)current->pData);
/* Response: send status */
^~~~~~~~~~~~~
In file
included
from
handler.c:25:0:
/usr/include/pthread.h:233:12:
note:
expected
‘void *
(*)(void
*)’ but
argument
is of type
‘void *
(*)(struct
peripheralData
*)’
extern int pthread_create (pthread_t *__restrict __newthread,
^~~~~~~~~~~~~~
handler.c:774:57: warning: passing argument 3 of
‘pthread_create’ from incompatible pointer type
[-Wincompatible-pointer-types]
pthread_create(&current->tid, NULL,
audioRecordThread , (void *)current->pData
); /* Response: send status */
^~~~~~~~~~~~~~~~~
In
file
included
from
handler.c:25:0:
/usr/include/pthread.h:233:12:
note:
expected
‘void
*
(*)(void
*)’
but
argument
is of
type
‘void
*
(*)(struct
peripheralData
*)’
extern int pthread_create (pthread_t *__restrict __newthread,
^~~~~~~~~~~~~~
handler.c: In function ‘waitForClientConnection’:
handler.c:1629:1: warning: no return statement in function
returning non-void [-Wreturn-type]
}
^
I2C.c: In function ‘I2C_open’:
I2C.c:29:23: warning: unused variable ‘i2c_funcs’
[-Wunused-variable]
unsigned long i2c_funcs = 0;
^~~~~~~~~
I2C.c: In function ‘EXT_I2C_readRegister’:
I2C.c:81:22: warning: assignment discards ‘const’ qualifier
from pointer target type [-Wdiscarded-qualifiers]
msg[0].buf = &reg;
^
I2C.c: In function ‘EXT_I2C_writeRegister’:
I2C.c:120:22: warning: assignment discards ‘const’
qualifier from pointer target type [-Wdiscarded-qualifiers]
msg[0].buf = &reg;
^
I2C.c:124:22: warning: assignment discards ‘const’
qualifier from pointer target type [-Wdiscarded-qualifiers]
msg[1].buf = data;
^
I2C.c: In function ‘EXT_I2C_write’:
I2C.c:154:19: warning: assignment discards ‘const’
qualifier from pointer target type [-Wdiscarded-qualifiers]
msg.buf = data;
^
joystick.c: In function ‘EXT_JOYSTICK_INIT’:
joystick.c:45:25: warning: suggest parentheses around
comparison in operand of ‘&’ [-Wparentheses]
for(ii=0; ii<100 & glob_buffer.gl_pathv[i] !=
'\0'; ii++)
~~^~~~
joystick.c: In function ‘EXT_JOYSTICK_READ’:
joystick.c:82:17: warning: suggest parentheses around
comparison in operand of ‘&’ [-Wparentheses]
for(ii=0;(ii<100 & sh_evdevName[ii] != '\0');ii++)
~~^~~~
frameBuffer.c: In function ‘EXT_FRAMEBUFFER_INIT’:
frameBuffer.c:45:24: warning: suggest parentheses around
comparison in operand of ‘&’ [-Wparentheses]
for(ii=0;ii<100 & glob_buffer.gl_pathv[i] !=
'\0';ii++)
~~^~~~
frameBuffer.c: In function ‘EXT_FRAMEBUFFER_WRITEPIXEL’:
frameBuffer.c:71:9: warning: unused variable ‘ii’
[-Wunused-variable]
int ii ;
^~
frameBuffer.c: In function ‘EXT_FRAMEBUFFER_DISPLAYIMAGE’:
frameBuffer.c:98:17: warning: suggest parentheses around
comparison in operand of ‘&’ [-Wparentheses]
for(ii=0; ii<100 & sh_fbname[ii] != '\0'; ii++)
~~^~~~
frameBuffer.c:96:10: warning: variable ‘fileName’ set but
not used [-Wunused-but-set-variable]
char fileName[100];
^~~~~~~~
frameBuffer.c:95:9: warning: unused variable ‘pxllocation’
[-Wunused-variable]
int pxllocation=0;
^~~~~~~~~~~
alsa_rdwr.c: In function ‘set_hwparams’:
alsa_rdwr.c:155:47: warning: pointer targets in passing
argument 2 of ‘snd_pcm_hw_params_get_buffer_size’ differ in
signedness [-Wpointer-sign]
snd_pcm_hw_params_get_buffer_size(params,
&audioData->bufferSize);
^
In file included from /usr/include/alsa/asoundlib.h:54:0,
from alsa_rdwr.c:24:
/usr/include/alsa/pcm.h:841:5: note: expected
‘snd_pcm_uframes_t * {aka long unsigned int *}’ but
argument is of type ‘snd_pcm_sframes_t * {aka long int *}’
int snd_pcm_hw_params_get_buffer_size(const
snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
TimerBasedRecorder.c: In function ‘allocateDataMemory’:
TimerBasedRecorder.c:183:35: warning: pointer targets in
assignment differ in signedness [-Wpointer-sign]
tmpPdata->FileMemBuff = (char
*)malloc((TIME_STAMP_BYTES + GPIO_VALUE_BYTES +
GPIO_SUB_TOKEN_SIZE));
^
TimerBasedRecorder.c:197:21: warning: pointer targets in
passing argument 1 of ‘sprintf’ differ in signedness
[-Wpointer-sign]
sprintf(tmpPdata->memBuff,"gpio%d|",
pData->perId);
^~~~~~~~
In file included from TimerBasedRecorder.c:1:0:
/usr/include/stdio.h:366:12: note: expected ‘char *
restrict’ but argument is of type ‘unsigned char *’
extern
STDOUT: make: Entering directory '/opt/MATLAB/server_v18.1.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
-I/opt/nanomsg/include -Winline -pipe -D_DEBUG -D_MATLABIO_
-DNANOMSG_TRANSPORT=1 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
-I/opt/nanomsg/include -Winline -pipe -D_DEBUG -D_MATLABIO_
-DNANOMSG_TRANSPORT=1 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
-I/opt/nanomsg/include -Winline -pipe -D_DEBUG -D_MATLABIO_
-DNANOMSG_TRANSPORT=1 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
-I/opt/nanomsg/include -Winline -pipe -D_DEBUG -D_MATLABIO_
-DNANOMSG_TRANSPORT=1 devices.c -o obj/devices.o
[Compiling] LED.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
-I/opt/nanomsg/include -Winline -pipe -D_DEBUG -D_MATLABIO_
-DNANOMSG_TRANSPORT=1 LED.c -o obj/LED.o
[Compiling] GPIO.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
-I/opt/nanomsg/include -Winline -pipe -D_DEBUG -D_MATLABIO_
-DNANOMSG_TRANSPORT=1 GPIO.c -o obj/GPIO.o
[Compiling] I2C.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
-I/opt/nanomsg/include -Winline -pipe -D_DEBUG -D_MATLABIO_
-DNANOMSG_TRANSPORT=1 I2C.c -o obj/I2C.o
[Compiling] SPI.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
-I/opt/nanomsg/include -Winline -pipe -D_DEBUG -D_MATLABIO_
-DNANOMSG_TRANSPORT=1 SPI.c -o obj/SPI.o
[Compiling] serial.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
-I/opt/nanomsg/include -Winline -pipe -D_DEBUG -D_MATLABIO_
-DNANOMSG_TRANSPORT=1 serial.c -o obj/serial.o
[Compiling] system.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
-I/opt/nanomsg/include -Winline -pipe -D_DEBUG -D_MATLABIO_
-DNANOMSG_TRANSPORT=1 system.c -o obj/system.o
[Compiling] picam.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
-I/opt/nanomsg/include -Winline -pipe -D_DEBUG -D_MATLABIO_
-DNANOMSG_TRANSPORT=1 picam.c -o obj/picam.o
[Compiling] ip_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
-I/opt/nanomsg/include -Winline -pipe -D_DEBUG -D_MATLABIO_
-DNANOMSG_TRANSPORT=1 ip_server.c -o obj/ip_server.o
[Compiling] v4l2_cam.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
-I/opt/nanomsg/include -Winline -pipe -D_DEBUG -D_MATLABIO_
-DNANOMSG_TRANSPORT=1 v4l2_cam.c -o obj/v4l2_cam.o
[Compiling] MW_pigs.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
-I/opt/nanomsg/include -Winline -pipe -D_DEBUG -D_MATLABIO_
-DNANOMSG_TRANSPORT=1 MW_pigs.c -o obj/MW_pigs.o
[Compiling]
/opt/userland/host_applications/linux/apps/raspicam/RaspiCamControl.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
-I/opt/nanomsg/include -Winline -pipe -D_DEBUG -D_MATLABIO_
-DNANOMSG_TRANSPORT=1
/opt/userland/host_applications/linux/apps/raspicam/RaspiCamControl.c
-o obj/RaspiCamControl.o
[Compiling]
/opt/userland/host_applications/linux/apps/raspicam/RaspiPreview.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
-I/opt/nanomsg/include -Winline -pipe -D_DEBUG -D_MATLABIO_
-DNANOMSG_TRANSPORT=1
/opt/userland/host_applications/linux/apps/raspicam/RaspiPreview.c
-o obj/RaspiPreview.o
[Compiling]
/opt/userland/host_applications/linux/apps/raspicam/RaspiCLI.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
-I/opt/nanomsg/include -Winline -pipe -D_DEBUG -D_MATLABIO_
-DNANOMSG_TRANSPORT=1
/opt/userland/host_applications/linux/apps/raspicam/RaspiCLI.c
-o obj/RaspiCLI.o
[Compiling] joystick.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
-I/opt/nanomsg/include -Winline -pipe -D_DEBUG -D_MATLABIO_
-DNANOMSG_TRANSPORT=1 joystick.c -o obj/joystick.o
[Compiling] frameBuffer.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
-I/opt/nanomsg/include -Winline -pipe -D_DEBUG -D_MATLABIO_
-DNANOMSG_TRANSPORT=1 frameBuffer.c -o obj/frameBuffer.o
[Compiling] alsa_rdwr.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
-I/opt/nanomsg/include -Winline -pipe -D_DEBUG -D_MATLABIO_
-DNANOMSG_TRANSPORT=1 alsa_rdwr.c -o obj/alsa_rdwr.o
[Compiling] TimerBasedRecorder.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
-I/opt/nanomsg/include -Winline -pipe -D_DEBUG -D_MATLABIO_
-DNANOMSG_TRANSPORT=1 TimerBasedRecorder.c -o
obj/TimerBasedRecorder.o
[Compiling] UdpRecorder.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
-I/opt/nanomsg/include -Winline -pipe -D_DEBUG -D_MATLABIO_
-DNANOMSG_TRANSPORT=1 UdpRecorder.c -o obj/UdpRecorder.o
[Compiling] AudioRecorder.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
-I/opt/nanomsg/include -Winline -pipe -D_DEBUG -D_MATLABIO_
-DNANOMSG_TRANSPORT=1 AudioRecorder.c -o obj/AudioRecorder.o
[Compiling] recorder.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
-I/opt/nanomsg/include -Winline -pipe -D_DEBUG -D_MATLABIO_
-DNANOMSG_TRANSPORT=1 recorder.c -o obj/recorder.o
echo [Linking]
[Linking]
Makefile:63: recipe for target 'build' failed
make: Leaving directory '/opt/MATLAB/server_v18.1.0'

Answers (1)

Karun Mathiazhagan
Karun Mathiazhagan on 26 May 2019
Hello Prabin,
This is likely caused by updates made to the userland library as of December 10th, 2018. A support package update to fix this issue was released in February 2019. I would recommend removing and reinstalling the support package.
I hope this helps.
Best,
Karun

Categories

Find more on MATLAB Support Package for Raspberry Pi Hardware in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!