Serial to Wifi

My lab is criss-crossed with wires already enough.   This little cheap hack allows me to connect to my retro machines over wifi.

The ESP 8266 and the ESP32 are astoundingly cheap WiFi enabled microcontrollers that are useful in countless ways.  I've used the ESP-01 to bring CP/Net to my Mark IV,

and here I use a not quite as cheap boardlet from DOIT, the DEVBOARD V1, to do something very simple but very useful

What I need is a DEVKIT V1, which has an ESP32, a usb port, and a bunch of IO pins on headers.  I buy these in handfuls at 4 bucks a pop.  I get the ones without pins soldered, since I might want them on top, on the bottom, or none at all.

the next part is much more expensive, the RS-232 dongle.  you can cheaper ones of these, and it will change the details of the wiring and cosmetics.  the one I used is the Female NulSom Inc. Ultra Compact RS232 to TTL Converter.  this one is nice in that is tiny.  there is another made by artecon which is also tiny, but does not have the holes to easily mount the board.  there may be other small ones.

the only other parts are a small protoboard and some in line headers, wire-wrap wire and solder.

first, I soldered a 4 pin header onto the rs-232 dongle.   I attached a good long run of wire wrap wire to the RS-232 pin 9, which is ring indicator, as a hack that I'll describe later.  then, I positioned the dongle just at the edge of the proto board, and found the holes in the proto board that best lined up, and soldered them in.  I carefully clipped the pins on the dongle top, because I don't want them shorting on the ESP32 can when I build the sandwich.

in this image, you can see my weaving technique I use to route wire wrap wire.

we only connect 5 wires.

GND, the ground, comes from the dongle and goes to the second to last pin on the bottom connector.  it could just as easily go to the top; theres another ground there.

VCC, the power for the dongle, comes from the DEVKIT's 3v3 pin, the last one on the bottom.  the dongle could also be driven by the input voltage to the board, but that means a junction.

->, the transmit line, goes to RX2, the 6th line on the bottom from the right.

<-, the recieve line, comes from TX2, the 7th, right next to the other.

I connect the wire I grabbed off on pin 9, on the back of this dongle,  to VIN, the last pin on the top.   this is a hack to power the board from the RS232 connector, which I can wire on my target systems to put 5v onto ring indicator, a seldom used RS-232 pin.  I really ought to put a diode on this to prevent blowing the dongle up if i plug it into something that actually drives RI.

the completed sandwich.   Next, the software.

since I need to set the WiFi ssid and password for connection somehow, I need a way to configure the device initially.  this is done by connecting to the USB port at 115k baud, 8N1.  I use putty for this.

on reset, the ESP32 does its usual signon, and then tries to connect to the saved in EEPROM settings. if this fails, and it will, it then prompts you to set the SSID, password, TCP port number, and baud rate.

once you finish, it writes these into nonvolatile storage and then tries to connect. 

it creates a TCP server and listens on the port.   anything you type on the RS-232 gets sent to the socket, and vice versa.

any input on USB will re-edit the connection settings.  it restarts with the new settings if you change anything.

As an added bonus, it blinks the blue LED whenever something goes over the wire.

get the source code on and install it using arduino.  you'll need to follow the instructions for the ESP32 DEVKITV1 if you haven't set that up yet.

github.com/cm68/WiFiDongle