ssh (c# と SharpSSH を使用) 経由で python スクリプトを実行する際に問題があります。
接続があり、「startx」や「sudo shutdown ...」などの簡単なコマンドを書くことができます
Python スクリプトを実行しようとすると、プログラムがフリーズし、何も起こりません。「パテ」でまったく同じ手順を試してみましたが、期待どおりに機能します。
Python スクリプトが実行され、アプリケーションにインポートされたデータ (print 'No Laser, fast motion: Dx=', stepx, ' Dy=', stepy) が取得されます。
C# SharpSSH 接続
ssh = new SshStream(host, user, password);
//Set the end of response matcher character
ssh.Prompt = "#";
//Remove terminal emulation characters
ssh.RemoveTerminalEmulationCharacters = true;
//Reading from the SSH channel
string response = ssh.ReadResponse();
return response;
C#の開始Gcode_executer.pyが機能せず、プログラムがフリーズします(PC上)raspberry piはpythonファイルを実行しません
try
{
ssh.Write("sudo python cnc/Gcode_executer.py"); // Write ssh to RPI
// works it in putty
if (ssh.CanRead == true)
{
return ssh.ReadResponse(); // return string from terminal from RPI
}
else
{
return "No response";
}
}
catch
{
return "Catch NO response";
}
問題を解決するために何ができますか?