macOS Installation - NoobishSVK/fm-dx-webserver GitHub Wiki

FM-DX Webserver macOS Installation

Requirements

  • Homebrew installed, see brew.sh.
  • A suitable TEF receiver (e.g., Headless unit) connected via USB.
  • A macOS-compatible audio card (required for non-Headless units).
  • An open terminal window.

Preparation

Install the required packages for fm-dx-webserver:

brew install node sox ffmpeg

Check that Node.js is available:

node --version

If this command fails, link Node.js manually:

brew link node

Clone fm-dx-webserver

Clone the latest source code:

git clone https://github.com/NoobishSVK/fm-dx-webserver.git

Install Dependencies

cd fm-dx-webserver
npm install
npm audit fix

First Startup

Start the webserver:

npm run webserver

Open the interface in your browser at http://localhost:8080/. Follow the setup wizard and configure:

  • Tuner connection: Direct
  • USB device: Select the device starting with /dev/tty.usbmodem
  • Audio device: Choose the correct input. For Headless Lite, select TEF668X Audio
  • Admin password

After the message Data saved!, return to the terminal and stop the running process with Ctrl+C.

Start the webserver again in normal mode:

npm run webserver

When macOS requests permission for “Terminal” to access the audio device, click Allow.

Your fm-dx-webserver is now ready for use.

Upgrading fm-dx-webserver

Before upgrading, consider backing up your current fm-dx-webserver directory.

In your fm-dx-webserver directory run:

git pull

Restart your fm-dx-webserver, by pressing ctrl-c and running the command below.

npm run webserver

Caveat

Some TEF Headless units may require a firmware update if the audio device cannot be selected. If this occurs—or if you encounter problems selecting any USB audio device—creating an aggregate audio device in Apple’s Audio MIDI Setup utility can resolve the issue.

Credit to vytska69 on Discord for identifying this workaround.

Autostart on Login

Create Plist

!!! Make sure the server is already working as intended before doing this !!!

Create the file ~/Library/LaunchAgents/org.fmdx.fm-dx.webserver.plist

Replace USERNAME with your username.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
  <key>Label</key><string>org.fmdx.fm-dx.webserver</string>
  <key>ProgramArguments</key>
  <array>
    <string>/opt/homebrew/bin/node</string>
    <string>/opt/homebrew/lib/node_modules/npm/bin/npm-cli.js</string>
    <string>run</string>
    <string>webserver</string>
  </array>
  <key>WorkingDirectory</key><string>/Users/USERNAME/fm-dx-webserver</string>
  <key>EnvironmentVariables</key>
  <dict>
    <key>PATH</key><string>/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin</string>
    <key>HOME</key><string>/Users/USERNAME</string>
  </dict>
  <key>RunAtLoad</key><true/>
  <key>KeepAlive</key><true/>
  <key>StandardOutPath</key><string>/Users/USERNAME/fm-dx-webserver/fmdx-webserver.out</string>
  <key>StandardErrorPath</key><string>/Users/USERNAME/fm-dx-webserver/fmdx-webserver.err</string>
</dict>
</plist>

Load the plist

launchctl load ~/Library/LaunchAgents/org.fmdx.fm-dx.webserver.plist

Start the fm-dx-webserver

launchctl start org.fmdx.fm-dx.webserver

Verify

launchctl print gui/$(id -u)|grep fm-dx.webserver

fm-dx-webserver console logs

The logs sent to the console can be read doing.

tail ~/fm-dx-webserver/fmdx-webserver.out
⚠️ **GitHub.com Fallback** ⚠️