Automated FT8 Logging System

Step-by-step guide to seamlessly connect WSJT-X to your QSO Hamfinity Logbook.

Live Bridge Installation

This system works by securely monitoring your computer's local log file. Every time you click "Log QSO" in your FT8 software, this tiny program catches it and beams it directly to the portal in real-time. Follow these 7 foolproof steps carefully.

1 🐍 Install Python Software
  1. Go to the official website: python.org/downloads
  2. Click the massive yellow "Download Python" button for the latest Windows version.
  3. Open the installer file you just downloaded.
  4. ⚠️ CRITICAL STEP: Before you click "Install Now", look at the very bottom of the installation window. You MUST check the box that says "Add python.exe to PATH". If you miss this, nothing will work!
  5. Once checked, click Install Now and let it finish.
2 🌐 Install 'Requests' (Internet Communicator)
  1. Press the Windows key on your keyboard, type cmd, and press Enter. A black window (Command Prompt) will appear.
  2. Copy the command below, paste it into the black window, and press Enter:
    pip install requests
  3. The system will automatically download a few small files. When it says "Successfully installed", close the black window.
3 📁 Locate Your WSJT-X Log File
  1. Open your WSJT-X (or JTDX) software.
  2. In the top left corner, click File then select Open log directory.
  3. A computer folder will pop up. Locate a file named wsjtx_log.adi inside.
  4. Click the empty space in the address bar at the top of that folder. The text will highlight in blue (e.g., C:\Users\YourPC\AppData\Local\WSJT-X).
  5. Right-click the blue text and select Copy. Keep this path copied to your clipboard!
4 📝 Create the Script File
  1. Open the Notepad application on your computer (Press Start, type Notepad).
  2. Scroll to the very bottom of this guide page, copy the entire PYTHON CODE located inside the dark box.
  3. Paste the entire code into your empty Notepad. Do not save it just yet, proceed to Step 5.
5 ⚙️ Update Script Configurations

At the top of the code in your Notepad, look for the CONFIGURATION section. You must change 3 things:

  1. API_KEY: Change this to the secret password (Please message the Admin to get this key). Ensure it stays inside the quotation marks " ".
  2. MY_CALLSIGN: Replace "YOUR_CALLSIGN_HERE" with your actual Callsign (Example: "9M8ZAL").
  3. WSJTX_LOG_PATH: Delete the old path, and paste the exact path you copied in Step 3.
    ⚠️ CRUCIAL: You MUST append the word \wsjtx_log.adi to the end of your path, and leave the small letter r at the front!
    Example: r"C:\Users\John\AppData\Local\WSJT-X\wsjtx_log.adi"
6 💾 Save the File Correctly
  1. In Notepad, click File -> Save As...
  2. Choose your Desktop as the saving location.
  3. Under the Save as type dropdown, change it from "Text Documents (*.txt)" to "All Files (*.*)".
  4. In the File name field, type this exactly: ft8_live_bridge.py
  5. Click Save.
7 🚀 Launch the Live Bridge!
  1. Open the black Command Prompt window again (Press Windows key, type cmd, hit Enter).
  2. Direct the system to your Desktop by typing this command and pressing Enter:
    cd Desktop
  3. Finally, start your engine by typing this command and pressing Enter:
    python ft8_live_bridge.py

🎉 Congratulations!

As long as the black window says "QSO Hamfinity Live Bridge Started" and is left open, it is working. Try making one QSO in WSJT-X. The moment you click "Log QSO", the black window will flash ✅ Success. You can now check your personal logbook on the QSO Hamfinity portal!

💻 Python Script Code

Copy all the lines of code inside this dark box and paste it into your ft8_live_bridge.py file as explained in Step 4.

import time
import os
import re
import requests

# ==========================================
# ⚙️ CONFIGURATION - CHANGE THESE 3 THINGS!
# ==========================================
# 1. The exact URL to your new API file
API_URL = "https://qso.hamfinity.com/dashboard/api_live_log.php"

# 2. Must match the secret key provided by the Admin
API_KEY = "QSOHamfinity_Live_Secret!" 

# 3. Your callsign (to tell the database whose logbook to put it in)
MY_CALLSIGN = "YOUR_CALLSIGN_HERE"

# The location of your WSJT-X ADIF log file. 
WSJTX_LOG_PATH = r"C:\Users\YOUR_PC_NAME\AppData\Local\WSJT-X\wsjtx_log.adi"
# ==========================================

def parse_adif_record(record_string):
    """Extracts data from a single ADIF string."""
    data = {}
    tags = ['call', 'band', 'mode', 'freq', 'rst_sent', 'rst_rcvd', 'qso_date', 'time_on', 'gridsquare']
    
    for tag in tags:
        match = re.search(rf'<{tag}:\d+[^>]*>([^<\s]+)', record_string, re.IGNORECASE)
        if match:
            data[tag] = match.group(1).strip()
    return data

def send_to_portal(qso_data):
    """Sends the extracted QSO to the QSO Hamfinity PHP API."""
    
    date_str = qso_data.get('qso_date', '')
    if len(date_str) == 8:
        date_str = f"{date_str[0:4]}-{date_str[4:6]}-{date_str[6:8]}"
        
    time_str = qso_data.get('time_on', '')
    if len(time_str) >= 4:
        time_str = f"{time_str[0:2]}:{time_str[2:4]}:{time_str[4:6] if len(time_str)>=6 else '00'}"

    payload = {
        'api_key': API_KEY,
        'owner_callsign': MY_CALLSIGN,
        'qso_call': qso_data.get('call', ''),
        'band': qso_data.get('band', ''),
        'mode': qso_data.get('mode', 'FT8'),
        'freq': qso_data.get('freq', ''),
        'grid': qso_data.get('gridsquare', ''),
        'rst_sent': qso_data.get('rst_sent', ''),
        'rst_rcvd': qso_data.get('rst_rcvd', ''),
        'qso_date': date_str,
        'qso_time': time_str
    }

    try:
        print(f"📡 Sending {payload['qso_call']} to QSO Hamfinity Portal...")
        response = requests.post(API_URL, data=payload)
        
        if response.status_code == 200:
            print(f"✅ Success: {response.text}\n")
        else:
            print(f"❌ Error {response.status_code}: {response.text}\n")
    except Exception as e:
        print(f"⚠️ Connection Failed: {e}\n")

def watch_log_file():
    """Watches the WSJT-X log file