Getting Started

Everything you need to set up Morse-Pi and start practicing Morse code.

Quick Start

SSH into your Raspberry Pi and run these three commands:

1. Update package lists

sudo apt update

2. Upgrade installed packages

sudo apt upgrade -y

3. Install Morse-Pi (Rust backend)

curl -sSL https://raw.githubusercontent.com/Nerd-or-Geek/Morse-Pi/main/install-rust.sh | sudo bash
✓ That's it
The installer handles everything else — Rust toolchain, GPIO libraries, building the binary, and setting up auto-start on boot. Once it finishes, open your browser to the IP address shown on screen at port 5000:

http://<your-pi-ip>:5000
ℹ Build time
First build takes 10–30 minutes on Pi Zero, around 3 minutes on Pi 4. The installer will show progress as it compiles.
⚠ Reboot required for USB keyboard mode
If you plan to use the USB HID keyboard feature, run sudo reboot after the installer finishes to activate the kernel modules.

Features

FeatureDescription
SEND modeKey Morse in real time and watch character-by-character decoding
ENCODEType any text and see the Morse equivalent instantly
DECODEEnter dots and dashes, get the decoded text — quiz-style training
SPEED trainerPractice sending at a target WPM and get scored on accuracy
STATSTrack accuracy, longest streak, and session history
Farnsworth timingStretch gaps between letters and words — great for beginners
Multi-Pi networkingDiscover other Morse-Pi devices on your LAN and exchange messages
USB HID KeyboardPi acts as a USB keyboard — decoded Morse becomes real keystrokes
On-screen keysWorks without hardware: Space = straight key, Z/X = paddles
Physical GPIO keyConnect a real Morse key or iambic paddle via GPIO pins
Configurable tonesSeparate dot/dash frequencies, volume, and WPM — all from the browser
Dual-pin speakerPush-pull differential drive across two GPIO pins for louder, cleaner audio
Dark/light themesSwitch between dark and light UI from CONFIG

Requirements

Minimum (software only)

ℹ No Raspberry Pi needed
The web UI works on any machine — you just won't have GPIO or USB HID features. On-screen keys and keyboard shortcuts still work.

Full hardware setup (Raspberry Pi)

For USB HID Keyboard mode

Installation

Option A — Rust backend Recommended

The Rust backend compiles to a single native binary with no runtime dependencies. SSH into your Raspberry Pi and run:

curl -sSL https://raw.githubusercontent.com/Nerd-or-Geek/Morse-Pi/main/install-rust.sh | sudo bash

The installer performs four steps:

  1. USB HID Keyboard Gadget — configures the Pi to appear as a USB keyboard when plugged into a computer
  2. Rust Toolchain — installs rustup, cargo, pigpio dev headers, and build-essential
  3. Build — clones the repo and runs cargo build --release --features gpio
  4. Auto-start — creates a systemd service so Morse-Pi runs on every boot

Option B — Python backend

The original Python/Flask backend. Faster to install, easier to modify:

curl -sSL https://raw.githubusercontent.com/Nerd-or-Geek/Morse-Pi/main/install.sh | sudo bash

The installer performs four steps:

  1. USB HID Keyboard Gadget — configures the Pi to appear as a USB keyboard
  2. Packages — installs python3, pip, git, flask, gpiozero, pigpio
  3. Repository — clones the code to /opt/morse-pi
  4. Auto-start — creates a systemd service so Morse-Pi runs on every boot
⚠ Reboot required after first install
USB HID keyboard mode requires a reboot to activate the kernel modules. Run sudo reboot after the installer finishes.

Once running, open your browser to the IP address shown on screen:

http://192.168.1.42:5000

Switching from Python to Rust

Already running the Python backend? Transition in-place without losing your settings:

curl -sSL https://raw.githubusercontent.com/Nerd-or-Geek/Morse-Pi/main/transition-rust.sh | sudo bash

This installs the Rust toolchain, builds the binary, backs up your data, replaces the Python files, and restarts the service.

Manual installation (Rust)

# 1. Clone
git clone https://github.com/Nerd-or-Geek/Morse-Pi.git
cd Morse-Pi/morse-translator-rust

# 2. Install Rust toolchain
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
source "$HOME/.cargo/env"

# On Raspberry Pi, also install GPIO deps:
sudo apt install libpigpio-dev pigpio build-essential -y
sudo systemctl enable pigpiod --now

# 3. Build and run
cargo build --release --features gpio
./target/release/morse-pi

Manual installation (Python)

# 1. Clone
git clone https://github.com/Nerd-or-Geek/Morse-Pi.git
cd Morse-Pi

# 2. Install dependencies
sudo pip3 install flask --break-system-packages

# On Raspberry Pi, also:
sudo apt install python3-gpiozero pigpio python3-pigpio -y
sudo systemctl enable pigpiod --now
sudo usermod -aG gpio $USER

# 3. Run
cd morse-translator
python3 app.py

Then open http://localhost:5000 (or the Pi's IP from another device).

GPIO Wiring

ℹ Pin numbers
All pin numbers below are BCM (Broadcom) numbers, not physical pin header numbers. All assignments are reconfigurable from the CONFIG panel.

Straight key (single-pin mode)

ComponentGPIO (BCM)Physical PinNotes
Key signal17Pin 11Active-low (key shorts pin to GND)
Key groundGNDPin 9 or 14
Speaker +18Pin 12Speaker pin 1
Speaker −13Pin 33Speaker pin 2 (push-pull)
Dual-pin speaker (push-pull drive)
Connect the speaker between two GPIO pins instead of between a GPIO pin and GND. The Pi drives them in anti-phase (one HIGH while the other is LOW, then they swap), doubling the voltage swing for louder, cleaner audio. Set both Speaker Pin 1 and Speaker Pin 2 in the CONFIG panel.
ℹ Single-pin fallback
If you leave Speaker Pin 2 empty, the speaker operates in single-pin PWM mode (speaker between the GPIO pin and GND). This works but produces quieter output.

Iambic paddle (dual-pin mode)

ComponentGPIO (BCM)Physical PinNotes
Dot paddle22Pin 15Active-low
Dash paddle27Pin 13Active-low
Speaker +18Pin 12Speaker pin 1
Speaker −13Pin 33Speaker pin 2 (push-pull)

GPIO header pinout (subset)

┌──────────────────────────────────┐ │ 1 3V3 │ 2 5V │ │ 3 BCM2 │ 4 5V │ │ 5 BCM3 │ 6 GND │ │ 7 BCM4 │ 8 BCM14 │ │ 9 GND │ 10 BCM15 │ │ 11 BCM17 │ 12 BCM18 ← spkr + │ ← key (single) │ 13 BCM27 │ 14 GND │ ← dash (dual) │ 15 BCM22 │ 16 BCM23 │ ← dot (dual) │ … │ … │ │ 33 BCM13 │ 34 GND │ ← spkr − └──────────────────────────────────┘

Ground output pins

If your paddle's common wire is soldered to a GPIO pin instead of a physical GND pin, you can assign that GPIO as a Ground Output in the CONFIG or diagnostic panels. The Pi will drive that pin permanently LOW so it acts as a ground reference.

Modes & Tabs

The Morse-Pi web UI is a single-page application with nine tabs along the top navigation bar:

TabPurpose
SENDKey Morse code in real time → live decoded text
ENCODEType plaintext → see Morse translation
DECODEQuiz: see Morse → type the decoded answer
SPEEDSpeed drill: key a phrase, measure WPM and accuracy
KBUSB HID keyboard settings and output
STATSAccuracy and streak statistics
CONFIGAll settings (pins, tones, WPM, theme, Farnsworth, etc.)
RADIOMulti-Pi networking: discover peers, send/receive messages, and live transmit
HELPBuilt-in reference for shortcuts, wiring, and mode descriptions

SEND Mode

SEND is the primary Morse code practice mode. Key Morse using your hardware key, on-screen buttons, or keyboard shortcuts, and watch your input decoded in real time.

How it works

  1. Press and hold your key (or Space) to generate dots and dashes
  2. The symbol buffer shows your current dots/dashes as you key them
  3. After a letter gap (3 dot units of silence), the character is decoded and appended to the output
  4. After a word gap (7 dot units), a space is inserted

Input methods

MethodHow
Straight key (single pin)Physical key on GPIO or Space bar — duration determines dot vs dash
Iambic paddle (dual pin)Physical paddles on GPIO or Z (dot) / X (dash) keys
On-screen buttonsClick/tap the DOT and DASH buttons in the UI
ℹ Straight key timing
In straight key mode, the key-down duration is compared to 2× the dot unit. If shorter → dot; if longer → dash. The dot unit is calculated from your WPM setting: dot_unit = 1200ms / WPM.

ENCODE Mode

Type or paste any text into the input field and instantly see the Morse code translation. Each character is broken down showing the letter and its Morse equivalent.

DECODE Mode

A quiz-style trainer: the app shows a random word or phrase in Morse code. You type your decoded answer and submit.

SPEED Trainer

A speed drill that measures how fast and accurately you can key a displayed phrase.

  1. A phrase is displayed on screen
  2. Key the phrase using your paddle or keyboard
  3. A timer starts automatically when you begin keying
  4. Submit when done — the app compares your keyed Morse with the expected phrase

Results include:

USB Keyboard (KB)

The KB tab controls USB HID keyboard mode. When enabled, decoded Morse characters are sent as real keystrokes to whatever computer the Pi is plugged into via USB.

ModeBehavior
LettersEach decoded Morse character is sent as the corresponding keystroke.
CustomEach dot/dash paddle press immediately sends a configured key (default Z/X). No decoding — raw key mapping.

See the USB HID Keyboard page for full setup and configuration details.

Networking (RADIO)

Multiple Morse-Pi devices on the same LAN automatically discover each other — no configuration needed.

How discovery works

Sending messages

  1. Open the RADIO tab
  2. Select a discovered peer from the list
  3. Type a message and click SEND, or key Morse using your paddle and send the decoded text
  4. The message is sent via HTTP to the peer's /receive_morse endpoint
  5. The receiving Pi plays the message through its speaker and shows it in the inbox
ℹ Direct radio URL
Open the dedicated radio console directly at http://<pi-ip>:5000/network. The older /radio URL is still supported as a compatibility alias.
ℹ Device name
Set your device name in CONFIG → Device Name or directly in the RADIO page. This is how other Pis identify your device.

Statistics

The STATS tab shows your practice history:

Stats are saved to stats.json and persist across restarts and updates. Click Reset to start fresh.

Configuration

All settings are configurable live from the CONFIG tab — no files to edit, no restarts needed.

See the Settings Reference for a full table of every setting.

Key sections

Keyboard Shortcuts

KeyAction
SpaceStraight key — hold to dash, tap to dot
ZDot paddle (iambic / dual-pin mode)
XDash paddle (iambic / dual-pin mode)
ℹ Squeeze keying
In dual-pin mode, holding both Z and X simultaneously activates squeeze/iambic keying — the keyer alternates between dots and dashes automatically.