Skip to content
psyb0tPublic

About

Go wrapper for rpitx: subprocess-managed RF transmission via a singleton. Covers FM/RDS, Morse, POCSAG, FT8, SSTV, RTTY, FSK, IQ and more (12 modules). Dev-mode mocks execution so you can test without keying an actual transmitter.

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Latest commit

 

History

48 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gorpitx

CI coverage version license imported by

Go wrapper that runs rpitx modules without the hassle.

Tired of wrestling with raw C binaries that print a usage line and die when you get one argument wrong? gorpitx wraps rpitx so you hand it a module name and a JSON blob. It checks every field, builds the command line, and runs the transmitter as a child process with a timeout, a graceful stop and live output. One transmission at a time, because the Pi has one transmitter.

Table of Contents

What it does

Runs 12 rpitx programs through one API, with dev mode (a harmless shell loop instead of the transmitter, for tests and laptops) and production mode (actual RF, as root).

Module What it sends Frequency unit
pifmrds FM broadcast with RDS station name and radiotext MHz
tune A plain carrier Hz
pichirp A carrier sweep Hz
morse Morse code Hz
pocsag Pager messages Hz
spectrumpaint A picture on a waterfall display Hz
pift8 FT8 Hz
pisstv SSTV pictures, Martin 1 Hz
pirtty RTTY Hz
fsk FSK text through minimodem and sox Hz
audiosock-broadcast Audio from a unix socket as FM, AM, DSB, USB, LSB or raw Hz
sendiq Raw I/Q samples, with run-time control over shared memory Hz

Quick start

go get github.com/psyb0t/gorpitx
package main

import (
	"context"
	"encoding/json"
	"log"
	"time"

	"github.com/psyb0t/gorpitx"
)

func main() {
	rpitx := gorpitx.GetInstance()

	args, err := json.Marshal(gorpitx.MORSE{
		Frequency: 14070000, // Hz
		Rate:      20,       // dits per minute
		Message:   "CQ CQ DE N0CALL",
	})
	if err != nil {
		log.Fatal(err)
	}

	err = rpitx.Exec(
		context.Background(),
		gorpitx.ModuleNameMORSE,
		args,
		30*time.Second,
	)
	if err != nil {
		log.Fatal(err)
	}
}

Try it anywhere with ENV=dev go run .: the module still validates its arguments, then a shell loop prints the command it would have run until the timeout hits and Exec returns commonerrors.ErrTimeout. On the Pi, run it as root with GORPITX_PATH pointing at your rpitx checkout.

Requirements

  • A Raspberry Pi that rpitx supports, with rpitx installed.
  • Root in production mode. GetInstance panics otherwise.
  • GORPITX_PATH set to the directory with the rpitx binaries, as an absolute path. The default, $HOME/rpitx, is used literally and does not work.
  • minimodem and sox for fsk, socat and csdr for audiosock-broadcast.

The getting started guide walks through all of it.

Documentation

The full documentation lives at https://psyb0t.github.io/gorpitx/.

Section What's in it
Getting started rpitx install, extra tools, dev mode, first real transmission
Configuration GORPITX_PATH, ENV, the root check, files written to /tmp
Running modules Exec, timeouts, Stop, output streaming, concurrency
Modules Every field, rule and example for all 12 modules
Errors The sentinels to match with errors.Is
Troubleshooting Real failures with the exact message and the fix
Architecture How a call becomes a process
Development Make targets, tests, CI, adding a module

Development

make lint            # go fix -diff, golangci-lint, shellcheck
make test-coverage   # tests with the 90% coverage gate
make docs            # build the docs site into .testing/docs-site

No test needs a Pi or root. See Development for the rest, and CHANGELOG.md for what changed in each release.

Legal notice

RF transmission is regulated. Get the license before you transmit. This software is for licensed amateur radio operators, low-power experiments in bands you may use, and education. An unfiltered Pi also radiates harmonics far from the frequency you picked, so put a filter on it.

Absolutely NOT for broadcasting without authorization. The fines are severe.

Sponsor

Buy Me a Coffee

License

MIT License, see LICENSE. Use responsibly.

About

Go wrapper for rpitx: subprocess-managed RF transmission via a singleton. Covers FM/RDS, Morse, POCSAG, FT8, SSTV, RTTY, FSK, IQ and more (12 modules). Dev-mode mocks execution so you can test without keying an actual transmitter.

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages