Howdy folks -
 
I have a little app which opens /dev/ttyS2 and reads NMEA data through the serial port. This application works fine while the usb cable is plugged in. But as soon as the usb cable is removed, it stops receiving serial data through ttyS2. If the unit is booted with no usb cable connected, it also doesn't read any serial data. However, if the usb cable is plugged in again, it starts receiving data.
 
Am using the following in a startup script (/etc/init.d/S99Serial) to configure the serial port:
 
        modprobe proc_gpio
        echo AF1 in > /proc/gpio/GPIO49
        echo AF1 out > /proc/gpio/GPIO48
        stty -F /dev/ttyS2 ixoff clocal ixany -ixon -echo -echonl ospeed 4800 ispeed 4800
 
My program uses open("/dev/ttyS2",O_RDONLY) to open the port, and read() to read 1 byte at a time. Nothing special.
 
I don't get it. I don't even have to log on using USBNET and ssh - as long as the cable is plugged in to the usb port, it seems to work. Not connected, no work.
 
I'm using a gumstix basix using the minidin connector.
 
Any advice really appreciated.
 
Thanks,
 
Mark.