🚀 Launch Week Day 5:Introducing Immutable Scans.Learn More →
Socket
Book a DemoInstallSign in
Socket

tinygo.org/x/wireless

Package Overview
Dependencies
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tinygo.org/x/wireless

Go Modules
Version
v0.0.0-20260121153201-f0d8647de68c
Version published
Created
Source

wireless

Wireless communication protocol implementations to be used by TinyGo supported radios.

For example, this program sends WSPR packet data:

package main

import (
	"time"

	"tinygo.org/x/wireless/wspr"
)

func main() {
	println("Starting WSPR communication example...")
	time.Sleep(2 * time.Second)

	// init the modem
	println("WSPR modem initialized.")
	radio := initRadio()

	frequency := radio.GetBaseFrequency()
	println("Transmitting on frequency", frequency, "Hz")

	data := make([]byte, 256)

	// Example WSPR packet data
	// K1ABC FN42 37
	// See https://en.wikipedia.org/wiki/WSPR_(amateur_radio_software)
	msg, err := wspr.NewMessage("K1ABC", "FN42", 37)
	if err != nil {
		println("Error creating WSPR message:", err.Error())
		return
	}
	n, err := msg.WriteSymbols(data)
	if err != nil {
		println("error writing WSPR message")
		return
	}

	// transmit some data
	for range 50 {
		println("Transmitting WSPR message with", n, "symbols")
		if err := radio.WriteSymbols(data[:n]); err != nil {
			println("error transmitting WSPR message:", err.Error())
			return
		}

		println("Waiting for next transmission...")
		time.Sleep(15 * time.Second)
	}

	time.Sleep(2 * time.Second)

	// put the radio in standby
	println("Putting radio in standby mode...")
	radio.Standby()
	time.Sleep(1 * time.Second)

	println("WSPR modem example completed.")
	radio.Close()
}

Supported Protocols

AFSK

Audio Frequency-Shift Keying

https://notblackmagic.com/bitsnpieces/afsk/

FSK4

Frequency-shift keying (FSK4)

https://en.wikipedia.org/wiki/Frequency-shift_keying

LoRa

Long Range (LoRa)

https://en.wikipedia.org/wiki/LoRa

LoRaWAN

Long Range Wide Area Networking (LoRaWAN)

https://en.wikipedia.org/wiki/LoRa#LoRaWAN

U4B

Telemetry protocol on Weak Signal Propagation Reporter (WSPR)

https://qrp-labs.com/u4b/u4bdecoding.html

WSPR

Weak Signal Propagation Reporter (WSPR)

https://en.wikipedia.org/wiki/WSPR_(amateur_radio_software)

Supported Radios

  • si5351
  • SX126X

FAQs

Package last updated on 21 Jan 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts