jinyistudio Well-Known Member Licensed User Longtime User Jun 30, 2016 #1 Hi I use shl_StdOut to receive data from "sudo nodejs server.js". server.js is a mini webserver. when i running "exceute", it run in background. it has some showing message but shl_StdOut can't receive them. Why ? Where am i missing ? Code: Sub Execute As Boolean If Not(ProcessIsRunning("nodejs server.js")) Then Dim sh As Shell sh.Initialize("shl", "sudo", Array As String("nodejs","server.js")) sh.WorkingDirectory="/home/pi/OpenPLC_v2" sh.Run(-1) End If End Sub Code: Sub shl_StdOut (Buffer() As Byte, Length As Int) Dim s1 As String=BytesToString(Buffer,0,Length,"UTF-8") Log("stdout:"&s1) End Sub
Hi I use shl_StdOut to receive data from "sudo nodejs server.js". server.js is a mini webserver. when i running "exceute", it run in background. it has some showing message but shl_StdOut can't receive them. Why ? Where am i missing ? Code: Sub Execute As Boolean If Not(ProcessIsRunning("nodejs server.js")) Then Dim sh As Shell sh.Initialize("shl", "sudo", Array As String("nodejs","server.js")) sh.WorkingDirectory="/home/pi/OpenPLC_v2" sh.Run(-1) End If End Sub Code: Sub shl_StdOut (Buffer() As Byte, Length As Int) Dim s1 As String=BytesToString(Buffer,0,Length,"UTF-8") Log("stdout:"&s1) End Sub
Erel B4X founder Staff member Licensed User Longtime User Jun 30, 2016 #2 It probably redirects the standard output internally. Upvote 0