MATLAB Answers

How do I use the Raspberry Pi Support Packages over a wireless connection?

47 ビュー (過去 30 日間)
Is there a way of using the Raspberry Pi support packages over a wireless connection?
It is not really convenient for me to keep my computer connected to my Raspberry Pi through an ethernet cable.


MathWorks Support Team
MathWorks Support Team 2014 年 11 月 26 日
The MATLAB and Simulink hardware support packages for Raspberry Pi use an SSH connection to communicate with the hardware. This will work regardless of whether there is a wired or wireless connection.
To communicate with the Raspberry Pi over WiFi you will need:
  1. The Raspberry Pi must be connected to a wireless network that the computer running MATLAB can also access. The simplest way of acheiving this is to have both the device and the computer connected to the same wireless network.
  2. The IP address of the Raspberry Pi, see:
Verify that your network is correctly configured by pinging the IP address of the Raspberry Pi. In a Command Prompt (Windows) or terminal (Linux, Mac) run the command:
ping RPI_IP
where RPI_IP is the IP address of the Raspberry Pi. If it is successful this should return a reply and time information, if not it reports that the request timed out.
Once you can successfully ping the Raspberry Pi, configure MATLAB or Simulink to use the correct IP address to communicate with the hardware:
MATLAB Support Package
When executing the RASPI command, specify the device's IP address, username and password:
Simulink Support Package
When using the "Run on Target Hardware" window to deploy your model, set the "Host name" field to the device's IP address, and the username and password fields to the username and password for your device:
Note that the Simulink package also supports standalone operation. This means that a connection is needed for installing the support package and deploying any models onto the Raspberry Pi, but it is possible to run the created code without any connection to Simulink once a model is deployed.

  3 件のコメント

Abel Sebastian Santamarina Macia
Abel Sebastian Santamarina Macia 2015 年 7 月 16 日
I made a ping from windows command promt and the pi answered. When tried to connect from matlab the following error appeared:
Error using raspi (line 169) Cannot establish a TCP/IP connection to the board with device address "".
Caused by: Error using raspi (line 165) Cannot create a communication link with the remote server. Please check the input arguments(ADDRESS and PORT) and make sure the server is running. Additional Information: No connection could be made because the target machine actively refused it.
I have the ssh server configured properly in the RPi because I can use putty to connect from windows.
Any suggestion??
Jianhui Pang
Jianhui Pang 2015 年 9 月 16 日
That situation happens to me now, driving me crazy.Have you solved this problem?How can I do?
Zuzanna 2015 年 11 月 10 日
I have the same problem. ping - ok, connection via Simulink - ok, via Matlab - error. I setup my Rasbian by, not Matlab. Wandering if it can be the reason..

Sign in to comment.

その他の回答 (1 件)

Reitsam Laurenz
Reitsam Laurenz 2016 年 3 月 6 日
Hi, does anyone already have a solution for this problem? Thanks in advance.

  2 件のコメント

Mohamed Marei
Mohamed Marei 2016 年 4 月 1 日
My experiments with this have always worked. I use a static IP address on the Pi, which I connect to using puTTy. I then initialize a raspi object using the command:
mypi = raspi(ip,usr,pass); % use your own IP address, user and password
My only issue with this is it only connects on one of the two networks I've set it up for. I've only been able to connect to my lab network using puTTy, not my home network.
I've only tried this on the Support Package version of Wheezy. Perhaps that is what you should try next? i.e. using the same Wheezy image.
Richa Gupta
Richa Gupta 2016 年 4 月 25 日
Abel, I would suggest contacting MathWorks Technical Support for this issue.

Sign in to comment.

Translated by