Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

Serial Ports

dab
2010-03-10
2013-05-09
  • dab
    dab
    2010-03-10

    Linux debian 2.6.22.18-co-0.7.6
    xp sp3 FTDI usb-serial deliver

    I  have a structure like

    ubuntu usbl console  ->  XP -> FTDI  usb to serial driver -> colinux

    I can talk to the ubuntu console cia putty on XP without any problems.
    Using

    ttys0=COM2,"BAUD=115200 PARITY=n DATA=8 STOP=1 dtr=on rts=on"

    and I have tried a few variants I cannot seem to get any response from ttyS0 on the colinux debian side using
    cu.
    I am sure I have all the serial parameters lined up the same. I also see noreference to tty0 in any of
    the logs. I fugure it should work (given that COM2 works on putty)
    Is this my stupidity or is it a bug?

     
  • Henry N.
    Henry N.
    2010-03-10

    The parameter line is ok.
    You should see "colinux-serial-daemon: running" from the colinux-daemon.exe.
    Check Windows manager, that colinux-serial-daemon.exe is running.
    Check, that ttys0 is not parsed as Linux kernel command line ("cat /proc/cmdline").

    Before starts coLinux, run the debug-daemon on second XP-prompt:
    colinux-debug-daemon.exe -d -p -s prints=31,misc=31 -f debug.xml
    Then try something with /dev/ttyS0 and stop debug daemon with CTRL-C.
    You should see many more messages from colinux-serial-daemon.

     
  • dab
    dab
    2010-03-10

    Below are the results. The debug message of  "COM2: The system cannot find the file specified. " tells me that something is trying a CreateFile() on COM2. I read the MS SDK docs and it suggests this does not work. SO I changed to COM17 mapped tottys0. This curiously got rid of all the colinux-serial-daemon error messages but let me with the same result of
    cu: /dev/ttyS0: System not found from cu

    debian:/home# cat /proc/cmdline
    root=/dev/cobd0 ro
    

    On windows: devcon status *
    FTDIBUS\VID_9E88+PID_9E8F+FTSYIR3OB\0000
        Name: USB Serial Port (COM2)
        Driver is running.

    I then start it all:
    and
    execute :

    #cu -s 115200  /dev/ttyS0
    

    and get the response
    cu: /dev/ttyS0: System not found
    (which is new)

    debug.xml contains

    - <log module="colinux-serial-daemon" file="src/colinux/os/winnt/user/coserial-daemon/main.c" timestamp="00000156.1359933094" local_index="1" facility="0" function="coserial_main" line="205" level="10" driver_index="112">
      <string>connecting to monitor</string>
      </log>
    - <log module="colinux-daemon" file="src/colinux/os/winnt/user/misc.c" timestamp="00000156.1359960323" local_index="32" facility="3" function="co_terminal_printv" line="37" level="11" driver_index="113">
      <string>prints "Entering add_active_range(0, 0, 16384) 0 entries of 256 used"</string>
      </log>
    - <log module="colinux-serial-daemon" file="src/colinux/os/winnt/user/coserial-daemon/main.c" timestamp="00000156.1359949835" local_index="2" facility="0" function="coserial_main" line="236" level="10" driver_index="114">
      <string>open device '\\.\COM2'</string>
      </log>
    - <log module="colinux-daemon" file="src/colinux/os/winnt/user/misc.c" timestamp="00000156.1359979553" local_index="33" facility="3" function="co_terminal_printv" line="37" level="11" driver_index="115">
      <string>prints "Zone PFN ranges:"</string>
      </log>
    - <log module="colinux-daemon" file="src/colinux/os/winnt/user/misc.c" timestamp="00000156.1359981818" local_index="34" facility="3" function="co_terminal_printv" line="37" level="11" driver_index="116">
      <string>prints " Normal 0 -> 16384"</string>
      </log>
    - <log module="colinux-serial-daemon" file="src/colinux/os/winnt/user/misc.c" timestamp="00000156.1359984551" local_index="3" facility="3" function="co_terminal_printv" line="37" level="11" driver_index="117">
      <string>prints "COM2: The system cannot find the file specified. "</string>
      </log>
    - <log module="colinux-serial-daemon" file="src/colinux/os/winnt/user/misc.c" timestamp="00000156.1359985713" local_index="4" facility="3" function="co_terminal_printv" line="37" level="11" driver_index="118">
      <string>prints "colinux-serial-daemon: exitcode 89e3d001"</string>
      </log>

     
  • Henry N.
    Henry N.
    2010-03-13

    The COM2 is not accessible on Windows side on your computer?
    Please open a Command prompt and type there:

    "mode com2"
    

    You should see such output (me is from German):

    C:\&gt;mode com2

    Status von Gerät COM2:

        Baudrate:        9600
        Parität:         None
        Datenbits:       8
        Stoppbits:       1
        Zeitlimit:       OFF
        XON/XOFF:        OFF
        CTS-Handshaking: OFF
        DSR-Handshaking: OFF
        DSR-Prüfung:     OFF
        DTR-Signal:      ON
        RTS-Signal:      ON

    If you got "Unaccessible device name - COM2" there, then your mapping is not working, or the USB hardware is not ready. Please check the settings in Windows Device manager.

    Internal we open "\\.\COM2", that is the syntax MSDN suggest for "Win32 Device Namespaces".

    Remember, that you need to unplug and plug in the USB hardware after changing the port mapping. But, this don't helps in all cases. So it is better after changing the COM-port mapping: Shutdown Windows, unplug USB hardware, power up Windows again and than - as last step - plug in the USB hardware.

    Gernerally it works with your line. I have tested my Mobile fon with

    ttys0=COM2,"BAUD=9600 PARITY=n DATA=8 STOP=1 dtr=on rts=on"
    

    Inside coLinux started minicom, I have setup device as /dev/ttys0, the baudrate does no matter, because it's fix set from Windows side.

     
  • Henry N.
    Henry N.
    2010-03-13

    PS: I have tested it with coLinux 0.7.6 today, and should work with all coLinux versions down to 0.7.1

     
  • Henry N.
    Henry N.
    2010-03-13

    Have checked source between Putty (0.60) and coLinux (0.7.6), and found a very small difference on opening device. I have only XP-SP1 and SP2, maybe SP3 can not open the device with our flag FILE_ATTRIBUTE_NORMAL? I not assume, that this is the problem.

    Here is a special build of colinux-serial-daemon. There we open COM with exactly the same parameters as PuTTY does it. Please backup your current file and replace it with this one.

     
  • Henry N.
    Henry N.
    2010-03-13

    minicom works:

    Welcome to minicom 2.2

    OPTIONS: I18n
    Compiled on Jan  7 2007, 18:00:43.
    Port /dev/ttyS0

                   Press CTRL-A Z for help on special keys

    AT S7=45 S0=0 L1 V1 X4 &c1 E1 Q0
    OK
    at
    OK
    ati
    Nokia Mobile Phones

    OK

    cu does not work. I don't know why.

    debian:~# cu -s 115200 /dev/ttyS0
    cu: /dev/ttyS0: System not found

    debian:~# cu -version
    cu (Taylor UUCP) 1.07