Hi,
has anybody ever used murgaLua to communicate with a serial device ?
I'd like to write a userfriendly GUI for settings some modem switches.
Code fraqment:
port="/dev/ttyS0";
in=io.open(port,"r");
out=io.open(port,"w");
while(true) do
result=in:read("*line");
if(string.find(result,"RING")) then
out:write("ATA\n");
end
end
This is just a simple stupid stuff, but later useful for robotic applications
Any idea ?
Thanks
Bye
Christian
Hi all,
this code works very well with my Navilock-GPS Bluetooth receiver at OSX 
Now starting to code a simple GPS-Tracker-Application.
Bye
Christian
port="/dev/tty.BT-348_GPS-Serialport-1"
ttyin = assert(io.open(port, "r"))
ttyin:flush()
while (1) do
ttyin:flush()
reply = ttyin:read("*line")
print("Reply:"..reply);
end
ttyin:close()
Output from GPS:
Reply:$GPGSA,A,3,25,29,10,24,27,08,28,,,,,,2.2,1.2,1.8*34
Reply:$GPRMC,101733.000,A,5322.8875,N,00936.3823,E,0.07,191.51,290707,,,A*6A
Reply:$GPVTG,191.51,T,,M,0.07,N,0.1,K,A*06
Reply:$GPGGA,101734.000,5322.8874,N,00936.3823,E,1,07,1.2,48.1,M,46.1,M,,0000*65
Reply:$GPGSA,A,3,25,29,10,24,27,08,28,,,,,,2.2,1.2,1.8*34
Reply:$GPRMC,101734.000,A,5322.8874,N,00936.3823,E,0.19,250.10,290707,,,A*68
Reply:$GPVTG,250.10,T,,M,0.19,N,0.3,K,A*00
Reply:$GPGGA,101735.000,5322.8873,N,00936.3820,E,1,07,1.2,48.1,M,46.1,M,,0000*60
Reply:$GPGSA,A,3,25,29,10,24,27,08,28,,,,,,2.2,1.2,1.8*34
Reply:$GPRMC,101735.000,A,5322.8873,N,00936.3820,E,0.31,263.31,290707,,,A*64
Reply:$GPVTG,263.31,T,,M,0.31,N,0.6,K,A*0C
Reply:$GPGGA,101736.000,5322.8872,N,00936.3817,E,1,07,1.2,48.0,M,46.1,M,,0000*67
Reply:$GPGSA,A,3,25,29,10,24,27,08,28,,,,,,2.2,1.2,1.8*34
Reply:$GPRMC,101736.000,A,5322.8872,N,00936.3817,E,0.19,230.50,290707,,,A*69
Reply:$GPVTG,230.50,T,,M,0.19,N,0.3,K,A*02
Reply:$GPGGA,101737.000,5322.8871,N,00936.3816,E,1,07,1.2,47.9,M,46.1,M,,0000*62
Reply:$GPGSA,A,3,25,29,10,24,27,08,28,,,,,,2.2,1.2,1.8*34
Reply:$GPGSV,3,1,12,08,80,123,35,10,65,240,24,27,56,067,31,29,38,285,28*7C