Fun With Serial Modem Communications

By Ajd344 [http://www.atown.org/]

As you probably know, Just BASIC can "talk" through the serial port. The possibilities are truly endless, but the main and intended reason is to communicate with modems. This tutorial shows you how to do some cool stuff with Just BASIC and a modem, not the coding aspect of it.

Most modems understand something called the Hayes command set. First put into use in the early 1980s, this technology allowed the computer to send the modem instructions in strings. Nowadays, modem communications in Just BASIC arent very practical, due to the recent popularity of PPP (which isnt compatible in Just BASIC). But you can still do some interesting stuff!

Let's do some fun stuff! All you need is a modem. Before you go running out to the store looking for an external serial modem, please note that internal modems will work, as well! And, if you have a compatible cell phone, you can use that as a modem too (this was how I was able to dial into a long distance BBS, but I'll get into that later)! If you have internal modem or cell phone, and want to find out what COM port it was assigned, you can do that in the device manager.

Once you have determined the COM port of your modem, open TERMINAL.BAS (which was included in Just BASIC). Once your in there, change COM1 to the correct port, if needed. Now, ensure that your phone line is clear (and you sister isn't expecting an important phone call!) and run the program. Your modem was sent the Hayes command "ATZ", which reset it.

This paragraph is optional, but I recommend performing it because it makes it a lot easier to understand. In the prompt, type your cell number (no dashes). Click OK, and the computer should dial your number, and you should hear your cell phone ringing in your pocket! Of course, since your cell phone cant communicate with the computer, the program will time out. The Hayes command for dialing numbers is "ATDT5551212".

After calling random people's phones gets old, you can call another computer and have some real fun. Your ISP's access number probably wont work, because it is of the PPP connection. The most obvious way is to dial into a BBS. Yes, a BBS. If you haven't heard of them (aka, you didnt grow up in the 80s), a BBS is a server you dial into. Usually, there's a user account system, forum, file area, etc. Its actually pretty cool.

Hopefully, you have an active BBS in your area code. Here's a list of active BBSs: [http://www.dmine.com/dialbbs/dialbbs.htm]

Once you have found a BBS, run TERMINAL.BAS, and type in the number of the BBS (again, no dashes). Please note that long distance charges apply if the BBS is out of your calling area. The terminal program resets your modem (ATZ), and prompts you for a number. Then, the terminal program dials the number (ATDT[thenumber]). It will wait for the BBS server to send the string "CONNECT". If it doesnt in 20 seconds, the program times out (just as it did with your cell phone). If it gets CONNECT, your good to go. The terminal then opens up a texteditor (which it will use to display info from the BBS) and it sends any keys you type to the modem. Once you have gotten into the BBS, you can create an account with them and be on your way!

Hopefully you had a fun time doing this! There's a lot more you can do with Just BASIC's serial ports, but I pretty much quit after this. Good luck, and thanks for reading