How to run Raspberry Pi commands on Matlab without using openShell
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Rogelio Garcia
am 7 Dez. 2019
Beantwortet: Prasanth Sunkara
am 18 Dez. 2019
Hello everyone!
I will appracite if you could help me with this issue.
How could I run Raspberry Pi commands on Matlab and store the returned values on the Matlab workspace without using the openShell function?
To experiment, I tried the Raspberry Pi command "hostname" , but I got the following error:
I added "pi@raspberrypi:~ $" before the "hostname" command since this expression always appears on the SSH terminal on every command line.
Thank you for your help!
>> device = d = rosdevice('169.254.0.2',username,password)
>> system(d,'pi@raspberrypi:~ $ hostname')
Error executing command
Error executing command "env LC_ALL=C bash -c 'pi@raspberrypi:~
$ hostname'". Details:
STDERR: bash: /home/pi: Is a directory
STDOUT:
0 Kommentare
Akzeptierte Antwort
Prasanth Sunkara
am 18 Dez. 2019
Hi Rogelio,
Just pass the actual linux command as an argument to system.
eg: >> system(d,'hostname')
-Prasanth
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu MATLAB Support Package for Raspberry Pi Hardware finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!