AUTO-ANSWER FOR PACKET AND PC by Joel Ackerman, KE4SW (for PC users with Procomm Version 2.4 or higher, and TNC-2 type TNCs) Have you ever waited and waited for your buddy to connect to you so you could send (or receive) a particular (always important) message, just to have him connect and disconnect while you went to the refrigerator for a new 807? If you are a PC user you may be interested in the programs below, which take advantage of the powerful script programming language which is part of the communications package ProComm (available on most bulletin boards and priced very reasonably from DataStorm). I developed the programs below because I had no BBS that my dad and I could both check into for message passing, plus we wanted an easy way to pass traffic too routine for the BBS's (you know, "Just wanted to say 'Hi' type of traffic") while I automatically could receive what-ever traffic he had for me. You may choose to use only the script file (PACKET.CMD) starting it when you wish to let the computer monitor the tnc, or you can implement the associated batch files so the computer takes over the tnc from power-up, until you stop the script (by hitting Escape)...This approach allows the system to restart after a power failure. The system below performs the following functions: 1. It sets the (basically inaccurate) clock in my TNC to the (more accurate) time from my computer. 2. It starts the communications program, initializing the TNC's monitor parameters (so I can read the mail when I'm around. 3. It then waits for a CONNECT, at which time it sets off an alarm for me to "answer the radio" if I'm around 4. If I'm not around, it checks to see if I have left the name of the caller, and if so, if I have left a message for him. 5. It sends him whatever message I've left (any length). 6. Whether or not he had a message, it opens a file and receives the caller's message. 7. It then thanks the caller, closes the log file, and disconnects so it will be ready for the next caller. A computerized answering machine! Would you like to know how all this stuff works? Then read on.... The autoexec.bat file below contains the commands to set the clock in the tnc and then start Procomm and execute the programs to have Procomm answer the TNC when connected. You will probably change most of the commands to match your system, so this file is for reference only. AUTOEXEC.BAT ------------ path c:\;c:\bat;c:\util;c:\dos ;JUST SETS MY PATH set procomm=c:\coms\procomm ;FOR PROCOMM TO FIND IT'S FILES prompt $p$g ;PROMPT WHEN IN DOS rtclock ;SETS REALTIME CLOCK cd\coms\procomm ;CHANGE TO PROCOMM'S DIR basic da ;RUN BASIC PROGRAM DA.BAS (BELOW) copy pac.+da.+packet.cmd pacda.cmd ;COPY THREE FILES INTO COMMAND FILE procomm /fpacda ;START PROCOMM AND EXECUTE PACDA.CMD cd\ ;DONE W/PROCOMM... Here is the basic program DA.BAS executed by autoexec.bat after the realtime clock sets itself: 10 D$=DATE$ ' Get the Date 20 T$=TIME$ ' And the time 30 MM$=MID$(D$,1,2):DD$=MID$(D$,4,2):YY$=MID$(D$,9,2) ' parse Date 40 HH$=MID$(T$,1,2):MI$=MID$(T$,4,2) ' parse hour and min from Time 50 DA$="DA "+YY$+MM$+DD$+HH$+MI$+"! !" ' Create DA code string 55 PRINT "TNC time will be set to ";DA$ 'Message on the screen 60 OPEN "O",1,"DA." ' Create File DA. 70 WRITE #1,DA$ ' Write DA code into file 80 CLOSE ' Close file 90 SYSTEM ' And back to autoexec file This program will create a file called DA. which will contain only the command to set the time, e.g.: "DA 8611151646" Even if you're not a Procomm user, you probably can take advantage of the above idea. All you have to do is send the file created above to your TNC. The file below (called PAC) has the results of the program above tacked onto the end of it. It is executed, followed by PACKET.CMD. TRANSMIT "~+++~~~ATS0=0!" ;Tell Hayes Modem not to answer phone. PAUSE 1 ;Wait a second for result SET PORT COM1 ;Change port to Com1 SET BAUDRATE 1200 ; 1200 BPS \ SET PARITY EVEN ; Even Parity |-set for your TNC SET DATABITS 7 ; 7 bits / LOG OPEN ;Open default log file TRANSMIT "MONITOR OFF!" ;Turn Monitor off TRANSMIT ; No CR after word...DA command goes here End this file with a space after the word TRANSMIT (no CR) and the copy command will append the command from DA on the same line. This is really a quick and very dirty solution. If you're a better BASIC programmer than I am, please fix this and let me know how you did it. (I'll even give you the credit!) But this method does work, so who cares!! PACKET.CMD is maintained as a separate file because you may choose to start the program after you've been in Procomm in a communicating session. It works either way, whether it's tacked on to the end of PACDA.CMD, or if you start it yourself. The only difference is that the clock won't be set for you. By the way, all the Monitor On, Monitor Off commands can be eliminated if you like. They make things run more smoothly if the channel is real busy. If you leave your monitor off anyway, just remove all of them and let it fly...One caution: leave MCON off when the script is running or all kinds of odd things might happen. After date is set, packet.cmd waits for the CONNECT... You can start PACKET.CMD anytime you are already in Procomm...then just walk away from the computer/rig... Only one real bug has surfaced in all of the experiments we have run. If you leave your modem on when your script starts, then the phone rings, Procomm doesn't know what happened on the other Com port and goes to gaga-land. Not dangerous in itself, but it means re-booting the machine. I left the code in because I'm (naively(?)) convinced that DataStorm will correct this little hitch now that I've brought it to their attention. Thanks to Owen Adair, WD4FSU, for his help and comments in developing and testing (and testing) the initial scripts, and to my father (DOC), KF4CX, for his patience and feedback. I hope you enjoy using these scripts...I am sure I'll add bells and whistles from time to time...just connect to me and ask (me or the computer) for the latest mod... 73, Joel, KE4SW