rajesh@tcom.stc.co.uk (Rajesh Kirpalani) (08/29/90)
I am working with a Sun 386i running SUNOS 4.0.1 with an Amstrad SM2400 modem. Conventialy an RS232 cable can be used to connect a computer and a device. A suitable application could send/receive data from the device. | SUN | ==== RS232 ===== | Device | Suppose if we wanted to connect a device to a computer over longer distances a solution might be to use modems. Calling DTE Answering DTE | SUN | === RS232 ===| Modem | _ _ _ Tel _ _ | Modem | ==== | Device | The Sun will always calls the device. The modem at the device end is given the command : ATS0=1 (Answer the phone in one RING). (I configured the modem by connecting a dumb terminal and then connecting it to the 'device' once configured.) On the Sun I am using the command :- ( stty 2400 ; echo ATD number ) > /dev/ttya The above does not work. The modem does not execute the Hayes command. I have successfully used the UNIX program tip and entered Hayes commands. The reason I cannot use tip is that it interfers with the application that is going to be using this 'device'. (Application reports problems about two processes cannot share one port (?)) So the solution must dial the the 'device' and remain invisible to the application. Can anyone tell me why the modem is not responding even though a when a dumb terminal installed instead of the modem at the SUN; the command was successfully echoed on the terminal screen. Does any one know what the problem is ? Any solutions/ideas/pointers would be most welcome. ********************************************************************************STC Harlow Rajesh Kirpalani rajesh@jura.tcom.stc.co.uk *******************************************************************************
les@chinet.chi.il.us (Leslie Mikesell) (08/30/90)
In article <1909@jura.tcom.stc.co.uk> rajesh@tcom.stc.co.uk (Rajesh Kirpalani) writes: > On the Sun I am using the command :- > > ( stty 2400 ; echo ATD number ) > /dev/ttya > > The above does not work. The modem does not execute the Hayes command. Assuming that the modem is set to hold the DCD line up even when there is no connection (otherwise you won't be able to send anything out the port from a shell script), the problem is that you are sending characters after the dialing command before the connection is established, probably as a result of the outbound carriage return being translated into CR/LF. This can be avoided with appropriate stty options. Also, unless the modem is configured to ignore the DTR lead, it will drop the connection as soon as the command completes - you will need to something like "sleep several_seconds &" in the script to hold the port open while the other program starts up. > Does any one know what the problem is ? Any solutions/ideas/pointers > would be most welcome. I'd recommend writing the dialer in 'C' where you have more control over the low level details (i.e. you can handle the carrier detect lead properly and detect whether you actually have a connection or not). Or you might try using kermit to dial, then run the application as a shell escape. Les Mikesell les@chinet.chi.il.us
dgil@pa.reuter.COM (Dave Gillett) (09/02/90)
In <1909@jura.tcom.stc.co.uk> rajesh@tcom.stc.co.uk (Rajesh Kirpalani) writes: > On the Sun I am using the command :- > ( stty 2400 ; echo ATD number ) > /dev/ttya I'd suspect that "echo" may be providing a line-feed, in addition to or in place of the carriage-return expected by the modem. I remember encountering a similar problem with the MS-DOS "echo" command, which was fixed by putting the necessary text into a file and copying ("cat"?) to the device instead of using echo. You probably also want to put a delay in your procedure, to allow the dialing to take place and the line to stabilize before the application tries to use it--and remember to flush out the modem responses, too. Dave