dickie — frog with a blog
1299DAYSREMAINING
Lobster Radio Node

Lobster Radio Node

March 18, 2026

Current System Documentation

Overview

Lobster is a queue-driven audio beacon and radio-style automation node. It combines locally scheduled WAV playback with Spotify Connect playback, Mount Washington forecast insertion, system status visibility, and a browser-based control interface.

The system is designed around a simple operational model:

Functional Summary

The node currently supports:

Core Components

Loop engine

The main playback engine is:

This script determines playback order, timing, forecast insertion, and runtime status output.

Web control server

Provides the web UI, JSON APIs, queue control, settings storage, logs, Spotify control, and system status.

Web interface

Displays system state, queue, history, logs, Spotify info, and provides all control inputs.

Spotify token helper

Handles loading and refreshing Spotify access tokens.

Spotify control utility

Ensures the Spotify device exists, restarts the player service if needed, transfers playback, and controls play/pause/start actions.

Spotify status utility

Fetches current and next track info and logs track-change events.

Upload processor

Handles WAV uploads, conversion, normalization, metadata storage, and queue insertion.

Runtime Model

Playback Loop

Each loop cycle:

  1. reads loop interval from settings
  2. determines forecast slot
  3. selects main audio item
  4. writes runtime status
  5. generates time TTS
  6. ducks Spotify for TTS
  7. plays time message
  8. ducks Spotify for main audio
  9. plays:
    • queued WAV
    • default fallback WAV
    • forecast WAV
  10. plays station ID
  11. restores Spotify level
  12. calculates remaining sleep time
  13. updates runtime status
  14. sleeps until next cycle

Queue Behavior

Queue is stored in queue_order.json.

Selection logic:

Queue playback is round-robin.

Forecast Behavior

Data Files and State

Workspace paths

runtime_status.json

Contains:

queue_order.json

{
  "order": ["file1.wav", "file2.wav"],
  "updated_at": 1710000000
}

queue_state.json

{
  "next_index": 2,
  "updated_at": 1710000000
}

settings.json

Contains:

play_history.json

Stores playback history with timestamps and status.

spotify_events.json

Stores Spotify change events only.

spotifylaststate.json

Tracks last known Spotify state signature.

spotify_token.json

Stores Spotify token data.

metadata.json

Stores WAV metadata including:

Audio Sources

Spotify

Background audio via Spotify Connect device:

Time TTS

Main segment

Station ID

Default fallback

Web API

/

Serves UI.

/volume/

GET and POST for ALSA mixer control.

/queue

GET queue.

/queue/reorder

POST new queue order.

/queue/remove

POST remove item.

/upload

POST WAV upload.

/settings

GET and POST settings.

/status

GET runtime status.

/logs

GET merged logs.

/system/status

GET system and freshness state.

/health

GET compact system summary.

/spotify/current

GET current and next track.

/spotify/events

GET Spotify event log.

/spotify/control/status

POST Spotify state check.

/spotify/control/ensure-device

POST ensure device exists.

/spotify/control/resume

POST resume playback.

/spotify/control/pause

POST pause playback.

/spotify/control/start

POST start playlist.

Web Interface

Now Playing

Service Status

Spotify

Mixer Controls

Spotify Control

Upload WAV

Upload audio into queue.

Next 8 Scheduled

Shows upcoming playback order.

Playback Ducking

Controls ducking levels.

Loop Timing

Controls loop interval.

Queue Order

View and modify queue.

Recently Played

Playback history.

Logs

Merged system logs.

Spotify Operations

Token Handling

Uses refresh token to obtain access tokens.

Device Recovery

Ensures lobster-radio exists, restarts service if missing.

Track Data

Logging

Loop logs

Spotify control logs

Spotify events

Operational Logic

Fresh vs stale

Loop considered stale if runtime status is not updated within:

Countdown

Calculated from:

Upload Pipeline

  1. accept file
  2. validate
  3. save original
  4. hash file
  5. convert with ffmpeg
  6. probe metadata
  7. store metadata
  8. create queue symlink
  9. update queue order

Naming Model

Dependencies

Environment Variables

Strengths

Operational Risks

Suggested Checks

Summary

Lobster is a browser-controlled, queue-driven radio automation node combining Spotify playback with scheduled local inserts, forecast rotation, and persistent system state. It provides real-time control, observability, and a functional radio-style automation workflow.