MEGACYCLE SMARTLINK RADIO MONITOR
=================================

Raspberry Pi version 1.0
Copyright (c) 2026 Frederick J. Glenn, K9SO

PURPOSE
-------

Megacycle monitors FlexRadio SmartLink radios and provides:

- Automatic SmartLink radio discovery
- OFF / FREE / BUSY status
- GPIO LED indicators
- Web-based radio status
- Current user/station display
- Session elapsed time
- Estimated time remaining
- Persistent usage history
- Usage summaries by station and radio
- CSV usage-log download
- Automatic startup after reboot


HARDWARE
--------

Designed for Raspberry Pi 4 running Raspberry Pi OS.

LED outputs:

  Slot 1   GPIO17   Physical pin 11
  Slot 2   GPIO27   Physical pin 13
  Slot 3   GPIO22   Physical pin 15
  Slot 4   GPIO23   Physical pin 16

Connect each LED through an appropriate series resistor
(typically 330 to 470 ohms) to a Raspberry Pi ground pin.

LED behavior:

  OFF radio   LED dark
  FREE radio  LED flashes
  BUSY radio  LED continuously on

Radio assignments are remembered by serial number.


INSTALLATION
------------

You will receive the file:

     MegacyclePi.zip

1. Copy MegacyclePi.zip to the Raspberry Pi home directory.

2. Open a terminal on the Raspberry Pi and run:

     cd ~
     unzip MegacyclePi.zip
     cd MegacyclePi

3. Make sure the installer is executable:

     chmod +x install.sh uninstall.sh

4. Install Megacycle:

     ./install.sh

   Enter the Raspberry Pi user's password if sudo asks for it.

5. When installation completes, determine the Pi IP address:

     hostname -I

   The IPv4 address will normally look similar to:

     192.168.1.125

   or:

     10.2.0.126

6. From another computer on the same LAN, open a browser to:

     http://PI-IP-ADDRESS:8080

   Example:

     http://10.2.0.126:8080

7. On a new installation, the Megacycle SmartLink Setup page will
   appear. Enter the SmartLink email address and password.

8. Megacycle will authenticate with SmartLink and begin monitoring
   the radios associated with that SmartLink account.

9. After installation, Megacycle starts automatically whenever the
   Raspberry Pi boots. No terminal window needs to remain open.


NORMAL OPERATION
----------------

Megacycle starts automatically whenever the Raspberry Pi boots.

No keyboard, monitor, or SSH session is required for normal use.

Main status page:

     http://PI-IP-ADDRESS:8080

The web interface includes links to:

- Usage History
- Usage Summary
- CSV usage-log download


SERVICE COMMANDS
----------------

Check status:

     systemctl status megacycle

Restart:

     sudo systemctl restart megacycle

Stop:

     sudo systemctl stop megacycle

Start:

     sudo systemctl start megacycle


UNINSTALLATION
--------------

From the MegacyclePi folder run:

     ./uninstall.sh

The uninstaller removes the running program and systemd service.

Usage history, radio assignments, and SmartLink credentials are
preserved.


NETWORK SECURITY
----------------

The Megacycle web server is intended for use on a trusted local
network.

Do NOT forward TCP port 8080 from an Internet router to the
Raspberry Pi.


LICENSE
-------

Released under the MIT License. See LICENSE for details.
