Help for coding: Read from console and put into a file
Hi! My router is pre-load with basic functions lua. I trying to read from console what I type and put it into a file in my router. The lua only have basic input/output functions like file:read,file:write,io:open, etc.It’s does not have rs232 or uart library.
I wrote the code below:
inp = assert(io.open(“/dev/ttyS1”,”r”)
while true do
data=string:gsub(data, “\r\n”, “\n”)
The above cannot work. Can anybody help and advise?