RTTY Command. ------------- The following is an extract from the RTTY source code, explaining the command usage. RTTY is provided on a limited-support basis for our customers, when used with the NC/Con and other DigiBoard network products. /******************************************************************** * NAME * rtty - Connect a tty to a remote TCP port. * * SYNOPSIS * rtty [-dhw] tty host port * * DESCRIPTION * rtty attaches the master side of a named pseudo tty * to a TCP session. * * This is most often useful to allow a TCP terminal server * port to appear as a local tty on some host computer. * * -[0-9] Wait for data to be written to the slave side of * the pseudo tty before opening the connection; * open the connection and sleep the given number * seconds [0-9] before writing the data to the port. * * -d Daemonize. A detached child process is spawned * to perform the program function, ignoring all * signals. * * -h Hold the tty open so "stty" settings are not * disrupted and EOF's are not sent when the tty * is locally closed. * * -q Quit after one session is complete. Normally the * program loops to handle multiple sessions. * * -s Suppress the copyright notice. * * -w Wait for data to be written to the tty port before * executing the rsh command. * * -x Output debugging information. Specifying "x" * twice produces even more output. * * tty The name of a local pseudo tty (eg ttyq0) to be * used for the connection. * * host A hostname or IP address. * * port Decimal TCP port number. * * EXAMPLES * * To associate "ttypf" with the dedicated printer device * connected to (DigiBoard NC/Con-16) node ncx, port 4. * * rtty -dh ttypf ncx 2104 * * To associate "ttysf" with a dial-in/dial-out (type mio) * modem attached to (DigiBoard NC/Con-16) node nccon port 13. * * rtty -1d ttysf nccon 2113 */ NC/CON Port numbers. -------------------- The NC/Con provides two ranges of TCP/IP service numbers that you can connect to from other systems: 2001 - 2099 Telnet Connect 2101 - 2199 Raw Connect A connect made to any 20XX port uses the Telnet protocol, providing full Telnet compatibility. You would use the 20XX ports in commands like: pr myfile | telnet nccon-nodename 2001 A connect to any 21XX service is a raw connection, passing 8-bit clean data at all times. This is useful with the RTTY command described elsewhere, and for custom applications. The last two digits in each number say what to connect to. If the last two digits are 01 - 16, the port makes a connection to ports 1-16. Otherwise the last two digits indicate a port group number, as configured with "set port group=XX". When several NC/Con ports are configured with the same group number, they work like a telephone "hunt group". That is, any attempted connection goes to the lowest numerical port number that can currently accept a connection. Note: Chosing the wrong range of service numbers, (eg 20xx instead of 21xx) is a common source of user problems. NC/CON "set port" device types. ------------------------------- dev=term Incoming port that ignores DCD. All outgoing connect attempts are refused. Designed for terminal device. Only TD, RD, and GND connections are needed, making it easy to wire up to a terminal. dev=min Incoming port supporting DTR and DCD supporting a modem model. Ignores all input until DCD appears. Then flushes input for 2 seconds to discard messages like RING and CONNECT, then spawns a login or attempts a connection. Anytime DCD drops, the NC/Con drops DTR, all connections terminate, and any user is logged out. When a user logs out, or (on an auto-connect port) when the remote system drops the connection, DTR is dropped to hang up the modem. dev=prn Outgoing device that ignores DCD. Any incoming characters are ignored until an outgoing connection is made. Although the device is called prn for printer, it establishes a general purpose output connection that can be used for any other purpose. dev=mout Outgoing device with full DTR/DCD modem support. Until an outgoing connection is made, DTR remains low, keeping a modem from answering the telephone. When an outgoing connection succeeds, DTR is raised. The state of DCD is ignored, except that a high-to-low transition of DCD closes the connection, and drops DTR. dev=mio Bi-directional device for use with both bidirectional modems. When idle, leaves DTR high so the modem will answer the telephone. If DTR goes high when the device is idle, it assumes an incoming connection, and acts like a "min" device until it goes idle again. If an outgoing connection succeeds when the device is idle, it switches into outgoing mode and acts like a "mout" device until the connection is dropped. NOTES: With "term" and "prn" devices, only TD, RD and GND need be present in the RS232 cable. Using modems with "min", "mout" and "mio" devices, TD, RD, DCD, DTR and GND should always be wired in the cable. With modern multi-speed, data compressing modems, you probably also want to wire RTS and CTS for hardware flow control. Anytime a modem device drops DTR, DTR remains low for 2 seconds to assure a clean modem disconnect, and then input is flushed to discard DISCONNECT messages, and the like. How to configure flow control. ------------------------------ Altpin, and why its important with 8/10 pin RJ-45 connectors. How the front panel IFC and OFC lites indicate flow control. Hardware flow control. Software flow control. Auxiliary software flow control. How the lnext character (ctrl v by default) can be used to escape software flow control characters. How to configure printers. -------------------------- set port dev=prn Telnet example: pr myfile | telnet ncx 2001 RSH example: pr myfile | rsh ncx 1 Explain how to use ONLCR to convert NL to CR/NL. Explain how to use TAB3 to expand TABS to spaces. Mention that you must configure software or hardware flow control in most cases, or the printer will fall behind and data will be lost. Most printers that use hardware flow control use DTR flow control. Hence DTR from the printer must be wired to some input on the NC/Con (usually CTS or DCD) that can be used for flow control. Note that some printers use Printer Busy (pin 11) for output flow control. How to configure modems. ------------------------ Usually its desireable to configure modems to be bidirectional, (dev=mio) although if desired they may also be configured to be input only (dev=min) or output only (dev=mout). Be sure to wire TD, RD, DCD, DTR and GND in the modem cable. Make sure the modem is configured so DCD goes high when an incoming connection is received. (AT &C1) Make sure the modem is configured to answer the phone only when DTR is high, and to drop the line when DTR goes low. (AT S0=1 &D3) For the best results in bidirectional mode, the non-volatile parameters in the modem should be configured for incoming calls, and the modem should be configured to reset to these parameters each time DTR is dropped. (AT &D3) The NC/Con cannot switch the serial line baud rate depending on the kind of connection made, so you should configure the modem to lock the serial line speed at the highest baud rate the modem will go. Systems with more than 8 modems at 57600 can potentially overload the input capacity of the NC/Con. If you suspect you are having this problem, drop the line speed to 38400 and it should go away. Generally it is best to always use hardware flow control on modem lines, and leave software flow control off. Both the UUCP and XMODEM protocols send all 256 characters, so these protocols will not work with software flow control. Note that many modems have external or internal jumpers that override the normal operation of DTR, DCD, RTS and CTS. Be sure to check this in your modem manual. Be sure to watch the lites on the NC/Con front panel to monitor correct modem operation. In particular verify that DCD is off when the modem is not connected. Verify that the modem does not answer the phone when DTR is low, and hangs up when DTR is dropped. How to configure CU and UUCP to dial out on the NC/CON. ------------------------------------------------------- RTTY works by associating a particular pseudo tty port with a particular port or port "group" on the NC/Con. The pseudo tty then acts enough like a regular port so that it fools most programs including kermit, uucp and cu. Not all pseudo ttys can be used for this. Pseudo ttys associated with "clone" devices normally must be opened by the clone device. However even systems with clone devices often maintain old-style BSD devices. In general, you should read your UNIX man pages to find out what your system supports. If your system supports BSD-style pseudo ttys, you can find the devices available with: ls /dev/pty* Choose one or more of the alphabetically highest pseudo ttys, (the system allocates them in alphabetically) so you will have them to yourself at least most of the time. The pseudo tty driver won't allow access to the "master" side of a pseudo tty by more than one program at a time, so once rtty grabs a pseudo tty its his until he lets go of it. Problem is, to drop a connection, rtty must close the device and then reopen it. Its a small window, but it is possible for another program to get in there and grab the device before rtty can resecure it. If that happens, CU and UUCP will get confused. Selecting a high port number is generally good enough to minimize problems. Assuming you found /dev/pty[pqrs][0-f] above (64 ptys), and you needed to configure 4 modem ports, you would probably be wisest to use /dev/ptys[cdef] for your pseudo-modem ports. Assuming you wanted to use NC/Con ports 1-4, you would add the lines below to your "rc" startup script. The parameter "1" says to wait one second after connect before sending data. (needed so the modem will see DTR go high for awhile before looking for "AT"). The "d" says to daemonize the program, and the "s" says to suppress the Copyright Notice during boot. rtty -1ds /dev/ttysc nccon-nodename 2101 rtty -1ds /dev/ttysd nccon-nodename 2102 rtty -1ds /dev/ttyse nccon-nodename 2103 rtty -1ds /dev/ttysf nccon-nodename 2104 Add a few lines like the following to your uucp "Devices" file. All baud rates are equivalent, since the pseudo tty device driver ignores them, but they must match up with the value given in your "Systems" file. On some systems the "hayes" keyword is omitted; on other systems you will want to replace it with the name of the dialer script your modem uses. ACU ttysc ttysc 38400 hayes ACU ttysd ttysd 38400 hayes ACU ttyse ttyse 38400 hayes ACU ttysf ttysf 38400 hayes Having done just these two things, the modems will now appear directly connected to cu and uucp, so you should be able to test your configuration by typing something like: cu -l /dev/ttysc -b 38400 555-1212 Depending on your system, you may need to make a few more tweaks, but the rest of it is the same as you would encounter on any other directly connected port. It is possible for several (or many) different computer systems on a network to configure pseudo-ttys associated with the same port (or port group) on an NC/Con. This works because RTTY only attempts a connection when data is written to the pseudo tty. If the NC/Con port is available, the connection is made and the program accessing the port can continue. If the port is already in use by another system the connection will fail, and RTTY will signal the application by momentarily closing and re-opening the pseudo-tty port. This is compatible with the way UUCP and CU work on most systems. The RTTY program is provided on an as-is basis by DigiBoard as a service to its customers, but because it is tricky to configure, and usually needed only by sophisticated customers. It is not covered by our regular unlimited technical support policy. RTTY works great on most systems, but depends too much on non-standard features of the local UNIX system to be fully supported. We provide the source, internal documentation in the source, and an unlimited distribution license when used with our products. Most customers find it valuable, but there is no guarantee of success.