Mercury — HERMES HF Modem
Mercury is part of the HERMES project (High-Frequency Emergency and Rural Multimedia Exchange System) by Rhizomatica, funded by ARDC and others.
Mercury is a software modem for sending email, files and messages over HF radio — the kind of link you have when there is no internet, no phone network and no power grid worth speaking of.
Start here: Getting Started · Graphical interfaces · Configuration · Docs · Mailing list · Google Play (Android) · App Store (iPhone, iPad, Mac)
Help wanted: Apple hardware. We build and test the macOS and iOS apps in a macOS virtual machine on an Intel PC, so we have never run the arm64 builds on real Apple hardware with a radio ourselves. Any ARM64 Apple device helps: an Apple Silicon Mac (M1 or later), an iPhone or an iPad, and any donation is welcome. Please write to the mailing list or open an issue.
What this software does
Mercury turns a single-sideband radio into a data link. It handles the waveform, the error correction, the retransmissions and the radio keying, and presents the result to your application as an ordinary TCP connection.
- ARQ data link for point-to-point sessions — a connect/accept handshake, an erasure-coded "carousel" that the receiver drives (Reed-Solomon blocks, so a lost frame is replaced by any other frame of the block rather than resent), and a controlled disconnect, so a file either arrives intact or you are told it did not.
- Adaptive speed — each direction runs on one of seven rungs of its bandwidth's ladder; at BW2300, from the 32-tone MFSK floor through MFSK2K, DATAC4, DATAC3, DATAC1 and DATAC17 up to QAM16C2 (BW500 and BW2750 ladders: docs/MODES.md). It starts on the rung the connect's SNR supports and moves on measured delivery. Control frames ride DATAC16 (and MFSK, or tone patterns, at the floor), so signalling survives when payload cannot.
- Broadcast mode alongside ARQ, with its own framing and TCP ingress port — used for one-to-many traffic and for Reticulum mesh networking.
- VARA-style TCP TNC interface on two sockets (control on the base port, data on base+1), speaking
MYCALL,LISTEN,CONNECT,BUFFER,SN,BITRATE,TUNE(a 1 kHz ATU tuning carrier with a hard 60 s unkey timer) andMONITOR(a passive VARA-style monitor that decodes every mode). Existing VARA-aware software can generally talk to Mercury unchanged. - Runs on the audio hardware you have —
alsa,pulse,oss,coreaudio,aaudio,dsound,wasapi,rtp(to hermes-radio-daemon),hl2(a Hermes-Lite 2 on the network, with no sound card or CAT), plusshm,null,fifoandsockfor embedded and test use. - Keys the radio for you via Hamlib, serial RTS (including DigiRig), or the HERMES shared-memory interface — or stays out of the way and lets your client do it.
Mercury runs on Linux, Windows and macOS, including Raspberry Pi.
On-air compatibility. 1.9.27 connects to 1.9.27 only: it puts a new
mode, PSK3, at rung 2 (connect minor 3), so it refuses 1.9.26 and older, in
either direction, and logs why. 1.9.26 and 1.9.25 connect to each other,
and refuse 1.9.24 and older: their ladders' levels mean other modes. 1.9.20 to 1.9.24 (the "2.0" architecture)
connect to each other, but not to 1.9.19 or older: their connect frames have
a packet type of their own (and 1.9.18 and 1.9.19 did not connect to each
other either). A station with mfsk_tx_only set needs 1.9.21 or later at
the other end. See
docs/RELEASE-1.9.27.md,
docs/RELEASE-1.9.26.md,
docs/RELEASE-1.9.25.md,
docs/RELEASE-1.9.24.md,
docs/RELEASE-1.9.23.md,
docs/RELEASE-1.9.22.md,
docs/RELEASE-1.9.21.md,
docs/RELEASE-1.9.20.md,
docs/RELEASE-1.9.19.md and
docs/UPGRADING-TO-1.9.18.md before upgrading.
Command-line reference
Most settings live in mercury.ini (see Configuration File);
command-line flags override it. Run ./mercury -h for this list at any time.
All command-line options (click to expand)
Usage modes:
./mercury -m [mode_index] -i [device] -o [device] -x [sound_system] -p [arq_tcp_base_port] -b [broadcast_tcp_port] -f [freedv_verbosity] -H [hamlib_log_level] -k [rx_input_channel] [-P ptt_method] [-A ptt_device] [-G] [-T] [-U ui_port] [-W] [-d]
./mercury [-h -l -z -K -Q -V]
Options:
-c [cpu_nr] Run on CPU [cpu_nr]. Use -1 to disable CPU selection, which is the default.
-m [mode_index] Startup payload mode index shown in "-l" output. Used for broadcast and idle/disconnected ARQ decode. Default is 1 (DATAC3)
-s [mode_index] Legacy alias for -m.
-f [freedv_verbosity] FreeDV modem verbosity level (0..3). Default is 0.
-H [hamlib_log_level] Hamlib radio log level (0..6). Default is 0.
-k [rx_input_channel] Capture input channel: left, right, or stereo. Default is left.
-i [device] Radio Capture device id (eg: "plughw:0,0").
-o [device] Radio Playback device id (eg: "plughw:0,0").
-x [sound_system] Sets the sound system or IO API to use: alsa, pulse, oss, coreaudio, aaudio, dsound, wasapi, hl2, shm, rtp, null, fifo or sock. Default is alsa on Linux, dsound on Windows.
null, fifo and sock are developer/test backends; fifo uses raw s32le PCM at 8 kHz via -i/-o paths; sock is a framed, virtual-clock lockstep transport (MERCURY_AUDIO_SOCK=<path>).
rtp exchanges the radio signal with hermes-radio-daemon as RTP multicast: -i <rx group>[,iface] (default 239.255.72.1,lo), -o <tx group> (default 239.255.72.2); PTT travels in the TX stream.
hl2 uses a Hermes-Lite 2 on the network as radio and sound card: -i auto (the first that answers a broadcast) or -i <host>[:port]; set its frequency with -F (or [hl2] in the INI).
-F [frequency_hz] Hermes-Lite 2 (-x hl2) dial frequency in Hz, upper sideband. Without one it receives but never transmits.
-p [arq_tcp_base_port] Sets the ARQ TCP base port (control is base_port, data is base_port + 1). Default is 8300.
-b [broadcast_tcp_port] Sets the broadcast TCP port. Default is 8100.
-U [ui_port] Sets the UI port (WebSocket port). Default is 10000. Requires -G.
-W Disable waterfall/spectrum data sent to the UI (used to spare CPU). Requires -G.
-G Enable UI communication (WebSocket server for mercury-qt). Off by default.
-T Use WSS (WebSocket Secure/TLS) for UI communication. Requires -G. Default uses plain WS (no TLS).
-l Lists all modulator/coding modes.
-z Lists all available sound cards.
-v Verbose mode. Prints more information during execution.
-d Trace mode. Logs the raw bytes of every decoded connect frame (implies -v).
-L <path> Write log to file (TIMING level and above). Windows default: logs\mercury_engine.log beside mercury.exe.
-J Use JSONL format for log file (requires -L).
-P [ptt_method] PTT method: none, hamlib, serial, cm108, hermes_shm, or gpio.
-R [radio_model] Sets HAMLIB radio model and selects Hamlib PTT.
-A [ptt_device] PTT serial device or HAMLIB device/ip:port endpoint.
-S Select HERMES shared-memory PTT (Linux shorthand for -P hermes_shm).
-C [config_file] Path to init configuration file (INI format). Default is mercury.ini in the current
directory, else $XDG_CONFIG_HOME/mercury/mercury.ini (~/.config/mercury/mercury.ini),
else /etc/mercury/mercury.ini. A file that is there but cannot be read in full
stops the modem.
-K List HAMLIB supported radio models.
-Q Test PTT: key the configured backend for one second, release it, and exit.
-t Test TX mode.
-r Test RX mode.
-V Print version information and exit.
-h Prints this help.
Mode behavior notes:
-m/-ssets the mode for broadcast, for the test modes, and for what the payload decoder listens on while no ARQ session is up. It does not affect an ARQ session.mercury -llists the indices: 0 DATAC1, 1 DATAC3, 2 DATAC0, 3 DATAC4, 4 DATAC13, 5 DATAC14, 6 FSK_LDPC, 7 DATAC15, 8 DATAC16, 9 DATAC17, 10 QAM16C2, 11 MFSK, 12 MFSK500, 13 DATAC17W, 14 QAM16C2W, 15 DATAN1, 16 QAM16N1, 17 QAM16N2, 18 MFSK2K.- During an ARQ session, control frames normally use DATAC16, and each direction's payload runs on the rungs of the session's bandwidth: at BW2300 MFSK (MFSK500 on the deep floor), MFSK2K, DATAC4, DATAC3, DATAC1, DATAC17, QAM16C2; the BW500 and BW2750 ladders are in docs/MODES.md. The start rung comes from the SNR measured on the connect; see docs/CAROUSEL-ARQ.md.
- VARA
BW500keeps the link narrow. The negotiated bandwidth selects one of the three seven-rung payload ladders. CALLadvertises the local BW token andACCEPTreturns the negotiated session token. If either side usesBW500, the link stays narrow;BW2750is preserved inCONNECTED ... BWonly when both peers advertise it.FSK_LDPCis currently experimental (mainly for lab/test usage), may have longer decode/sync latency depending on setup, and is not recommended for production links yet.[arq] mfsk_tx_only = truemakes the station transmit MFSK only (CALL/ACCEPT, control and payload) for radios that can only key FSK — the QRP Labs QDX, QRPguys AFSK III and similar. Its peers keep its transmit direction on the MFSK floor rung for the whole session; receive is unaffected, so the cost is throughput, not reach. Such a station connects only to releases after 1.9.20; the others still connect to 1.9.20.[arq] max_keydown_s = 16holds every transmission of the station to 16 s, a poll sent before a round included, for TCP clients that abort when PTT stays on too long. vARIM 1.13 and later need no setting: they allow 35 s keyed, longer than any Mercury transmission (30 s at most). vARIM before 1.13 gives up after about 20 s keyed, and a full DATAC3 round is 25-30 s (#445). With such a vARIM, set it on every station that runs it: it holds the station's own transmissions and asks the peer for short rounds, but a peer without it can still key longer (a poll before a round, its own floor rounds). The peer needs no update to talk to it. The cost is throughput: in the simulator, about 0-6 % on fast channels and 13-30 % on slow ones and at BW500 (8 KB both ways).0, the default, keeps the protocol's 30 s; the MFSK floor's single frame (13.5 s, 27 s on the BW500 floor) is never split, so a BW500 session that falls to its floor still keys for 27 s.
PTT control notes:
- The default method is
none; Mercury then leaves radio keying to the TCP client. -P serial -A COM7(or a POSIX device such as/dev/ttyUSB0) keys a serial modem-control line. No baud rate is used. Which line, and whether it is inverted, comes from[ptt] lineand[ptt] invert— RTS non-inverted by default.-P cm108keys a GPIO pin on a CM108/CM119-class USB sound chip. The device is auto-detected;[ptt] cm108_gpioselects the pin (default 3).-P gpiokeys a Raspberry Pi GPIO line through libgpiod 2.x (Linux; built in whenpkg-configfinds libgpiod >= 2.0, so Raspberry Pi OS / Debian Trixie withlibgpiod-dev).[ptt] gpio_chip,gpio_line(the BCM number, not the header pin: GPIO17 is pin 11) andgpio_invertselect it. A build without libgpiod refuses-P gpioat start.-Ris the compatible Hamlib shorthand: it selects the model and thehamlibPTT method.-Asupplies its device orip:port, and-Klists models.-Sis the compatible shorthand forhermes_shmand is unavailable on Windows builds.-Qopens the configured backend, keys it for one second, releases it, and exits without starting the modem or audio devices. For example:mercury -C mercury.ini -Q.
Sound card notes:
- A capture device that stops delivering audio is reopened every 2 s. After three reopens in a row that bring nothing (about 6 s, not counting the time Mercury is transmitting), Mercury logs
the capture device delivers no audioonce and reports the audio as failed (audio_ok: falsein the GUI and the WebSocket status) until samples come back. When they do, the log says how long the station was deaf:capture delivering again after reopen #N (S s without audio). - When it reports the failure, and on every 5th reopen after that, Mercury also lists the sound cards again and looks for the device by the name it had when capture started. Windows can give a USB codec a new id, under the same name, when it resets or is re-plugged. If exactly one device has that name, Mercury opens it under its new id (
listed under a new id: ... -- opening that). If two have it (two radios with the same codec), Mercury does not guess, and asks you to select it again. The default device (no-i) is left to the sound system. - The same at start, on Windows (
wasapi,dsound): when you choose the devices in the GUI, their names are saved next to their ids (input_device_name,output_device_nameinmercury.ini). If a saved id is no longer listed when Mercury starts, the device with that exact name is used, if exactly one has it (device id '...' is gone; found '...' by its saved name).-iand-oon the command line drop the saved name. A config without the names works as before. - A playback device that takes no audio for 1 s while Mercury has audio to send is reopened, and what was queued meanwhile is dropped, so later transmissions stay inside their PTT. After three reopens in a row that bring nothing, the GUI shows
playback: the playback device takes no audio (still trying it). - PulseAudio (
-x pulse): if a transmission after a long idle spell keys the radio but sends no audio (seen with a USB card on PipeWire, issue #591), set[audio] pulse_keepalive = true. Mercury then feeds the playback stream with silence between transmissions, as VARA and WSJT-X do. It is off by default: it costs a little CPU while idle and keeps the card from suspending.
Transmit level and power notes:
- Since 1.9.25 every mode peaks at about −2 dBFS: the OFDM modes at −2.0 dBFS and MFSK at −2.5 dBFS, measured at the sound card with
tx_gain_dbat 0 (1.9.24 peaked at −6 dBFS).[audio] tx_gain_dbtrims around that level, and-4gives back the 1.9.24 drive.TUNE <dBFS>keys a steady 1 kHz tone at an absolute level thattx_gain_dbdoesn't touch.TUNE -2therefore shows the RF power your frames peak at. - sBitx (hermes-radio-daemon): the power setting is the share of the PA's output for a full-scale signal, so Mercury's frames now get most of what the setting allows. An ARQ session keys often (about 25 transmissions in 10 minutes), so a PA run near saturation gets hot. Start low (20-40 %), and read the real output while keyed with
sbitx_client -c get_fwd(watts × 10) andget_ref(SWR × 10), or during aTUNE -2. Raise the setting only while the radio stays cool. One field sBitx V3 saturated at about 10-14 W and ran hot at 85 % in a long A/B. - Radios with ALC on a USB sound card (IC-7100 and most transceivers): set the radio's power, and let the ALC level the audio. OFDM frames, whose peaks sit 7-8 dB above their mean, kept an IC-7100's ALC around 0.88 of its range. The short MFSK frames (CALLs, acknowledgements) reached the top of it: a constant-envelope signal carries more average power for the same peak. If the ALC is pinned on those, lower the drive with
tx_gain_db -2, or with the radio's USB modulation level. - Radios without ALC on a sound card (uBitx and similar): more drive past the PA's linear range gives a weaker, wider signal, not a stronger one. Find the knee with a
TUNEsweep at increasing dBFS, measured at the other station or on an SDR. One uBitx gave its strongest tone atTUNE -20(with its sound card's Master at −5 dB) and dropped, splattering, above it. Then set the sound card's playback level, ortx_gain_db, so that Mercury's −2 dBFS peaks land at the knee.
Getting Started with Mercury
Compile and Install from Git repository on Linux
-
Install the dependencies:
sudo apt-get update && sudo apt-get install build-essential pkg-config libasound2-dev libpulse-dev libhamlib-dev make git -
Clone Mercury GitHub repository:
git clone https://github.com/Rhizomatica/mercury.git
-
Change directory to
mercury/: -
Build mercury (edit
config.mkfirst if you need a custom compiler or flags; defaults are fine for most): -
Install system-wide:
The FreeDV codec is vendored in-tree — no external FreeDV or codec2 packages are needed.
Build targets
| Target | Description |
|---|---|
make / make all |
Build the standalone CLI mercury binary |
make libmercury_core.a |
Compile all Mercury C objects into a host-arch static library (used by fyne-ui) |
make fyne-ui |
Build the single-binary native GUI (mercury-ui), embedding the engine via CGo. Requires make libmercury_core.a first. Needs Go (setup). |
make libmercury_core_w64.a |
Cross-compile Mercury C objects for Windows x64 (requires gcc-mingw-w64-x86-64) |
make fyne-ui-windows |
Cross-compile the single-binary GUI to mercury-ui.exe. Depends on libmercury_core_w64.a. Needs Go (setup). |
make windows-installer |
Full Windows installer pipeline: cross-compile engine + GUI, copy DLLs, patch config. Output goes to windows-installer/. Requires MinGW + Go. |
make windows-zip |
Build standalone CLI + GUI Windows binaries and zip them for distribution |
make fyne-ui-macos |
Package Mercury.app for the host architecture (run on macOS). Needs Go + the fyne CLI (setup). |
make fyne-ui-macos-dmg |
Wrap the host-arch Mercury.app in a drag-to-install Mercury.dmg at the repo top level. Needs Go + the fyne CLI (setup). |
make fyne-ui-macos-universal-dmg |
Distribution build: universal (x86_64 + arm64) Mercury.app wrapped in Mercury.dmg at the repo top level. This is the artifact for the website. Needs Go + the fyne CLI (setup). |
make fyne-ui-macos-appstore-pkg |
Mac App Store build: the universal Mercury.app for macOS 15.0+, sandboxed (macos/entitlements-appstore.plist), signed with MACOS_APPSTORE_IDENTITY and the profile in MACOS_APPSTORE_PROFILE, in an installer package signed with MACOS_INSTALLER_IDENTITY, for upload to App Store Connect. |
make test |
Build and run the C unit and simulator tests (tests/). |
make integration-test |
Run the Go two-daemon integration tests (tests/integration); make integration-test-random uses a fresh channel seed. |
make tla-quick |
Run TLC on the TLA+ models' quick configurations (specs/tlc.list, a few minutes) and check each result against its README: no error, or the invariant a mutant must break. Needs java and tla2tools.jar (TLA2TOOLS=...). |
make tla |
The same for every configuration, the long ones included (hours). TLA_ONLY=turns/ runs one directory, or any lines of specs/tlc.list that contain the text; a configuration that is never exhausted (class huge) runs only when TLA_ONLY names it exactly. |
Build options
Passed on the make command line, e.g. make HAVE_HAMLIB=0.
| Option | Effect |
|---|---|
HAVE_HAMLIB=0 |
Build without Hamlib. Drops the libhamlib-dev build dependency entirely; -P hamlib, -R and -K are compiled out and report "HAMLIB support not compiled in". The serial/RTS, CM108 and HERMES shared-memory PTT backends are unaffected, so the radio can still be keyed. |
HAVE_HIDAPI=0 |
Build without hidapi. The CM108 GPIO PTT backend then talks to /dev/hidraw directly, which works on Linux only. |
Both are auto-detected with pkg-config when not set, so the default build
picks them up if they are installed. Set them to 0 to opt out.
If the build fails on hamlib/rig.h: No such file or directory while
libhamlib-dev is installed, the package's headers are missing or broken —
Mercury only enables Hamlib when pkg-config --exists hamlib succeeds, so
pkg-config is finding the .pc file but the headers it points at are not
there. Either reinstall the package (sudo apt reinstall libhamlib-dev) or
build without it using HAVE_HAMLIB=0.
Build the Fyne GUI (Linux)
sudo apt install golang-go pkg-config libhamlib-dev libpulse-dev libasound2-dev libssl-dev libhidapi-dev \
libgl1-mesa-dev libegl1-mesa-dev xorg-dev libwayland-dev libxkbcommon-dev
make fyne-ui
./mercury-uiBuild the Android .apk or .aab (technology preview)
# Android NDK r27d, the Android SDK (platform 34, build-tools 34) and Go. # The Makefile builds its own copy of the fyne CLI, at Android 8 (API 26) # as the minimum (.fyne-android/). T=$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin make fyne-ui-android ANDROID_NDK_HOME=$ANDROID_NDK_HOME ANDROID_HOME=$ANDROID_HOME \ CC=$T/aarch64-linux-android26-clang AR=$T/llvm-ar # -> Mercury-<version>.apk (arm64, debug-signed; ANDROID_RELEASE=1 with # ANDROID_KEYSTORE signs it with a release key) # For Google Play: bundletool on PATH, and the Play upload key make fyne-ui-android-aab ANDROID_UPLOAD_KEYSTORE=upload.jks ... # same NDK settings # -> Mercury-<version>.aab (target SDK 36), the password in ANDROID_UPLOAD_KEYSTORE_PASS
The GUI with the modem inside, on AAudio, with a vendored Hamlib
(radio_io/hamlib-android) that drives the radio's USB-serial chip itself
(Radio, method Hamlib, "Direct USB, no driver (experimental)").
Build for iOS (technology preview)
On a Mac with Xcode:
make fyne-ui-ios-ipa CC="xcrun -sdk iphoneos clang -arch arm64 -miphoneos-version-min=17.0" # -> Mercury-<version>-ios-sideload.ipa, signed ad hoc (SideStore, AltStore Classic) # With IOS_SIGN_IDENTITY and IOS_PROFILE it is the App Store Connect build # (AltStore PAL): see ios/ALTSTORE.md.
Cross-compile the Windows installer (from Linux)
sudo apt install golang-go gcc-mingw-w64-x86-64 mingw-w64-x86-64-dev make windows-installer # → windows-installer/ contains mercury-ui.exe + DLLs + mercury.ini # Use Inno Setup Compiler on Windows to build the .exe installer from installer.iss
GUI build prerequisites (Go + fyne)
The GUI modules require Go 1.26.9. Debian 13's golang-go is 1.24; with
it, go fetches the 1.26.9 toolchain on first use (GOTOOLCHAIN=auto, the
default), or set GOTOOLCHAIN=go1.26.9 to make that explicit, as CI does.
Every fyne-ui* target builds a Go program, so Go is required — the CLI
mercury binary needs none of this. The macOS packaging targets additionally
need the fyne command-line tool:
# Go: https://go.dev/dl/ (or `brew install go` on macOS, `apt install golang` on Debian) go install fyne.io/tools/cmd/fyne@latest # `go install` drops binaries in $(go env GOPATH)/bin, which is NOT on PATH by # default. Without this you get: error: 'fyne' not found export PATH="$PATH:$(go env GOPATH)/bin" # add to ~/.zshrc or ~/.bash_profile
Check both are visible before building:
go version && fyne versionBuild the macOS app for distribution (universal .dmg)
Run on macOS. This produces the self-contained, universal (Intel + Apple
Silicon) Mercury.dmg used for the website — hamlib and libusb are vendored as
static universal libraries in-tree, so no Homebrew dependencies are needed at
build or run time.
# one-time tools: brew install go go install fyne.io/tools/cmd/fyne@latest export PATH="$PATH:$HOME/go/bin" # so `fyne` is on PATH (add to ~/.bash_profile) make fyne-ui-macos-universal-dmg # → ./Mercury.dmg (universal: x86_64 + arm64)
The finished Mercury.dmg lands at the repository top level. A local build is
unsigned, so on first launch Gatekeeper warns — right-click the app →
Open to run it (the released .dmg is signed and notarized by the release
workflow). For a quick host-architecture-only build use
make fyne-ui-macos-dmg (also emits ./Mercury.dmg).
Install via Debian package on Linux
For now just Debian 13 (Trixie) packages are built, for both arm64 (works on both RaspberryPi OS and Debian) and amd64.
-
Install the repository certificate:
wget --no-check-certificate -qO- https://debian.hermes.radio/hermes/hermes.key | gpg --dearmor -o - | sudo tee /etc/apt/trusted.gpg.d/hermes.gpg > /dev/null
-
Add mercury to the sources list (change it for your current architecture):
ARM64:
echo 'deb [arch=arm64] http://debian.hermes.radio/hermes trixie main' | sudo tee /etc/apt/sources.list.d/hermes.list
AMD64:
echo 'deb [arch=amd64] http://debian.hermes.radio/hermes trixie main' | sudo tee /etc/apt/sources.list.d/hermes.list
-
Update the Debian packages:
-
Install mercury:
sudo apt-get install mercury
Note: Installation via Debian package requires Debian 13 (Trixie)
Install on Windows
Via installer (recommended): Download the Mercury_HF_Modem_Setup.exe from the releases page, run it, and the single-binary GUI (mercury-ui.exe) will be installed. The GUI launches the Mercury engine in-process — no separate backend needed. Desktop and Start Menu shortcuts are created automatically.
Via ZIP: Download the ZIP package from the releases page, extract it, and run mercury-ui.exe for the GUI or mercury.exe for the headless CLI.
Install on macOS
Download Mercury-<version>-universal.dmg from the
releases page, open it, and
drag Mercury into Applications. The build is universal (runs natively
on Intel and Apple Silicon) and self-contained (no Homebrew needed). It is
signed with a Developer ID certificate and notarized by Apple, so it opens
like any other app.
Install on Android (technology preview)
You need a 64-bit ARM phone or tablet (almost every Android device since 2017) with Android 11 or later; it was tested on Android 15.
From Google Play. Install Mercury HF Modem on the phone or tablet. It is free, and updates arrive through Google Play. Then go on from step 3 below.
From the releases page.
- On the phone, open the
releases page and
download
Mercury-<version>-android-arm64.apk. - Open the downloaded file. Android asks whether to allow installs from that app (your browser or file manager): allow it, go back, and tap Install.
- Open Mercury and allow it to record audio: that is how it hears the radio. Connect the radio with a USB-OTG adapter. When Android asks whether Mercury may use the USB device, allow it.
- In Soundcards, pick the radio's USB sound card (an Icom shows "USB Audio CODEC (USB)").
- For CAT and PTT over the radio's own USB cable: Radio, method Hamlib, "Direct USB, no driver (experimental)". It works with Silicon Labs CP210x chips: Icom IC-7100 and IC-7300, Yaesu FT-710, and many cables.
Keep Mercury on screen while you use it: it does not run in the background yet. Later releases install over this one, because they are signed with the same key. A build signed with another key has to be uninstalled first.
Install on macOS
From the Mac App Store. Install
Mercury HF Modem
on macOS 15 or later. It is free, and updates arrive through the App
Store. Or download the signed and notarized .dmg from the
releases page.
Install on iOS (technology preview)
From the App Store. Install Mercury HF Modem on the iPhone or iPad. It is free, in every App Store country except mainland China, and updates arrive through the App Store.
With AltStore PAL (EU, Brazil and Japan). Mercury is notarized by Apple and published as an AltStore PAL source. Updates arrive through AltStore.
-
On the iPhone or iPad, open altstore.io in Safari and install AltStore PAL as it describes. It is an alternative app marketplace, so it is not in Apple's App Store. You need version 2.2 or later.
-
In AltStore PAL, open the Sources tab, tap +, and enter
https://rhizomatica.github.io/mercury/altstore/source.json -
Mercury appears in the Browse tab: install it from there.
Mercury needs iOS 17 or later.
Anywhere else, with SideStore or AltStore Classic. Download
Mercury-<version>-ios-sideload.ipa from the
releases page and
open it with SideStore or
AltStore Classic. They sign it with your own Apple
ID, and with a free Apple ID the app has to be refreshed every 7 days.
How a version is published to AltStore PAL: ios/ALTSTORE.md.
Install on Sailfish OS (technology preview)
You need a 64-bit ARM (aarch64) phone with Sailfish OS 5. There are two packages, built and tested on a Jolla phone with Sailfish OS 5.2; neither has been used with a radio there yet (see below):
mercury, the command-line modem.-Gserves the WebSocket UI as on Linux.mercury-ui, the GUI (Fyne, on Wayland with GLES2 through libhybris), with the modem built in: it does not need themercurypackage. It is in the app list as Mercury.
The repository carries the releases, from 1.9.23 (pkcon refresh && pkcon update moves an install of the earlier 1.9.22+git… snapshot to it).
-
Turn on Developer mode (Settings → Developer tools), open Terminal, and become root with
devel-su. -
Add the HERMES repository and install Mercury, the GUI, or both:
ssu ar hermes http://debian.hermes.radio/sailfish/aarch64/ pkcon refresh pkcon install mercury # the command-line modem pkcon install mercury-ui # the GUI
This also installs HERMES's Hamlib 5, which can drive a radio's USB serial chip without a kernel driver. alsa-lib, pulseaudio-libs and openssl come from the Jolla repositories. The repository is plain HTTP and its packages are not signed: their checksums are in
http://debian.hermes.radio/sailfish/SHA256SUMS. To check one, download it, comparesha256sum, and install it withpkcon install-local(Hamlib still has to come from the repository). -
Copy the example configuration and edit it:
mkdir -p ~/.config/mercury cp /usr/share/doc/mercury/mercury.ini.example ~/.config/mercury/mercury.ini
Mercury also reads
./mercury.iniand/etc/mercury/mercury.ini(see-C). The package installs/usr/bin/mercuryand its man page, but no service: start it yourself.The GUI starts from its icon, as your user, with its audio through PulseAudio (
mercury-ui -x pulse). Opening a radio's USB CAT needs root (below), so from the icon it has audio but no CAT or PTT yet.
Using it with a radio (untested with Mercury). These are the settings the HERMES radio daemon uses on the same phone:
- Audio: ALSA (
sound_system = alsa). For a radio's USB codec,input_device = hw:CARD=Device,DEV=0, butoutput_device = plughw:CARD=Device,DEV=0, because the codec only plays stereo.mercury -zlists the cards. - CAT and PTT: the Jolla kernel has no CP210x driver, so use Hamlib's
user-space USB path as the device, and run Mercury as root:
[ptt] method = hamlib, thenhamlib_model = 3070withdevice = "usb:10c4:ea60:<serial>"for an IC-7100 (its CI-V port is the serial ending inA, e.g."usb:10c4:ea60:IC-7100 02010347 A": quote it, it has spaces), orhamlib_model = 1049,device = "usb:10c4:ea70:<serial>"andhamlib_serial_speed = 38400(the radio's CAT RATE) for an FT-710. The phone has no udev rule for USB devices, so only root can open them. - Sleep: Sailfish suspends the phone when the screen is off, and that
breaks USB audio. Hold a wake lock while Mercury runs
(
echo mercury > /sys/power/wake_lock, as root) and release it after (echo mercury > /sys/power/wake_unlock).
Building the package yourself. It builds on the phone itself with
rpmbuild; no Sailfish SDK is needed. The spec is
sailfish/mercury.spec, and every release's
source archive carries its own copy, with that release's version and commit
filled in. It builds with make MERCURY_HOST=standalone and runs
make test (about 4 minutes on the phone). It was built on a phone that
already had the tools for the other HERMES packages, so the list below may
miss something on a fresh one. With the HERMES repository added (step 2),
install the build dependencies as root:
# hamlib-devel comes from the HERMES repository, the rest from Jolla's
pkcon install rpm-build gcc-c++ make hamlib-devel alsa-lib-devel pulseaudio-devel openssl-develThen leave devel-su and build as the normal user:
v=1.9.27 # the release to build (1.9.22 and older have no sailfish/) mkdir -p ~/rpmbuild/SOURCES ~/rpmbuild/SPECS curl -fsSL -o ~/rpmbuild/SOURCES/mercury-$v.tar.gz \ https://github.com/Rhizomatica/mercury/archive/refs/tags/v$v.tar.gz cd ~/rpmbuild/SOURCES tar -xzf mercury-$v.tar.gz -O mercury-$v/sailfish/mercury.spec > ../SPECS/mercury.spec # Sailfish's busybox xargs breaks a default rpm step: this file leaves it out # (radiod's build installs the same one; an existing file is kept) [ -f ~/.rpmmacros ] || tar -xzf mercury-$v.tar.gz -O mercury-$v/sailfish/rpmmacros > ~/.rpmmacros rpmbuild -ba ../SPECS/mercury.spec # -> ~/rpmbuild/RPMS/aarch64/mercury-<version>-1.aarch64.rpm
Install that file as root with pkcon install-local.
That spec builds the command-line modem only. The GUI builds from a source
tree with sailfish/build-mercury-ui.sh,
which lists what it needs besides the modem's dependencies (Go, the Wayland
and xkbcommon headers, and the Khronos EGL and GLES2 headers).
The packages in the repository, mercury and mercury-ui among them, are
built from packaging/sailfish in
hermes-radio-daemon
(fetch-sources.sh, build-all.sh), with the other HERMES packages
(radiod and the libraries it needs). Source RPMs are in
http://debian.hermes.radio/sailfish/source/.
Configuration File
Mercury reads an INI-format configuration file at startup. Command-line arguments take priority over values from the file.
With -C <path> that file is used. Otherwise Mercury takes the first of these that exists (on Windows, only the first):
mercury.iniin the current working directory$XDG_CONFIG_HOME/mercury/mercury.ini, or~/.config/mercury/mercury.iniwhenXDG_CONFIG_HOMEis not set/etc/mercury/mercury.ini
A configuration that cannot be read in full (it does not parse, or a setting has an invalid value) stops Mercury with the reason before the modem starts: running on part of a configuration could open the wrong sound device or key the wrong radio. -h, -V, -l, -z and -K still work. With no configuration file (none found, or the -C file does not exist), Mercury runs on its built-in defaults and the command line, and says so, naming the sound system and devices it opens.
See the included mercury.ini.example for all available settings and their default values (the Debian package installs it as /usr/share/doc/mercury/mercury.ini.example). Copy it to one of the places above and edit it for your radio, for example:
mkdir -p ~/.config/mercury cp /usr/share/doc/mercury/mercury.ini.example ~/.config/mercury/mercury.ini
PTT is configured independently of CAT-oriented radio settings:
[ptt] method = serial device = COM7
Valid methods are none, hamlib, serial, cm108, hermes_shm, and gpio (serial_rts is still accepted and means serial with line = rts). Legacy
radio_model, radio_device, radio_serial_speed, and hamlib_log_level
keys are still read and mapped to the equivalent PTT configuration.
Common interfaces
| Interface | Method | Settings |
|---|---|---|
| DigiRig Mobile | serial |
line = rts (default) |
| All-In-One Cable (AIOC) | serial |
line = both, invert = rts |
| All-In-One Cable (AIOC) | cm108 |
auto-detected, cm108_gpio = 3 |
| CM108/CM119 USB dongles | cm108 |
cm108_gpio = 3 (some use 1 or 4) |
| CAT-controlled HF rig | hamlib |
hamlib_model, device |
| sBitx | hermes_shm |
— (or -S) |
uBitx (HERMES trx_v1, ubitx_controller) |
hermes_shm |
— (or -S) |
| Raspberry Pi GPIO (optocoupler or transistor to the PTT line) | gpio |
gpio_chip = /dev/gpiochip0, gpio_line = 17 (BCM), gpio_invert = false |
The AIOC exposes both a CDC serial port and a CM108-compatible HID endpoint, so
either method works. cm108 needs no device path — Mercury finds it — but the
HID endpoint is root-only by default, so it needs a udev rule if Mercury is not
running as root.
cm108 works on all three supported platforms, via hidapi:
| Platform | hidapi source | Notes |
|---|---|---|
| Linux | libhidapi-dev (pkg-config) |
Optional — without it Mercury talks to /dev/hidraw directly, so a minimal Raspberry Pi build needs no extra package |
| macOS | brew install hidapi |
|
| Windows | vendored in radio_io/hidapi-w64 |
Built from source with the rest of the tree, like hamlib-w64; no prebuilt library needed |
gpio opens /dev/gpiochipN, which Raspberry Pi OS gives to the gpio
group: run Mercury as a user in that group (sudo usermod -aG gpio $USER) or
as root. On a Raspberry Pi 5 with a kernel older than 6.6.45 the header is on
/dev/gpiochip4; gpioinfo lists the chips and their lines.
pkg-config detection is deliberately skipped for the Windows cross-build: it
would find the host hidapi and link something that cannot run on the target.
Restricting network access
Mercury's TCP ports listen on every interface, by design: the remote UI, BPQ32 or Pat on another host, and the hosted web app all connect over the network. None of them is authenticated, and the ARQ control port can key the transmitter, so on a network you don't trust, limit who can reach them with a host firewall rather than in Mercury's configuration.
The ports, with their defaults: ARQ control 8300 and data 8301 (-p,
arq_tcp_base_port), broadcast 8100 (-b) and the UI WebSocket 10000 (-U,
ui_port). This nftables table lets them be reached only from this machine
and one LAN; change 192.168.1.0/24 to yours:
table inet mercury {
chain input {
type filter hook input priority filter; policy accept;
tcp dport { 8100, 8300, 8301, 10000 } ip saddr { 127.0.0.0/8, 192.168.1.0/24 } accept
tcp dport { 8100, 8300, 8301, 10000 } drop
}
}
Its own table and policy accept leave every other rule alone. Load it with
sudo nft -f mercury.nft; to keep it across reboots, add it to
/etc/nftables.conf and sudo systemctl enable nftables. If you change a
port, change it here too.
Documentation
docs/ — the full index, sorted into reference (how Mercury works today), guides (building, signing, Reticulum, sanitizers) and findings (dated records of investigations and why decisions were made).
The three you are most likely to want:
- docs/CAROUSEL-ARQ.md — the ARQ data link: connect, the carousel, the wire formats
- docs/TNC.md — every TNC command, for driving Mercury from your own software
- docs/MODES.md — all modes with measured performance
Rendered HTML: https://rhizomatica.github.io/mercury/
Logging and timing traces
- Default run (
./mercury): logger runs at INFO level with timestamps ([INF]/[WRN]/[ERR]). - Verbose run (
./mercury -v): logger runs at DEBUG level and includes all detailed ARQ/modem traces ([DBG]and[TMG]). - Trace run (
./mercury -d): logger runs at TRACE level and additionally logs the raw bytes of every decoded connect frame, so you can see who is calling whom on the channel ([TRC]). Implies-v. ./mercury -v -L /tmp/session.log— write full DEBUG+TIMING log to file../mercury -v -L /tmp/session.log -J— same, but in JSONL format for machine parsing withjq.- Text log lines start with the date and time,
2026-11-02 23:15:57.123, in local time;[main] log_utc = truewrites them in UTC with aZ(2026-11-02 23:15:57.123Z), to line them up with BPQ32's or another station's log. - Right after the logger starts, a line names the build:
Mercury 1.9.23 (git 1234abcd). - The log file is capped at
[main] log_max_mb(default 20 MB; 0: no cap). Past it the file moves to<file>.1, replacing the one before, and a new file starts, so at most twice the cap is on disk. Each file has a line naming the other. - TX state transitions are logged with timestamps at INFO level as:
TX enabled (PTT ON)TX disabled (PTT OFF)
- A session's teardown after the host's
DISCONNECTis logged at INFO level:DISCONNECT deferred until delivered (up to N s)orDISCONNECT: nothing left to deliver, ending now, thenTeardown starts (caller|callee), N ms after the host's DISCONNECT, and on the other endPeer's DISCONNECT received N ms after the host's.
See docs/CAROUSEL-ARQ.md for the ARQ data link and docs/CAROUSEL-SPEC.md for its specification.
Reticulum
Mercury can carry Reticulum mesh networking over HF via its KISS-over-TCP broadcast port (verified) or as a point-to-point ARQ backbone. See docs/RETICULUM.md for the integration architectures and configuration.
Mercury can also broadcast a file to whoever is listening, with no return path, using a RaptorQ fountain carousel wire-compatible with hermes-broadcast. See docs/BROADCAST-FILE.md.
Physical Layer
Mercury builds on the FreeDV / codec2 OFDM data modes developed by David Rowe and contributors, and extends them with waveforms and link-layer techniques developed by Rhizomatica for the conditions HERMES actually operates in: long NVIS and regional paths, marginal signal levels, and fading.
These modes Mercury uses are ours, not upstream (all modes, with FEC, airtime and measured thresholds: docs/MODES.md):
| Mode | Bandwidth | Payload | What it is for |
|---|---|---|---|
| DATAC15 | 200 Hz | 30 B | Fringe data. Rate-1/3 LDPC, 3 carriers — reaches below the floor of any stock data mode |
| DATAC16 | 200 Hz | 14 B | Control and ACK at the fringe; the mode the whole session depends on |
| DATAC17 | 2250 Hz | 1184 B | Intermediate SNR, roughly 2× the goodput of DATAC1 |
| QAM16C2 | 2250 Hz | 1183 B | Good channels, roughly 2.9× DATAC1 |
| DATAC17W, QAM16C2W | 2750 Hz | 1170 B, 1169 B | BW2750's rungs 5 and 6: DATAC17 and QAM16C2 on 44 carriers |
| DATAN1, QAM16N1, QAM16N2 | 562 Hz | 243 B, 179 B, 242 B | BW500's rungs 4-6, on 9 carriers |
| MFSK | 1000 Hz | 98 B | The deepest fringe: non-coherent 32-tone MFSK (50 % frame loss at −11.2 dB on AWGN, DATAC15 −10.3 dB; measured); the carousel's floor rung, and the carrier of CALLs and tone-pattern ACKs there |
| MFSK500 | 500 Hz | 98 B | The same frame in half the bandwidth (~26.2 s): the floor of a BW500 session, and of a wider one whose ACCEPT went on it (the deep floor) |
| MFSK2K | 2000 Hz | 98 B | Twice the 1 kHz floor's rate (~6.56 s a frame): rung 1 of BW2300 and BW2750 |
Beyond the waveforms, the link layer adds:
- An erasure-coded carousel (docs/CAROUSEL-ARQ.md) — the application's bytes are cut into Reed-Solomon blocks, and the receiver polls for what each block still needs. A lost frame is never resent as such: any other piece of its block replaces it, so a fade costs airtime but not a stall. Rungs move on measured delivery, not on SNR estimates alone.
- Tone-pattern ACKs and NAV headers at the MFSK floor — 0.64 s patterns detected down to about −14 dB SNR on AWGN, where DATAC16 frames stop near −10 dB, and bound to the session so another pair's patterns are not read as ours.
- Per-mode SNR calibration, so rung decisions are made on numbers that mean the same thing across modes.
- HARQ with Chase combining in the decoders — repeats of a failed frame are soft-combined with the original (measured: 0/130 → 61/130 at −5.8 dB at the fading cliff). It is off inside carousel sessions, whose frames are never repeats of each other, and applies to plain (unseeded) frames.
Every mode figure above is measured on a calibrated bench (Watterson fading channel, 100-burst trials) that reproduces the published upstream numbers before it is trusted for ours. See docs/MODES.md for the full tables, methodology, and the negative results.
Graphical Interfaces
Mercury has three fully supported interfaces. All three are maintained by the HERMES team and all three are first-class — pick whichever suits how you operate.
Built-in GUI (Go / Fyne) — the simplest way to run Mercury.
The engine and the interface are one binary: no separate modem process to
start, no ports to wire up. Waterfall and spectrum, telemetry, radio and audio
settings, and a Mercury Client chat window for ARQ and broadcast messaging
built straight in. With the engine in the same program, the chat window
drives it directly, so the TNC ports (8300, 8301, 8100) stay free for uucp,
VarAC or another TCP client; one that connects takes the TNC from the window,
as it would from another TCP client. The main window's TCP indicator then
reads In app. Ships as an installer on Windows, a universal .dmg on
macOS, and make fyne-ui on Linux.
Web interface — runs in a browser, nothing to install, and works against a
Mercury running on another machine (a Raspberry Pi at the antenna, say).
Included in docs/app/, or use it directly at
https://rhizomatica.github.io/mercury/app/
Mercury-qt — the native Qt desktop client: https://github.com/Rhizomatica/mercury-qt
The web and Qt interfaces talk to the engine over its WebSocket interface
(-G); the built-in GUI links the engine directly, so it needs no flags.
Community interfaces also exist:
- Mercury-tk: https://github.com/odorajbotoj/mercury-tk/
About
Mercury is developed by Rhizomatica's HERMES team, namely:
- Rafael Diniz (ARQ, Broadcast, TCP interface, etc)
- Pedro Messetti (Testing framework, general improvements, etc)
- Matheus Thibau (Graphical User Interface)
This project is sponsored by ARDC.
Mercury was first written in C++. That original implementation is kept, for history, in the mercuryv1 branch.
LICENSE
Mercury is free software, licensed under the GNU General Public License, version 3 or (at your option) any later version (GPL-3.0-or-later). See the LICENSE file and the per-file headers.
Mercury bundles third-party components which carry their own licenses when taken separately:
modem/freedv— a subset of FreeDV / codec2, LGPL-2.1 (see LICENSE-freedv)common/iniparser— MIT (see common/iniparser/LICENSE)audioio/ffaudioandffbase— Unlicense / public domain (see audioio/ffaudio/UNLICENSE)- Windows, macOS and Android binary releases link against Hamlib — LGPL-2.1 (see radio_io/hamlib-w64/COPYING.LIB.txt, radio_io/hamlib-macos/COPYING.LIB.txt and radio_io/hamlib-android/COPYING.LIB.txt; the Android build and its source are described in radio_io/hamlib-android/README.md)
The combined work (the Mercury binary) is distributed under the terms of the GPL-3.0-or-later. The LGPL/MIT/Unlicense terms apply to those components only when they are used separately from Mercury.