From:
<Fra...@im...> - 2003-07-30 12:10:50
|
Hello, I am playing with a serial device (a SONY=20 EVI-D100) that I want to control from a tcl=20 shell. On the new macs, there is no more serial=20 ports. So I am using a "Keyspan Twin serial" USB=20 to serial adaptor. This creates 4 device files on=20 my computer: crw-rw-rw- 1 root wheel 8, 2 Jul 30 13:54 /dev/tty.USA28213P1.1 crw-rw-rw- 1 root wheel 8, 4 Jul 30 13:54 /dev/tty.USA28213P2.2 crw-rw-rw- 1 root wheel 8, 3 Jul 30 13:54 /dev/cu.USA28213P1.1 crw-rw-rw- 1 root wheel 8, 5 Jul 29 16:03 /dev/cu.USA28213P2.2 the "213" is the "geographical name" of the=20 device (?), I think this means that it is on USB=20 channel 2, USB hub 1, USB port 3. The important=20 thing is: it will change over time, so, for=20 example, you can't count on your serial device to=20 be on /dev/tty1 all the time. The first problem I encountered was that OS X=20 tcl doesn't do serial: after opening one of those=20 devices, you can't set the "-mode" option with=20 "fconfigure" to setup baud rate, parity, etc... I traced this problem to "configure": the=20 configure trace displays "checking termios vs.=20 termio vs. sgtty: none". This is surprising=20 because I can find "termios.h" and a "sgtty.h" in=20 the system includes... I don't know how the tcl.m4 files work, so I=20 simply overrode, by hand, the makefile and added=20 the "-DUSE_TERMIOS" definition. Now the "-mode" option is available and I can=20 talk to my device... So... I guess something has=20 to be fixed in "configure" so that=20 "-DUSE_TERMIOS" is set... Another problem that I encountered was that tcl=20 would hang on "open /dev/tty.USA28213P1.1". I=20 found a workaround doing "open=20 /dev/cu.USA28213P1.1 {RDWR NONBLOCK}". I am not=20 sure if this reflects a bug or if it is normal... Just to let people know... Fran=E7ois -- ______________________________ =46rancois Berard http://iihm.imag.fr/fberard/ IIHM, CLIPS-IMAG http://iihm.imag.fr/ Tel: (+33)476 514 365 =46ax: (+33)476 446 675 |