Tutorial: Telnet to a BBS using a terminal program in the Hatari emulator

A screenshot of ANSIterm running in the Hatari emulator.

I’ve written in the past about my adventures telnetting to BBSes from terminal programs running inside the Hatari emulator. I’ve made some changes in my process and I thought it would be good to explain everything, step-by-step. It’s not for the novice, but it is rewarding.

Besides Hatari and any ST software you want to run, you’ll need to install two things:

  • tcpser
  • socat

This tutorial is based on my experiences on the Mac. The instructions should translate well to Linux, but probably not Windows. The tutorial assumes that you are familiar with Hatari and know how to configure it for normal emulation. If you don’t, check out this guide to setting up Hatari.

I’ll explain how to install tcpser and socat, and then how to wire them together so your emulated Atari can telnet to a BBS.

Do you enjoy my retrocomputing tutorials on Break Into Chat? Please join my email list and stay in touch. 📬

1. Install tcsper

FozzTexx maintains a fork of tcpser that incorporates many updates and bug fixes. I have tried many flavors of tcpser over the years, and I have found FozzTexx’s to be the most reliable and compatible.

First you’ll want to clone FozzTexx’s repo:

git clone https://github.com/FozzTexx/tcpser.git

Then follow the instructions to compile an executable for your platform.

2. Install socat

If you have a Mac, you can easily install socat via Homebrew: brew install socat

On Linux, you can use your standard package manager (e.g. sudo apt-get install socat)

Or, if you prefer, you can build socat from source, which you can download here.

3. Run tcpser

Open a couple tabs in the Terminal.

In the first tab, we will run tcpser, and we’ll configure it with a virtual serial port running at 19,200 bps.

tcpser -v 25232 -s 19200

Leave this tab open until you have finished your BBSing session.

4. Run socat

In the second terminal tab, let’s run socat, and tell it to pipe the input and output from port 25232 to a temporary FIFO file that Hatari will read.

socat PTY,link=/tmp/atari,raw,echo=0 TCP4:localhost:25232

(You can call your temp file /tmp/atari or anything you want. Mine is /tmp/josh)

Leave this tab open until you have finished your BBSing session.

5. Configure Hatari for modem emulation

In theory these settings can be edited in Hatari’s Preferences interface, but in practice it doesn’t work, because on a Mac you can’t navigate to the /tmp/ folder through Finder’s “choose” buttons.

Instead, let’s use a text editor (like Sublime Text) to edit your hatari.cfg file. On the Mac, this file is located in ~/Library/"Application Support"/Hatari/.

Scroll down to the [RS232] section and change the lines to look like this (taking care to use the correct name for your temp file):

[RS232]
bEnableRS232 = FALSE
szOutFileName = /tmp/atari
szInFileName = /tmp/atari
bEnableSccB = FALSE
sSccBOutFileName = /dev/modem

Save and close the config file.

6. Run Hatari!

Fire up Hatari. Once you see your Atari ST desktop, load whatever ST terminal program you want to use. My personal favorites include ANSIterm, TAZ, and Freeze Dried Terminal. I also have been playing with the Thieves Guild front-end client.

Once your terminal of choice is open, set the baud rate to 19,200, and make sure it’s 8N1 (8 bits, no parity, one stop bit), although that’s pretty standard.

Hatari’s preferences dialog box

Now, we need to open Hatari’s preference panel and activate modem emulation. It’s important to do this LAST because Hatari’s serial emulation code doesn’t work well with the way Macs and other BSD-type OSes handle file locking. Hatari will sometimes freeze on the Mac if you start the modem emulation too soon. (2022 Update: Serial emulation is no longer problematic on Macs with Hatari v2.4.0 and later)

So, open Hatari’s preferences, choose the “Peripheral” tab, and click the “Enable RS232 Emulation” checkbox. Then click “OK” to close the preferences dialog box.

7. “Dial” out

ANSIterm and some other terminals will opens directly into an “online” mode, where you can type commands to the modem. In the old days, we might have typed something like atdt555-5555 to connect to a BBS at the phone number 555-5555.

Very few BBSes today use modems and phone lines. Instead they are on the internet, and users connect to them via telnet.

So, what we’ll do today is “dial” an IP address. This step will require some research: You’ll need to lookup the IP address for the BBS you want to visit.

For purposes of this tutorial, we’ll connect to Dark Force BBS, which as of this writing is at 173.80.217.46 on a nonstandard port (520). So our AT command would be:

atdt173.80.217.46:520

Type that in to ANSIterm and press “Return.” With luck you’ll see “CONNECT 19200” followed by the BBS’s logon screen!

(If you see “NO CARRIER,” that may mean something went wrong — but it could also mean that the BBS is busy and has no extra connections available. Double-check your AT command and make sure you didn’t mis-type.)

Have any questions or comments? Please share them in the comments below.


Posted

in

, ,

by

Comments

7 responses to “Tutorial: Telnet to a BBS using a terminal program in the Hatari emulator”

  1. Paul Avatar
    Paul

    What settings do you use to connect to the Dark Force BBS in the Thieves Guild client? I am able to connect to it in ANSITerm, but I have yet to get the TG client to work – call bbs seems to strip out any punctuation for the IP.

    1. Josh Renaud Avatar

      Paul, for the TG Emulator, I use the following settings: 19.2 baud, full duplex, no parity.

      Two key points:

      1. Use “Online” mode (where you can manually type Hayes “AT” commands) rather than the “Call BBS” function.

      2. Do *not* activate modem emulation in Hatari’s preferences until you have already hit “O” and entered “Online” mode.

      Once you are in online mode, then it’s safe to activate modem emulation, and then you can type “ATDT” followed by the IP address (and it’s fine to use periods).

  2. zenlistener Avatar

    Thanks for this. I was able to use Hatari and Freeze Dried Terminal to ‘call’ some BBS’. I figured I’d try the ST after getting the Atari 8-bit to connect (using Altirra). I reckon my next try should be with FS-UAE for the Amiga experience.

    Also, I was able to connect to a BBS by using the name rather than IP address. It worked fine. Except, as you noted, Hatari can crash real easy when using this method.

    1. Josh Renaud Avatar

      Glad you succeeded! … And thanks for sharing that AT commands work with domain names.

      I guess I have been in the habit of typing only IP addresses because I use a Lantronix serial device with my Atari Mega STe computer, and it only supports IPs.

  3. Lastic Avatar
    Lastic

    Did you get this to work with TAZ also ?

    in TAZ it keeps repeating my keypresses so atdt is shown as aattddtt and from the tcpser debugging log I can see it’s trying to do a atdt toward domainname dtt 🙂

    ANSI-term seems to work fine

    1. Josh Renaud Avatar

      I was able to repeat your results this morning. I tried changing a bunch of settings, but unfortunately I had no success getting Taz to stop sending duplicate characters. I’m not sure what the issue is.

  4. Lastic Avatar
    Lastic

    Another question that I was asked by a user on my BBS (thecell.ar:1040) , did you try if downloads and uploads work ?

    I’ve been trying myself this morning and when using the verbose mode in socat I can see the BBS starts sending the data but it seems that XYZ.TTP on Hatari isn´t receiving the data or is simply too slow so it misses the transfer and errors out in the end.
    Tried ZMODEM,YMODEM,XMODEM-1K,XMODEM-CRC,XMODEM-checksum>

Share your thoughts!