modemu2k 0.2.5
Library that provides telnet capability to a comm program
Loading...
Searching...
No Matches
modemu2k

C/C++ CI BSD

modemu2k

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

The App

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.

Install with Homebrew

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

Build

meson setup builddir
ninja -C builddir

Run 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.

Usage

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.

BBS Related

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).

Acknowledgments

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_buffer mirrors CURLOPT_ERRORBUFFER), strerror-style code-to-message helper, log-callback pattern (CURLOPT_DEBUGFUNCTION), and the blocking/non-blocking split between m2k_run and m2k_step (curl's easy vs. multi interfaces).
  • libuv / libcurl / libssh2M2K_API visibility/export macro (mirrors UV_EXTERN / CURL_EXTERN / LIBSSH2_API) for Windows DLL support and ELF visibility hardening.
  • SQLite / libssh2 — versioned header (macros)
  • libssh2M2K_ERR_WOULDBLOCK return code for non-blocking flow control (mirrors LIBSSH2_ERROR_EAGAIN), distinguishing flow-control from hard errors.