Hayes-style AT-command modem emulator bridging a serial-style interface to TCP/Telnet ("dials" out and answers incoming connections). It ships as a C library (libmodemu2k) exposing the modem state machine, plus a small CLI built on top that allocates a PTY and either reads stdin/stdout directly, forks a comm program (minicom, picocom) on the slave, or accepts an incoming TCP connection as the TTY. IPv4 and IPv6.
It is based on modemu, originally developed by Toru Egashira (1995–1996).
Maintainer: Andy Alt
License: GNU GPL 2 or later
This project includes modemu2k, a small command-line program that fills in
for the dialup modem that classic terminal programs like minicom and picocom
were originally written to talk to. You can run modemu2k, point your terminal
program at it, and type the same ATD"bbs.example.com" commands you'd have
typed in the 1990s — except modemu2k turns each "dial" command into a network
(TCP/telnet) connection instead of dialing a phone number. The classic comm
program thinks it's still talking to a real modem; you're actually reaching
today's BBSes over the internet. Works on Linux and BSD, with IPv4 and IPv6.
This repository is also a Homebrew tap, for macOS and Linuxbrew:
brew tap theimpossibleastronaut/modemu2k https://github.com/theimpossibleastronaut/modemu2k
brew trust theimpossibleastronaut/modemu2k
brew install modemu2k
Homebrew does not load formulas from a third-party tap until you mark
the tap as trusted. That is what the brew trust line does.
Homebrew builds modemu2k from source. On macOS, it gives a telnet BBS to
software that can only talk to a modem. Run modemu2k -s to print the
pty, then point the emulator at it:
- QEMU or UTM, with
-serial pty - 86Box, with serial passthrough
- VICE, with userport RS232
meson setup builddir
ninja -C builddirRun meson configure builddir to see extra options.
ninja install is optional. The m2k-minicom / m2k-picocom
wrapper scripts are not installed by default; pass
-Dhelper-scripts=true to opt in.
See QUICKSTART.md for the actual how-to: standalone
mode, running under minicom, listen mode, the binary-mode toggle for
file transfers, escaping with +++, and quitting cleanly.
The modemu2k(1) man page has the full option and AT-command reference.
Some BBSes may also be capable of ssh or other protocols; look them up in your browser if you would like more info (many have a www portal).
- The Rusty Mailbox — trmb.ca 2030
- Synchronet BBS List — a directory of currently-reachable telnet BBSes
- The BBS Corner
Several library-API conventions in modemu2k.h are modeled after
mature C libraries — the patterns, not the code:
- libcurl — caller-supplied detailed
error buffer (
m2k_set_error_buffermirrorsCURLOPT_ERRORBUFFER),strerror-style code-to-message helper, log-callback pattern (CURLOPT_DEBUGFUNCTION), and the blocking/non-blocking split betweenm2k_runandm2k_step(curl's easy vs. multi interfaces). - libuv / libcurl /
libssh2 —
M2K_APIvisibility/export macro (mirrorsUV_EXTERN/CURL_EXTERN/LIBSSH2_API) for Windows DLL support and ELF visibility hardening. - SQLite /
libssh2 — versioned header (macros)
- runtime
m2k_version()for header/library skew detection.
- runtime
- libssh2 —
M2K_ERR_WOULDBLOCKreturn code for non-blocking flow control (mirrorsLIBSSH2_ERROR_EAGAIN), distinguishing flow-control from hard errors.