I\'m new to lua and I\'m trying to receive data from the port, ttyACM0, I can write to the port by:
wserial = io.open(\"/dev/ttyACM0\",\"w\")
wserial:write(\
I will not answer what you did wrong, but based one 1 answer here I did this for Windows environment:
-- You can generate PowerShell script at run-time
local script = [[
$port= new-Object System.IO.Ports.SerialPort COM78,115200,None,8,one
$port.open()
$port.WriteLine('serialRequest')
$port.ReadLine() > 'c:\\temp\\serialResponse.txt'
$port.Close()
]]
-- Now create powershell process and feed your script to its stdin
local pipe = io.popen("powershell -command -", "w")
pipe:write(script)
pipe:close()
Not very nice as response must be taken from file, but it works.