Error connecting Raspberry Pi to Matlab
Ältere Kommentare anzeigen
Hello,
Few weeks ago i was able to use Matlab Simulink with Raspberry Pi 3, to use with an other hardware.
i have some trouble with using the HW Resource Manager, where ping hardware test status failed, even if i'm trying with this command " >>rpi = raspi", i have an error saying :
>> rpi = raspi
The Raspberry Pi IP address or user name or password for 169.254.77.234 is incorrect.
with HW Resource Manager i have this message :
>> rpi = raspi
The Raspberry Pi IP address or user name or password for 169.254.77.234 is incorrect.
Error using raspiHWManager/ConnectButtonPushed
The Device withh the given IP address is not reachable
Error in appdesigner.internal.service.AppManagementService/executeCallback (line 138)
callback(appOrUserComponent, event);
Error in matlab.apps.AppBase>@(source,event)executeCallback(appdesigner.internal.service.AppManagementService.instance(),app,callback,requiresEventData,event) (line 63)
newCallback = @(source, event)executeCallback(appdesigner.internal.service.AppManagementService.instance(), ...
Error using matlab.ui.control.internal.controller.ComponentController/executeUserCallback
Error while evaluating Button PrivateButtonPushedFcn.
I have connected my Raspberry Pi 3+ to a screen and plugged with a RJ45 ethernet cable to the PC, and it's showing the correct IP address.
I'm using Matlab version R2022a for the Raspberry Pi 3+.
i tried to do some manipulations but i can't get it to work properly...
Thanks in advance for your help.
7 Kommentare
Prasanth Sunkara
am 23 Sep. 2022
There are a couple of things you can check or confirm.
1) Check if 169.254.77.234 is indeed the Pi's IP address by executing "ifconfig" command on Pi and look for ipv4 address
2) Have you changed the username of your Pi recently after the last use of Pi with MATLAB?
3) From my perspective, the error message simply means your PC on which MATLAB is running cannot recognize the IP address that you have entered. You can confirm this by pinging the Pi's IP address from your host PC. You can use your host's OS CMD prompt utility and try that ping. If even the ping fails, this clearly means your PC cannot reach the Pi, so does MALTAB.
Also, create a raspi obj with complete arguments. Eg; r=raspi('169.254.77.234,'pi','raspberry') if the PC is able to ping Pi.
Looking at the IP address, I have a reason to believe the Pi is connected directly to your host computer's LAN slot. Are there any other ways you can connect Pi to a network? Like Wifi or connect a LAN wire between your Pi and router's port etc?
-Prasanth
Walter Roberson
am 23 Sep. 2022
The 169.254 address is a give-away that the connection between the host and the Pi is through a network path that does not have a router and which does not have an active DHCP or bootp service. The most common such network path would be if the Pi is directly plugged in to an ethernet port on the host, but there are other arrangements possible such as going through a hub or switch.
At the moment I am not certain whether it would try to use IP addresses at all if the Pi were connected to the host by way of a USB cable... maybe?? Connection through USB is typically by using Serial Over USB and talking to the console port instead of through IP, but I have not fired my my Pi in several years now and the details are unclear now.
Supun MORAKANDA GAMAGE
am 23 Sep. 2022
Prasanth Sunkara
am 23 Sep. 2022
Since the ping failed for a direct LAN-LAN connection, MATLAB failed to connect as well.
You can deploy a Simulink model to Raspberry Pi and after that the model runs stand alone on Pi without needing any interaction from Simulink, unless you are running External Mode, also known as Monitor & Tune workflow
If your PC is also connected to the same WiFi network as Pi, they both can communicate normally. You dont need a "pyhsical" connection between Pi and PC.
By the way, the "HW Resource Manager" app(the left hand side one in the image you shared) is retired and no more supported. The Alternative was the right hand side one called "Raspberry Pi Resource Monitor" and this is part of the core support package installation unlike the earlier one which is just a file exchange submission.
Thanks,
Prasanth
Supun MORAKANDA GAMAGE
am 23 Sep. 2022
soudeni
am 10 Feb. 2023
my Matlab version is cracked i have trouble in add ons to use raspberry package it doesn't show the packages
Walter Roberson
am 10 Feb. 2023
So purchase a real license.
Antworten (1)
soudeni
am 9 Feb. 2023
0 Stimmen
Hello i want to use Matlab Simulink with Raspberry Pi 4B, to use
i have some trouble with using the Get Add-ons and HW Resource Manager it open on the screen to "renew your software maintenance servise" when i click on it it start to downloadwhen it finish i cannot open matlab
2 Kommentare
Walter Roberson
am 9 Feb. 2023
You can download the packages from the File Exchange, such as
soudeni
am 10 Feb. 2023
my Matlab version is cracked i have trouble in add ons to use raspberry package it doesn't show the packages
Kategorien
Mehr zu Installation Setup and Configuration finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
