Problem communicating with BeagleBone Black using MATLAB

4 次查看(过去 30 天)
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 个)

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