raspi
Create connection to Raspberry Pi hardware
Add-On Required: This feature requires the MATLAB Support Package for Raspberry Pi Hardware add-on.
Syntax
Description
creates a connection,
mypi
= raspimypi
, from the MATLAB® software to the Raspberry Pi® board. Use this syntax to connect or reconnect to the same board.
You do not need to supply the user IP address, user name, and password to
create a connection. The raspi
object reuses these settings
from the most recent successful connection to a Raspberry Pi board. These settings must be provided for the first connection
created during the setup process.
In MATLAB
Online™, the raspi
object reuses the settings from the
most recent successful connection. If connecting for the first time, this syntax
is used to create a connection to the first Raspberry Pi board listed by raspilist
with status "Ready to connect"
.
After connecting to the board, you can use mypi
to
interact with the Raspberry Pi board and peripheral devices.
To close the connection, use clear
to remove
mypi
and any other connections that use
mypi
.
overrides the IP address, user name, and password from the previous connection.
Use this syntax to connect to a board whose settings are different from the
previous successful connection. After changing the password on a board, use this
syntax. Or, after connecting from the MATLAB software to a second Raspberry Pi board, use this syntax. You can use this syntax without
mypi
= raspi(ipaddress
,username
,password
)username
and address
if a successful
connection has been previously created with this syntax. This syntax is not
supported in MATLAB
Online.
Note
The firmware has a default user name, 'pi'
, and
password, 'raspberry'
. The pi
user
name has sudo root powers at the command line. It is a good security
practice to change the default password to a strong password.
uses the host name instead of the IP address to make a connection to a
Raspberry Pi. Use this syntax to connect a board whose settings are different
from the previous successful connection or to connect to a second board. You can
use this syntax without mypi
= raspi(hostname
,username
,password
)username
and
address
if a successful connection has been previously
created with this syntax. This syntax is not supported in MATLAB
Online.
creates a connection to a Raspberry Pi board in MATLAB
Online using the name assigned to the board during the setup steps
described in Connect to Raspberry Pi Hardware Board in MATLAB Online.mypi
= raspi(name
)
Note
This syntax is supported only in MATLAB Online.
creates a connection to a Raspberry Pi board in MATLAB
Online using its serial number. Identify the serial number using mypi
= raspi(serialnumber
)raspilist
.
Note
This syntax is supported only in MATLAB Online.