HOW TO CONFIGURE MODEMS FOR USE WITH PHOTON/PHINDOWS


If you have a modem connected to a serial port, it can be configured to automatically answer calls. Users can login and run text-based applications or Photon graphical applications by running remotely. Most of the configuration involves making the modem answer automatically and start login. These instructions will help you do this.

YOU NEED:
QNX version 4.23A or later
Photon 1.10 or later
Modem and documentation for it.

FOR THE REMOTE COMPUTER:
Similar to above, or a computer running Windows 95 or NT and Phindows 1.10 or later.
The software should be already installed. QNX and Photon should be working on the local machine.

QNX SERVER CONFIGURATION

SERIAL DRIVER

A driver is used to interface the operating system to the serial hardware. The standard COM1 and COM2 ports which are included with most desktop systems are handled by Dev.ser. Third-party serial cards are supplied with their own drivers which are used instead. Generally this driver is started in /etc/config/sysinit.N. Generally the only parameter that is typically used is -b to set the default baud rate. So in your sysinit.N file will be something like:
Dev.ser -b 57600 &

TINIT

Tinit is a utility that watches character devices and when a new connection is made, it starts a process on the port, which by default is login. In your /etc/config/sysinit.N is likely a line such as:
tinit -T /dev/con* -t /dev/con1 &
The -t ports have login started on them immediately. The -T ports have login started only after a character is received.

However, tinit does not include any code to handle modems, there is another utility, modem, which does that. After initializing the modem, the modem utility watches for a string RING and issues ATA to answer the call. When it detects a CONNECT string, it starts login on the port.

Parameters to the tinit utility can be specified, so that it starts modem, rather than login on the serial ports. Sometimes it is handy to be able to prevent the modem from answering. If a single tinit handles all the console and serial ports, it will be difficult to do that. What I suggest instead is to run two copies of tinit, one for the consoles and one for the serial ports, so you can just slay the tinit handling the serial ports and the modem utilities to stop it. To make slaying tinit easy, I create a duplicate of tinit with a different name, so that it is unique. I create two shell scripts to start and stop the modems.

Create a hard link to tinit, so you can call it a different name:
ln /bin/tinit /bin/tinitm

Create a shell script in a directory in the $PATH of root, possibly /usr/local/bin, or /usr/bin, which will be used to start the modem.

vedit mdmstart
#! /bin/sh
# MDMSTART - Run separate tinitm on modem ports
# $1 is serial device
# $2 is optional baud rate

# Uncomment next line to create a modem debug log, which will eat lots of disk
#DEBUG="-D /tmp/mdm.log"

if test $# -lt 1; then
	use mdmstart
	exit 1
fi

# Setup default baud rate if not specified
BAUD=${2:-57600}

# Setup number of rings to answer on
RINGS=2

# Setup number of idle minutes to hang up on
HUPTM=20

# Make sure tinitm exists, if not, create it
# tinitm can be easily slayed, independently of tinit
test ! -x /bin/tinitm && ln /bin/tinit /bin/tinitm

# Test first parameter is really a character oriented device
if test -c $1; then
	stty baud=$BAUD +ihflow +ohflow -isflow -osflow <$1
	echo tinitm -c "modem $DEBUG -b$BAUD -L -r$RINGS -s1" -m$HUPTM -t $1 &
	tinitm -c "modem $DEBUG -b$BAUD -L -r$RINGS -s1" -m$HUPTM -t $1 &
	exit 0
else
	use mdmanswer
	exit 1
fi

#ifdef __USAGE
#
#MDMSTART - Runs separate tinitm -c modem on a serial port.
#This allows slaying the tinitm associated with the modem to take over
#over the without slaying the tinit associated with the console.
#
#Syntax: mdmstart port [baud_rate]
#
#Eg: mdmstart /dev/ser2 57600
#
#To stop, use mdmstop
#
#endif
Create a shell script in a directory in the $PATH of root, possibly /usr/local/bin, or /usr/bin, which will be used to stop the modem.
vedit mdmstop
#! /bin/sh
#MDMSTOP - Slay tinitm and modem, which were started by mdmstart

slay -fQ tinitm
slay -fQ modem
exit 0

#ifdef __USAGE
#
#MDMSTOP - Slay tinitm and modem, which were started by mdmstart
#
#Syntax: mdmstop
#
#endif

Change the permissions, so that these shell scripts are executable:
chmod 700 mdmstart mdmstop

You can add /usr/local/bin/mdmstart to your /etc/config/sysinit.N file. You may need to specify the complete path, if mdmstart is not in /bin or /usr/bin. MODEMS

Modems are generally a problem, because they usually almost work. Many modems have defaults for equipment that was suitable 10 years ago, when modems were usually connected to terminals for dialing in to mainframes. However, to work properly for computer to computer connections, with error checking, compression and buffering, the configuration is different. You will need to look up various parameters in the manual, which are particular to each modem, and program it with the necessary configuration. Some modems have an alternate configuration which is suitable, but most require programming each desired parameter to get things exactly right.

Constant Speed Buffering or Link Rate Enabled
Hardware (RTS/CTS) Handshaking Enabled
Software Flow Control (XON/XOFF) Disabled, pass characters
Error Correction Enabled
Data Compression Enabled
Display Verbal Result Codes Enabled
Carrier Detect (CD) Normal Operation
Data Terminal Ready (DTR) Normal, reset and hang up when DTR drops
Data Set Ready Always On
SO rings to answer 0 (off)

Program this configuration into the modems at both ends. The QNX modem command will recall it using ATZ. The modem will not answer the call automatically, but will send RING to the computer, which will answer the call with the ATA command. So if the computer is not ready, the call will not be answered.

MICROSOFT WINDOWS CLIENT CONFIGURATION

INSTALL PHINDOWS

Create the following directory structure on the Windows 95 computer:
\USR\PHOTON
Into this directory, copy the files PHINDOWS.EXE and PHINDOWS.HLP.

Phindows is licensed for a single computer. If you wish to use it on more than one, you are required to purchase additional copies.

To create a shortcut on the desktop, right click on the desktop, click New, then Shortcut. For the Command Line, enter something like:
C:\USR\PHOTON\PHINDOWS -mcom1 -b57600 -o2 -k

If you wish to add an entry to the Start menu, click Start, then Settings, then Taskbar. Select the Start Menu Programs tab. Click Add. For the Command Line, enter something like:
C:\USR\PHOTON\PHINDOWS -mcom1 -b57600 -o2 -k

Select a folder to place the menu item in. You can select a folder and then click New Folder, which will create a folder within the one selected. Click Next. Enter a name and click Finish, then click OK.

Click on the icon or select the program from the Start Menu to start the Phindows session. After a short initialization, a simplified terminal session will appear. Type ATZ and press enter. The modem should respond OK.

Dial your QNX computer:
ATDT 555-1212 The modem should dial.

After the modems connect, you will receive the QNX login. After logging in with your username and password, start Photon:
exec /usr/photon/bin/phrelay
For users that will always do this, you can enter the command in the $HOME/.profile script so it will be run automatically at login. These users will no longer be able to login at the QNX console though !

RUN JUST AN APPLICATION, NOT THE FULL DESKTOP

Rather than start off with the full Photon desktop, it is possible to run a single application in a window instead. Since there is no desktop, this appears much more like a native MS-Windows application to a user.

This is controlled with a configuration file on the QNX machine. Edit the file /etc/config/phrelay. The format of this file is one application per line. The first field at the beginning of the line is a nickname for the application. This nickname is specified on the phindows command line as -s nickname. Use some blank spaces to separate the second field, which is typically the % character, which indicates that the user must login, before the application is started. Use some blank spaces to separate the 3rd field, which is the complete QNX command to execute, including any parameters. Specify the applications you require, similar to this:

dayminder % /usr/photon/bin/dayminder
sac % /usr/photon/bin/phsac -i5 -t2
sin % /usr/photon/bin/vsin

To create a shortcut on the desktop, right click on the desktop, click New, then Shortcut. For the Command Line, enter something like:

C:\USR\PHOTON\PHINDOWS -mcom1 -b57600 -o2 -ssac

Additional details can be obtained by reading the help file:

WINHELP \USR\PHOTON\PHINDOWS.HLP

Note: These instructions are for typical situations. Individual configuration may differ.
If you have any questions, please contact us for assistance.

Copyright © 1999 Qenesis Inc.