필터 지우기
필터 지우기

why i have this error when i try to start my connection with raspberry pi?

조회 수: 11 (최근 30일)
Hello guys, i have installed the Raspberry pi package support for matlab but when i give the command:
mypi = raspi
i obtain this error:
Error using raspi (line 160)
Cannot establish an SSH connection to the board with device address "192.168.1.2".
Caused by:
Error using raspi (line 156)
Error executing command: FATAL ERROR: Network error: Connection refused
During the installation of the package i have set a static ip for the raspberry in this way:
IPv4 Address. . . . . . . . . . . : 192.168.1.2
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : 192.168.1.1
And, if is important for the resolution of my problem, i have connected the raspberry pi to my pc with a ethernet cable, and the pc is connects to internet with a usb key wireless. The router is not phisically connected to the pc.

채택된 답변

Murat Belge
Murat Belge 2014년 12월 10일
There is no SSH server running on 192.168.1.2 and the target machine is refusing SSH connection request from MATLAB.
1. Login to your Raspberry Pi using a monitor and keyboard and check that the board has the correct IP address. After logging in to Raspberrry Pi, execute the following in a Linux shell window
$ ifconfig eth0
Verify that the "inet addr" displayed as a result of the command above is "192.168.1.2". If not, you need to modify your /etc/network/interfaces file to assign a static IP address.
2. SSH server is running:
$ps -ef | grep sshd
This should return an sshd server running on your Raspberry Pi if you do not see anything reboot your Raspberry Pi
3. Ping your Raspberry Pi from within MATLAB:
>> ! ping 192.168.1.2
This should be successful.
Report what you are getting.
  댓글 수: 1
charushila raskar
charushila raskar 2017년 12월 29일
편집: Walter Roberson 2017년 12월 29일
Pinging 192.168.1.100 with 32 bytes of data:
Reply from 192.168.1.100: bytes=32 time=1ms TTL=64
Reply from 192.168.1.100: bytes=32 time=2ms TTL=64
Reply from 192.168.1.100: bytes=32 time=2ms TTL=64
Reply from 192.168.1.100: bytes=32 time=1ms TTL=64

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

추가 답변 (2개)

Grissa Mohamed Amine
Grissa Mohamed Amine 2017년 11월 20일
hey, i have installed the Raspberry pi package support for matlab 2017b and i have now this error :[
Error in raspi (line 200) obj.Ssh = matlabshared.internal.ssh2client(obj.IpNode.Hostname, ...

Kazem Gheysari
Kazem Gheysari 2023년 8월 5일
Hi Guys
I solved this issue by the following tasks:
Resolve the issue of the ssh public key:
  1. Edit the /etc/ssh/sshd_config file.
  2. Change PasswordAuthentication and ChallengeResponseAuthentication to yes.
  3. restart

카테고리

Help CenterFile Exchange에서 Installation Setup and Configuration에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by