Category Archives: RS232 to Internet

RS232 to TTL adapters with all signals, including DCD

I have been experimenting with hooking up low-cost ESP8266 WiFi modules to the Radio Shack Color Computer (or anything with an RS-232 port) using cheap RS232-to-TTL adapters. Most of these adapters only support 3-wire RS-232 (transmit, receive and ground). This is fine for most uses of the CoCo’s built-in Serial I/O port (bitbanger) since it is only a 4-pin DIN connector with TX, RX, GND and CD, and most things do not rely on carrier detect.

But, for the Deluxe RS-232 Program Pak, a hardware 6551 UART chip is used and that chip requires to see carrier detect before it will receive any data. A workaround is to simply tie some of the TTL converter pins together to make it always present DCD to the RS-232 Pak:

This works fine if you are just connecting to remote systems, but if you want to run a BBS, those often rely on carrier detect to know if a caller is online. If a caller disconnects without properly logging off, the system may sit there forever (worst case) or until some software timeout is reached and the system resets. During that time, it would be possible for the next person connecting to resume that session.

This was a real and common issue with BBSes back in the 1980s, for this very reason – lack of carrier detection.

Another issue is the lack of hardware flow control. There could be times when the ESP8266 could try to send data faster than the computer could process, and there is no way (other than XON/OFF, which can’t be used for binary transfers) to tell it to pause sending.

I have found RS232-to-TTL adapters that provided 5-wire signals (adding RTS and CTS), which is needed for this hardware flow control. Those are a bit more costly (I found one for $9 on Amazon), and still do not address the carrier detect issue.

Once again, David Chesek comes to the rescue. He located an adapter that supports all the RS-232 signals, including RI (ring indicator). It is available for $11.50 plus shipping from a company in Las Vegas called Pololu (and might even be manufactured there):

Pololu RS-232 to TTL adapter with all signals. (Photo taken from Pololu.com)

https://www.pololu.com/product/126

I took a gamble (pun intended) and ordered a few. I will report back as soon as I receive them and have had a chance to try them out.

Meanwhile, knowing such a thing exists, I did more searching and found a similar one on e-Bay from a seller called MDFLY. They have them for $3.25 plus shipping, and are shipped from California:

eBay seller MDFLY RS-232 to TTL adapter with all signals. (Photo taken from their eBay listing.)

https://rover.ebay.com/rover/0/0/0?mpre=https%3A%2F%2Fwww.ebay.com%2Fulk%2Fitm%2F382224238410

The board layouts are quite different, but the functionality should be similar. I will be comparing both of these (and noting shipping time) when I have them.

With either one of these boards, properly wired to additional pins on a full ESP8266 development module, it should be able to provide hardware flow control and carrier detect. (Sorry, the ESP-01 module only has two I/O pins, so we’d have to pick and choose what to support on that one — like DTR and DCD for BBS use, or CTS/RTS flow control.)

More to come…

Help needed with 6551-based RS-232 Pak to 3-wire without DCD

Updates:

  • 2018-02-05: Thanks to Dave Chesek, this issue has been solved. He took the wiring diagram below and modified his RS232-to-TTL adapter with a  bit of solder. He put a blob connecting pins 7 (RTS) and 8 (CTS), and then soldered together 1 (DCD) and 6 (DSR) then ran a jumper wire from those two over to 4 (DTR). It worked fine. My efforts to do this with jumper wires must not have been making good connection (perhaps one of my DB9 pin holes is not as deep – TX, RX and GND all worked fine with the jumper wires). I will do a bit more investigation to see what the minimum required. Thanks, Dave!
  • 2018-02-06: See the complete writeup.

The 6551 serial chip will not receive unless DCD is active. Modern adapters do not provide DCD. I am trying to find a way to do this so I can hook my WiFi device (which only has TX, RX and GND) to the RS-232 Pak.

I have been trying to jumper wires to fake the DCD signal but nothing has worked. I do not know if my Pak is defective, since I have nothing else to connect it to for testing,

Many sites suggest a wiring example like this:

Has anyone done this? Nothing modern has DCD so surely there is a simple solution figured out long ago.

WiFi CoCo for $15 (or for any retro computer with an RS-232 port)

Updates:

  • 2018-02-04: Removed an apparently necessary step.
  • 2018-02-05: Added crude drawing showing how I wired things up.

If you want to get your Tandy / Radio Shack Color Computer (CoCo) on the internet (or any other 80s computer with a serial port), here is a dirt cheap way you can do it.

Cheap WiFi: The Early Years

Just a few years ago, adding WiFi to an Arduino meant buying a $60 add-on. My solution at the time was to get a much cheaper Ethernet and then use a cheap TP-LINK WiFi router hooked to it. I later found a source for a $10 Ethernet shield that made the overall cost even lower.

In 2014, the internet lit up with the discovery of the ESP8266 – a complete “WiFi on a chip” solution for under $5! Initially, all documentation was in Chinese but folks managed to figure out how to use it and, as they say, the rest is history.

Today the ESP8266 family of products is used in all kinds of things. There are now internet-enabled light switches, and front-ends for 3-D printers, and many other devices that get online thanks to this low-cost solution.

And, this includes all these retro computing platforms!

Cheap WiFi: How To

If you want to experiment, you can order an ESP8266 development board from Amazon for $8.79. This contains the low-cost ESP8266 module and then runs out all the various connection to pins, and also has a USB-Serial adapter built in. This USB port allows you to plug it up to a Mac or PC and upload new firmware, or use the device directly through a serial connection.

Here is the module I purchased. You can find many variations, some costing more, and others costing less. I wanted one I could get direct from Amazon using 2-day Prime delivery, but if you don’t mind waiting, you can find a similar part shipped from China for about $4.

An ESP8266 development board, available for under $9 from Amazon. (And much less from China!)

Since my 1980s computers do not have a USB port, I needed a way to hook them up to the old-style RS232 serial port instead. For that, I bought a cheap RS232-to-TTL adapter. Here is the one I purchased for around $7, shipped from Amazon with 2-day Prime shipping. I see there are some for a few bucks less which might work just as well, and if you don’t mind waiting a few weeks to get something shipped from China, I have seen them for about .67 cents!

RS232-to-TTL adapter.

Now all I had to do was connect the two modules together using some jumper wires. I needed four wires to connect Voltage (mine needed 5v), Ground, Transmit and Receive. You can buy a bundle of these wires for just a few dollars.

Once connected, it looked like this:

ESP8266 development board to RS232 converter.

I can power the module using a standard micro USB cable and charger (just like you might already have for an Android phone or Raspberry Pi or some models of Arduinos).

After this, all I needed was a NULL Modem cable to connect that DB9 connector to the Serial I/O port of my Color Computer. In my case, I used a “Driverwire cable” which has a 4-pin DIN connector on one end and a DB9 on the other. I needed to use a NULL Modem adapter to get the signals talking.

ESP8266 ESP-12E devkit wired to DB9-to-TTL adapter and connected to a CoCo Drivewire (null modem) cable.

Cheap WiFi: ZIMODEM Software

The final step I needed to do was to install different firmware on the ESP8266. The firmware that comes on the module does allow you to type certain “AT” commands and connect to WiFi and remote systems, but I wanted something easier and more compatible. I found this ZIMODEM firmware:

https://github.com/bozimmerman/Zimodem

This makes the ESP8266 look like an old-style Hayes Smartmodem. Instead of using commands to dial a phone number, the commands will “dial” a remote telnet BBS. i.e., instead of:

ATDT 515-555-1212

…you can dial a telnet connection:

ATDT "coffeemud.net:23"

There are new commands added to display all nearby WiFi base stations, and connect to them. There’s even a command to retrieve a file from a web server! You can find full documentation on the ZIMODEM website.

Any terminal program can be used to make these types of connections. You can also configure it to receive incoming connections, and when someone telnets to your IP address, you will see a “RING” (just like the smartmodems did) and can have the system answer. Yep, it would be very easy to put an old-school BBS on the internet with this!

I was able to use this to connect an old Radio Shack CoCo to a remote BBS using the Greg-E-Term terminal program over the bitbanger port at 1200 baud (oooh, speedy).

Building and Installing ZIMODEM

I got these steps from the Amazon page for the ESP8266 part I purchased. I have edited them with additional notes and links.

Instruction & Steps of How to use:

  1. Download the latest version of the Arduino IDE. Today, there are versions of the IDE that run in a web browser (I have not tried these), as well as ones available for Mac, Windows and Linux. I used one for Windows 10, downloaded from the Microsoft Store.
  2. Install the IDE. (Well, duh…)
  3. Configure the Arduino IDE with support for the ESP8266:
    1. Go to File->Preferences and copy the URL below to get the ESP board manager extensions: arduino.esp8266.com/stable/package_esp8266com_index.json
    2.  Go to Tools > Board > Board Manager> Type “esp8266” and download the Community esp8266 and install.
    3. Set up your chip as:
      • Tools -> Board -> NodeMCU 1.0 (ESP-12E Module)
      • Tools -> Flash Size -> 4M (3M SPIFFS)
      • Tools -> CPU Frequency -> 80 Mhz
      • Tools -> Upload Speed -> 921600
      • Tools–>Port–> (whatever it is)
  4. Download and run the ESP8266 flasher program from Github:Win 32-bit: github.com/nodemcu/nodemcu-flasher/tree/master/Win32/Release
  5. To test that things are working, in Arduino IDE, look for the old fashioned Blink program (File->Examples->ESP8266->Blink). Load, compile and upload. If it worked, the module will have a blinking LED, indicating it is now running software you build using the Arduino IDE.
  6. Now all you have to do is download the ZIMODEM software, then open the main “zimodem.ino” file in the IDE (the other files will open in different tabs, automatically), and build and load it to the ESP8266.

UPDATE: I did not need step 4 when I recreated these steps on my Mac, so maybe they are not even needed on the PC side these days.

These steps worked for me, but I want to go back through them (as well as finding Mac instructions and Linux if someone can assist me with that) and add photos and more details.

FTP, IRC, TELNET and more! Oh my!

ZIMODEM was created for Commodore computers, and has some special features in it for translating normal ASCII to Commodore’s PETASCII. It also comes with steps on how to use it with a Commodore from BASIC (with some assembly language routines used for high-speed reading and writing to the modem – sound familiar?). They have source code for various internet utilities such as:

  • WGET (get a file from a website)
  • FTP
  • IRC (chat)
  • TELNET
  • TELNETD (for connecting to the Commodore remotely and using BASIC over the Internet)
  • WEATHER (a two player network game from the Commodore PET days)
  • …and others.

With DriveWire on the CoCo, some of this exists but only for OS-9. It is my hope that we can easily port these BASIC programs (and even replicate the assembly language routines) over to the CoCo and do the same thing.

More to come…

More RS232 to WiFi (or Ethernet) options…

Here are some more options for getting an old 1980s computer on the internet via RS-232 to WiFi/Ethernet adapters.

ESP8266

The ESP8266 developer modules, like the one I picked up from Amazon for $8.99, are available for around $2.75 when shipped from China. That, and an RS232 converter for about .67, is about all you need other than some wires to connect stuff up, and a USB power supply. See AliExpress.com for options. There are also e-Bay sellers that have similar prices.

The advantage this module has is tons of third party firmware. There is the ZIMODEM project that makes the module look like an old Hayes smartmodem. You can use “AT” commands do dial (IP address instead of phone number) and even answer a call (incoming telnet connections appear as “RING” and “CONNECT” just like someone calling in to a modem BBS).

HLK-RM04

This part is also used for RS232 to WiFi and Ethernet conversions. You can find a board that this part plugs in to for about $4. Here is one from e-Bay:

https://www.ebay.com/itm/Serial-ports-Uart-WIFI-module-Base-For-HLK-RM04-WiFi-Development-board/172552497820?hash=item282cee2a9c:g:u5IAAOSwPPpaRMtB

The board accepts a 5V power supply, then has an RS232 DB9 connector on one side, and two Ethernet ports (LAN and WAN) on the other. When the HLK-RM04 is plugged in, that makes it work, and also provides WiFi.

The module is available with internal or external antenna. You can buy one with everything you need (no case) for about $13! Here is an example at AliExpress:

https://www.aliexpress.com/item/Q14081-RS232-RS485-Internal-Built-in-Antenna-WiFi-Module-with-HLK-RM04-Test-Boar-FreePost/32717466611.html?spm=2114.search0204.0.0.56319465chH5X1

The disadvantage of something like this is that it’s just raw TCP or UDP communication. This means if you want to do real Telnet, you have to write some code to parse the data and handle telnet protocol. You would also have to implement any other protocols in code, while smart firmware would be written on the ESP8266 (and probably already has!) that goes things like HTTP GET, mail fetch, etc.

More to come…