OpenWrt Forum Archive

Topic: problems with usb serial port

The content of this topic has been archived on 21 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

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)

There's a problem with serial and some other usb devices on the WR703N--check out this thread:

https://forum.openwrt.org/viewtopic.php … 56&p=4

The fix is to use a usb hub which is reported in dmesg as being "high speed"--after plugging in the hub, try "dmesg | grep usb".

The discussion might have continued from here.