Skip to content

CSpect UARTRS232 plugin

Julien Clauzel edited this page Nov 5, 2026 · 1 revision

The UARTRS232 plugin — network for the Next inside CSpect 🌐

Since 9.7.58. Settings → RS232 ESP Emulation (CSpect) gives the ZX Spectrum Next emulated by CSpect a working ESP (Wi-Fi module) with no hardware at all. .sync5, ZX Next Remote and the NextZXOS WiFi tools then reach your real network through the PC — exactly as they do in MAME with RS232 ESP Emulation (Mame).

CSpect has no built-in way to reach the app's ESP emulation, but it loads plugins. UARTRS232 is a small plugin (UARTRS232.dll, about 16 KB) that ZX Next Unite carries with it and installs for you. It connects the emulated Next's ESP serial port to the app's RS232 ESP emulation:

Next software (in CSpect) ──UART──▶ UARTRS232 ──▶ RS232 ESP emulation (in ZX Next Unite)
                                                        │
                                                        └──▶ your network

No USB ESP module, no serial cable, nothing to set up on the Next. And no speed restriction: the link has no baud rate, so .sync5 -f, -default and -s, and ZX Next Remote's Fast / Medium / Slow all work. (In MAME, the null_modem path needs the Next side on its slow pacing. Not here.)

It is not UARTReplacement. UARTReplacement, by Robin Verhagen-Guest, connects CSpect to a real ESP module on a serial port. UARTRS232 needs no module. The two are named differently on purpose and can sit in the same CSpect folder — see Next to UARTReplacement.

Contents

Installing it

The normal way: one checkbox

  1. Open Settings and tick RS232 ESP Emulation (CSpect).
  2. Launch CSpect from the app — the 🕹 Launch CSpect button on the SD Card Utility tab, an emulator strip, or Start CSpect with file.

That is all. At every launch the app:

Step What happens
1 Copies UARTRS232.dll beside CSpect.exe, if it is missing or an older build. CSpect loads every plugin it finds in its own folder.
2 Starts the RS232 ESP emulation — or joins the one already running for a MAME or another CSpect. One emulation serves every running emulator, each with its own session, and stops when the last one exits.
3 Tells the plugin where the emulation listens.

The SD Card log window says what the launch got, for example:

RS232 ESP: the UARTRS232 plugin 1.0.0 was installed in the CSpect folder …\CSpect4_5_1_0.
RS232 ESP: CSpect uses the RS232 ESP emulation on port 2222 through the UARTRS232 plugin. …

Untick the box and CSpect is launched with the plugin told to stay out. You never have to delete the DLL: the checkbox is the switch.

When you install or update CSpect from the itch.io tab

Each CSpect version lives in its own folder, so a plugin installed in the old one does not follow you to the new one. Right after an itch.io install — a first one, a manually picked .zip, or the startup update — the app therefore asks, about the CSpect it has just adopted:

Question Yes Not now
Install the UARTRS232 plugin? Copies UARTRS232.dll into that CSpect folder Nothing is installed, and the second question is not asked
Enable the RS232 ESP emulation for CSpect? (only if the Settings box is not ticked yet) Ticks RS232 ESP Emulation (CSpect) for you The plugin stays installed but unused until you tick the box

Nothing is asked when there is nothing to do — the folder already holds the current plugin and the box is ticked. On Windows the OpenAL offer comes first when OpenAL is missing; the two never appear on top of each other.

If you say Not now and change your mind, just tick the Settings box: the next CSpect launch installs the plugin.

By hand

You can also copy UARTRS232.dll into a CSpect folder yourself — for a CSpect you start outside the app. Take it from extra/UARTRS232 in the repository.

Started by hand, the plugin is automatic: it takes the Next's ESP only when an RS232 ESP emulation answers when CSpect starts (by default on 127.0.0.1:2222), and it steps aside if CSpect was given -com or if UARTReplacement is installed beside it. So the emulation must be running first:

  • it already is, while a CSpect or a MAME on the null_modem path launched from the app is still open; or
  • start it from the app's MCP server (esp_emulation_start); or
  • from a source checkout, on its own: python espemu.py --port 2222.

Using it

Nothing changes on the Next side: run what you would run on real hardware.

On the Next What to expect
.sync5 -L (or -listen) Connects to the Remote Explorer at any speed (-s, -default, -f)
.sync5 (classic sync), .sync5 -send … Work as on hardware
ZX Next Remote Works at UART speed Slow, Medium or Fast
NextZXOS WiFi tools See a module that is joined to an access point

The address the Next shows as its own is this PC's — pick another one in Settings if the PC has several (see below). The server address the Next dials (.sync5 <PC ip>, ZX Next Remote's settings) is the PC's address as usual.

Configuration

In Settings

All in Settings → Emulators:

Setting What it does
RS232 ESP Emulation (CSpect) The switch described above. Off by default.
Port The TCP port the emulation listens on — 2222 by default. Applied at the next launch that starts the emulation; a launch made while another emulator is running joins the one already listening.
RS232 ESP Emulation verbose mode Traces the emulation into the SD Card log window: every AT command, connections, transfer summaries. Also makes the plugin print its own events on CSpect's console. Chatty — off by default.
IP address shown to the emulated Next The address the Next reports as its own. Automatic is this PC's primary address; pick another from the list or type one. A running emulation takes the change live.

The port, the verbose mode and the address belong to the emulation itself, so they are shared with RS232 ESP Emulation (Mame): there is one emulation for both emulators. They are available while either box is ticked.

A -com=… typed in CSpect default launch parameters is an explicit choice of a real serial port and wins: that launch does not use the emulation, and the log says so.

UARTRS232.cfg

Optional, for a CSpect started outside the app. Put a text file named UARTRS232.cfg beside the DLL:

# UARTRS232.cfg
enabled  = auto        # auto (default) | on | off
host     = 127.0.0.1
port     = 2222
verbose  = off
priority = -100
Key Meaning
enabled auto: take the Next's ESP only if an emulation answers at startup, and step aside for -com or UARTReplacement. on: always take it, and keep trying to reach the emulation (the Next sees no ESP until one answers). off: never.
host, port Where the RS232 ESP emulation listens. Set port here if you changed it in Settings.
verbose on prints resets, UART selection and reconnections on CSpect's console.
priority Advanced. CSpect asks the plugin with the lower number first; −100 puts UARTRS232 ahead of UARTReplacement. Leave it alone unless another plugin needs the same ports.

When the app launches CSpect it overrides this file — the Settings checkbox always has the last word.

Environment variables

What the app sets when it launches CSpect, and what a script of your own can set instead:

Variable Value
ZX_NEXT_UNITE_ESP <host>:<port> — take the Next's ESP and connect there. off — stay out.
ZX_NEXT_UNITE_ESP_VERBOSE 1 for the verbose console lines
ZX_NEXT_UNITE_ESP_PRIORITY The registration priority (default −100)

Next to UARTReplacement

If you also use UARTReplacement with a USB ESP module, leave it installed. With both DLLs in the CSpect folder, the Settings box chooses:

RS232 ESP Emulation (CSpect) The Next's ESP is…
ticked the emulated one — UARTRS232 answers first, your real module rests. The log says so.
unticked the real one — UARTRS232 does nothing and UARTReplacement works as always

Checking that it works

  1. Tick the box, load an image, launch CSpect.
  2. In the SD Card log window look for “RS232 ESP: CSpect uses the RS232 ESP emulation on port … through the UARTRS232 plugin”.
  3. On the Next, run .sync5 -L with the Remote Explorer listening: the Next appears as a session and you can browse its card.

With verbose mode on, the same log shows the Next's AT commands as they arrive (RS232 ESP: command: AT+CIPSTART=…) — the proof the bytes go through the emulation.

Troubleshooting

The plugin says what it decided in its first line on CSpect's console, and the app copies CSpect's output into its log file (zx-next-unite.log):

Line Meaning
UARTRS232 1.0.0 active - the Next's ESP UART goes to the ESP emulation at 127.0.0.1:2222 (…) Working. The reason in brackets says who decided (the app, the cfg file, or an emulation that answered).
… inactive - ZX_NEXT_UNITE_ESP says off The app launched CSpect with the Settings box unticked.
… inactive - no ESP emulation answers at 127.0.0.1:2222 … CSpect was started by hand and nothing was listening. Start the emulation first, or launch CSpect from the app.
… inactive - CSpect was started with -com, the serial port keeps the UART A real serial port was asked for.
… inactive - the UARTReplacement plugin is installed beside it … Started by hand next to UARTReplacement: the real module keeps the UART. Launch from the app with the box ticked to use the emulated one.
no ESP emulation at … - the Next sees no ESP until one answers; still trying The emulation stopped (the app was closed?). The plugin reconnects by itself when it is back.
Symptom Try this
The Next says there is no ESP Is the box ticked, and was CSpect launched from the app? Check the first plugin line above.
“RS232 ESP emulation could not start (port … in use?)” Another program holds the port. Change Port in Settings.
The Next connects but to the wrong place The Next dials the server address stored on its card (.sync5 <PC ip>); the emulation only carries the connection.
The plugin was not installed The CSpect folder is read-only, or CSpect was not found by the app. The log names the folder and the reason.
You use -com on purpose Then the emulation is not used; remove -com from the launch parameters to use it.

What was tested, and what was not

Tested on Windows 11 with CSpect 3.3.1 and 4.5.1: megabyte file round trips byte-identical in both directions, the Next's own CRC-32 matching the PC's, with .sync5 5.7.5 and 5.9.14 at -f and ZX Next Remote 1.8.0 at “Fast”; the emulation stopped and restarted under a live session; and, on CSpect 3.3.1, UARTReplacement v1.8 installed in the same folder.

Not tested: CSpect under Mono (Linux, macOS). Nothing in the plugin is Windows-only, but it has not been run there yet — reports are welcome.

Building it from source

You do not need to: the app carries the built plugin. For the curious, the source is one C# file in extra/UARTRS232, built with the compiler that ships with Windows (no SDK):

python extra/UARTRS232/build_plugin.py

Its README explains what the plugin does to the machine, port by port.


See also: Settings → Emulators · SD Card Utility → Launching an emulator · NextSync · itch.io tab · Installation → CSpect emulator

Clone this wiki locally