Hi,
i've got strange behaviour using io.read() on my /dev/ttyUSBx.
What i'm doing (trying to read data from an arduino nana v3 on wrt703's usb port)
on console
@openWrt: stty -F /dev/ttyUSB0 raw 9600
then in lua runtime interpreter
arduino = io.open("/dev/ttyUSB0","r")
while true do
local line = arduino:read()
arduino:flush()
if line then
print(line)
end
end
My arduino will send about 10 "greating" lines when he establishes an serial connection.
I can see them clearly using my windows pc and arduinos serial monitor.
doing the above on my asus eeepc with debian gives an correct result, too.
BUT doing this on my wrt703 (openwrt) gives me the first 6 to 8 lines and then the serial communication looks dead. (no RX/TX on arduino anymore, even exiting the lua interpreter crtl-Z.)
I've tried the same with NIXIO (but without luck)
If tried the long stty -F string from arduino playground to get the same output as the serial monitor should give, but it does not work for me.
What am i doing wrong?
yours
Peter
P.S.: another funny thing: when unplugging the arduino from the wrt703 the USB0 dissapears, but reconnecting it brings me USB(n+1). why's that?
(Last edited by infantilo on 22 Dec 2012, 20:36)