Problem communicating with BeagleBone Black using MATLAB

조회 수: 3 (최근 30일)
Marian Brännvall
Marian Brännvall 2019년 11월 11일
댓글: Will Coulter 2021년 5월 17일
We have a beaglebone black which has been installed by following the 'Getting started'-instructions from beaglebone.org. It is connected to the computer (Windows) via USB and the SSH connection has been check using putty. We have installed the following support packages in MATLAB:
  • Embedded Coder Support Package for BeagleBone Black Hardware
  • MATLAB Support Package for BeagleBone Black Hardware
Here follows some of the commands we've written and the corresponding error messages:
>> bb=beaglebone('192.168.7.2','root','')
Error using beaglebone (line 236)
Cannot establish an SSH connection to the board with device address "192.168.7.2", user name "root", password "".
Check if device address, user name and password are correct.
>> bb=beaglebone('192.168.7.2','debian','temppwd')
Error using beaglebone.internal.sshclient/executeCommand
Error executing command: sudo: no tty present and no askpass program specified
Error in beaglebone/addHostToEtcHosts (line 968)
out = obj.Ssh.executeCommand('sudo cat /etc/hosts');
Error in beaglebone (line 241)
addHostToEtcHosts(obj, '192.168.7.1', 'foo');
>> bb=beaglebone_black('192.168.7.2','debian','temppwd');
>> printPinGroups(bb)
Error using beaglebone_black/printPinGroups (line 491)
Error executing command "sudo cat /sys/kernel/debug/pinctrl/44e10800.pinmux/pingroups". Details:
STDERR: sudo: no tty present and no askpass program specified
STDOUT:
>> bb=beaglebone_black('192.168.7.2','root','');
>> printPinGroups(bb)
Error using beaglebone_black/printPinGroups (line 491)
Connection to SSH server at 192.168.7.2 closed. Clear the hardware
communication object and re-create it to establish connection.
Any ideas of what might be causing these errors?
  댓글 수: 2
js fn
js fn 2021년 3월 10일
did you ever figure out this problem? i am having the same issue currently.

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

답변 (2개)

Will Coulter
Will Coulter 2021년 5월 4일
You want to do two things to get around these problems.
MATLAB isn't set up to work with an interactive prompt. The only workaround I've found for this is to give the debian:temppwd (or whatever you use) sudoers rights. You can do this by adding debian to the sudoers list. You an find an example at https://phpraxis.wordpress.com/2016/09/27/enable-sudo-without-password-in-ubuntudebian/
Additionally, you need to list your MATLAB-computer's IP address with a host name of 'foo' ... for example, if your MATLAB-computer is at 192.168.1.36, make sure /etc/hosts on the beaglebone has a line that says "192.168.1.36 foo"

Judith Martinez
Judith Martinez 2021년 5월 16일
using command bbb = beaglebone_black ('192.168.7.2', 'debian', 'temppwd') already works;)
  댓글 수: 1
Will Coulter
Will Coulter 2021년 5월 17일
My comment should help with this problem.
Error executing command: sudo: no tty present and no askpass program specified
If you have problems connecting at all, you could open up an SSH session (not from MATLAB, and see if it works). If it doesn't, you can log into the serial TTY and run 'ifconfig' to see what IP address your board is at.
Good luck!

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

Community Treasure Hunt

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

Start Hunting!

Translated by