Table of Contents

HamSearch

HamSearch is a Mystic BBS add-on for looking up amateur radio callsigns using FCC ULS data from inside the BBS.

It runs as a Python 3 MPY script in Mystic and uses a local SQLite database for faster lookups, with fallback support for the FCC flat data files.


Project Info

Item Details
Project Name HamSearch
Purpose Amateur radio callsign lookup inside Mystic BBS
Platform Mystic BBS
Language Python 3
Data Source FCC ULS Amateur Radio database
Current Search Script ``hamserach.mpy``
Database Builder ``getdb.py``
Header File ``hshdr.ans``

Features


Included Files

File Purpose
``hamsearch.mpy`` Main Mystic Python 3 search script
``getdb.py`` Downloads FCC data, extracts files, builds SQLite DB
``hshdr.ans`` ANSI header / display file
``install.txt`` Plain text install instructions

Requirements


How It Works

``getdb.py`` downloads the current FCC amateur ULS ZIP archive, extracts the needed files into a local ``data/`` directory, and builds:

data/hamsearch.db

The Mystic script ``hamserach.mpy`` then uses that SQLite database for lookups.

If SQLite is not available, the script can still fall back to the FCC flat files.


FCC Data Files Used

The current builder is designed to work with these FCC files when present:

These are used for current license data, operator class, mailing information, and historical references such as previous callsigns and status history.


Installation

1. Create a HamSearch directory

Create a directory for HamSearch inside your Mystic scripts area.

Example:

/mystic/themes/default/scripts/hamsearch/

2. Copy the project files

Place these files in that directory:


3. Run getdb.py

Run the database builder from the HamSearch directory on your host system:

python3 getdb.py

This should:

After it finishes, your directory should look something like this:

hamsearch/
  hamserach.mpy
  getdb.py
  hshdr.ans
  hamsearch.log
  data/
    AM.dat
    EN.dat
    HD.dat
    HS.dat
    hamsearch.db

4. Edit the database path in hamserach.mpy

Open ``hamserach.mpy`` and set the ``DB_FOLDER`` value to point to your HamSearch data directory.

Example:

DB_FOLDER = "/home/youruser/mystic/themes/default/scripts/hamsearch/data/"

This path should point to the folder containing:


5. Set file permissions

Make sure the Mystic process/user can read:


6. Add a Mystic menu command

In Mystic, create a menu item for HamSearch and use the Python 3 MPY menu command:

GZ

For the script path/data, point it to your HamSearch script.

Example concept:

Field Value
Command ``GZ``
Data ``/full/path/to/hamsearch.mpy``

7. Test the script

After adding the menu item, log into the BBS and test:


Notes


Troubleshooting

Database not found

If HamSearch says it cannot find the database:

Check the following:

Searches fail

Try the following:


Current Cleanup Note

The main script filename in the repo is currently:

hamsearch.mpy

That spelling is preserved for compatibility with the current repository layout.

At some point, it would be a good idea to rename it to:

hamsearch.mpy

If that rename happens later, make sure to also update:


Planned Improvements



SysOp Notes

Things worth remembering:


mystic bbs hamradio amateur_radio python sqlite fcc projects