in reply to perl + modem
Cheers,
KM
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
RE: Re: perl + modem
by Anonymous Monk on Aug 22, 2000 at 01:19 UTC | |
e.g. for 'AT' syntax: atd1234 will 'typically' dial 1234 using tones. if you send any character during dialing or just after dialing ,during modem handshaking, then the modem will hang up! so be wary of terminal settings if you send something like: print <modem_fh> "atdt1234\r\n"; the \r 'might' not be neccesary, and you will be driven up the wall if it isn't, not that this has happpend to me! ;) the second 't' in that example should 'force' the modem to use tones, even if its configured to do pulses by default. Regards, Wayne | [reply] [d/l] |
by jcwren (Prior) on Aug 22, 2000 at 01:43 UTC | |
I'm doing this from memory. I have the complete specs at home (somewhere) from when I worked at Hayes. If you need more details, feel free to contact me at the e-mail address below. --Chris | [reply] |
|
RE: Re: perl + modem
by BlueLines (Hermit) on Aug 22, 2000 at 01:58 UTC | |
If you read the docs in the modules you'll see that the unix module is actually a port of the Win32 module (personally I'd feel better if it was the other way around). There are many functions that don't quite work right in Unix but are functional in the Win32 environment. I actually had to write a wrapper for Device::SerialPort to make it somewhat more usable (i was doing automated installation/configuration through a serial cable), and would be glad to post it up, although I'm not sure it would help you with dialing stuff... BlueLines Disclaimer: This post may contain inaccurate information, be habit forming, cause atomic warfare between peaceful countries, speed up male pattern baldness, interfere with your cable reception, exile you from certain third world countries, ruin your marriage, and generally spoil your day. No batteries included, no strings attached, your mileage may vary. | [reply] |
by Anonymous Monk on Aug 22, 2000 at 02:52 UTC | |
I have been trying to dial a phone number for almost 3 hours now and have got nowhere. I know my modem works because I can dial using minicom. But getting this dang Device::SerialPort to actually do something is yet to be seen. Hey I might as well post the code in case someone else can spot the obvious. #!/usr/bin/perl use Device::SerialPort qw( :PARAM :STAT 0.07 ); $PortName = '/dev/ttyS1'; $Configuration_File_Name = 'phone.conf'; $PortObj = new Device::SerialPort ($PortName) || die "Can't open $PortName: $!\n"; $PortObj->user_msg(ON); $PortObj->databits(8); $PortObj->baudrate(9600); $PortObj->parity("none"); $PortObj->stopbits(1); $PortObj->handshake("rts"); $PortObj->write_settings || undef $PortObj; $PortObj->save($Configuration_File_Name); $PortObj->write("ATDT5010005"); $PortObj->close || die "failed to close"; undef $PortObj; # frees memory back to perl print "help\n"; __END__ | [reply] |
by jcwren (Prior) on Aug 22, 2000 at 03:02 UTC | |
1) I would test this without using the RTS handshaking. Look up the command for the modem to turn off handshaking, or do it by resetting the modem to factory defaults. (by default it should be off in the factory settings. You can do a AT&F&WZ to fetch the factory settings, and write them into NVRAM, and reset the modem) 2) You don't have a carriage return at the end of the phone number. The modem isn't going to act until the CR or LF is seen. As a debugging aid, I can suggest wiring up a null modem cable, and connecting it to another machine with a terminal program. That way, you can be assured that the port is spitting out what you think it should be. --Chris | [reply] |
by Anonymous Monk on Aug 22, 2000 at 17:17 UTC | |
by Anonymous Monk on Jan 16, 2003 at 17:05 UTC | |
| [reply] |