Put Your Serial Port On The Web

A small brown PCB with various components on it. There is a headphone cable and DC barrel connector cable coming out of it.

Today, everything from your computer to your dryer has wireless communications built in, but devices weren’t always so unencumbered by wires. What to do when you have a legacy serial device, but no serial port on the computer you want to connect? [vahidyou] designed a wireless serial dongle to solve this conundrum.

Faced with a CNC that took instructions over serial port, and not wanting to deal with the cabling involved in a serial to USB adapter, [vahidyou] turned to an ESP8266 to let his computer and device talk wirelessly. The hand-made PCB connects via a 3.5 mm headphone jack to DB9 adapter which he describes in another article. While [vahidyou] did write a small Windows program for managing the device, it is probably easier to simply access it in a web browser from any device you have handy.

Want to see another wireless serial port application? This Palm Portable Keyboard Bluetooth dongle will let you type in comfort on the go, or you can use a PiModem to get your retrocomputer online!

37 thoughts on “Put Your Serial Port On The Web

  1. It would be ‘fun’ if someone would put a CNC lathe on the web, so that people could send motor commands to it via cURL, and then put the whole thing up on a twitch stream. see what kind of creativity people get up to!

    1. I thought so too however was converted in the early 2000s when using a Burny 10 plasma CNC wirelessly at a trade show where other plasma machines were being used. I just worked.

  2. UART over 3.5 mm headphone jack was strange enough to slow you down when this setup breaks. However, the 3.5 mm headphone jack to DB9 adapter is a going to be a nightmare to fix since there is no PCB! To make things worse, both of these need separate power supplies and they both use linear voltage regulators.

    This isn’t a serial to wifi adapter, it’s a guide on how to needlessly waste as much electricity as possible while creating non-recyclable e-waste!

    1. I’ll be honest here: this is sketchy and jank at best; and downright dangerous at worst. Worse still, title suggests that you should use a technique like this to expose serial ports *on the internet*. Thanks, but I’d prefer to not expose complete unauthenticated control of a CNC machine over the internet.

      A more correct approach would be to run a small SSH server on an ESP32 that provides encrypted access to specific devicy, or to use something like octoprint.

      1. This is precisely the issue I was facing recently.

        My projector (BenQ W5700) recently became supported by Home Assistant, and I wanted to hook it up. Except my HA box is about 15m away from the projector, and I can’t easily run a cable there.

        First idea was to use an ESP32 module – the projector has USB ports that can provide power (even when turned off), and since my WiFi AP is right next to the projector, wireless connectivity wouldn’t be an issue. Except I couldn’t really find any examples of making the MCU’s serial port available as a native serial port on another device.

        Then I realised that both my HA host (running on Proxmox), and my AP (running OpenWrt) can run `usbip`, so I grabbed a cheapo USB serial adapter, hooked it up, set up `usbip` services on both ends, and attached the USB serial device to my HA instance.

    2. “[..] and they both use linear voltage regulators.[..]”

      That’s not a bug, that’s a feature. Linear voltage regulators are dependable and clean. Efficiency is fine, too, if the difference between input and output voltage is reasonable.

      By the way, the LM7805 can do the job of the MAX232 in one way on its own.
      It’s an old hack.

      If the baud rate is not too fast, it can convert +12v signals of the V.24 to +5v without any extra parts. Since there’s merely voltage and little current floating from A to B, it’s not critical. A diode before the 7805 input is recommended, however.

      The other way round, from B to A, merely requires a diode. The V.24 port can decipher +5v signals (3v is the lower limit, afaik).

      Of course, someone could also use simple bipolar transistors (BC548/2N2222) and pull-up / pull-down resistors instead. Or a pair of opto-couplers. Would be a little bit cleaner, design wise.

      1. DB9 is an old falsehood that doesn’t want to go away. It’s DE-9.
        DB was fine for DB-25, though.
        V.24 also refers to RS-232-C.

        And if we’re very picky, we could argue that RS-232 was superseded by EIA-232.. ;)

    1. Not at all. That was my immediate reaction upon seeing the article, especially considering the fact that there are much better and more secure ways to do this with the same hardware.

  3. I guess Im the daft one here.
    I’d go find an ancient PC with a serial port, as it just seems so much easier.
    *looking in the shed*
    Crikey, didnt realise that I have 23 junkers.

    1. Why do you guys always associate the RS-232 with old rusty PCs from the junk yard?!

      There are *real* serial port controllers for PCI, PCIe and Express Card! 🙂

      They’re even superior to on-board ports, since they contain high-end UART FiFos.

      Not just an old 16550A (or worse, a 16450 from the 286/386 days), but very compatible successors!

      The RS-232 isn’t dead, it’s safe and sound.
      It’s just nolonger a consumer’s tech.

Leave a Reply to SteveSCancel reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.