raspberry pi linux command hang

조회 수: 1 (최근 30일)
Hae Min Jung
Hae Min Jung 2020년 3월 30일
댓글: Sreeraj S J 2021년 7월 29일
Hi, I am interfacing Matlab with an r pi to send over a command to run a python script.
The code is supposed to run for a certain amount of time, but I was looking for a way to have this not hang for return/terminate from linux.
Is there a way to achieve this?
  댓글 수: 1
Prasanth Sunkara
Prasanth Sunkara 2020년 5월 8일
Try system(raspiObj , 'python yourScriptname.py &');

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

답변 (1개)

Puru Kathuria
Puru Kathuria 2021년 2월 25일
편집: Puru Kathuria 2021년 2월 25일
Hi,
I hope the raspberry pi support package has been installed and a connection has been initiated from MATLAB to Raspberry Pi.
Next, You might want to try one of these ways:
%system(raspberryPiObject, commandToBeExecuted);
%for executing python script
system(raspberryPiObject, 'python SRC_DIR/scriptName.py');
%for running python script in background
system(raspberryPiObject, 'python SRC_DIR/scriptName.py &');
  댓글 수: 1
Sreeraj S J
Sreeraj S J 2021년 7월 29일
Hi,
This is not working while we deploy the code in Raspberry Pi Hardware.
The same code will work only when Raspberry Pi is connected to Matlab directly.
Is there any solution to this?

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

카테고리

Help CenterFile Exchange에서 MATLAB Support Package for Raspberry Pi Hardware에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by