This project implements an antenna switch controller using an ESP32 microcontroller. The controller manages multiple relays to switch between different antennas based on the current operating frequency or manual selection. The ESP32 itself interfaces with a Kincony KC868-A16 board, however the long term goal is to have this code run on that board itself.
- Automatic antenna switching based on frequency
- Manual antenna selection (somewhat..)
- TCP Client to interface with KC868-A16 to drive antenna relays
- CAT command parsing to extrapolate frequency information
- Web interface for configuration and control
- Wi-Fi connectivity for remote access
- SmartConfig for easy Wi-Fi setup, requires iOS / Android app I think
The project consists of several key components:
- Relay Controller: Manages the physical relays connected to different antennas.
- Antenna Switch: Handles the logic for selecting the appropriate antenna based on frequency or user input.
- CAT Parser: Interprets CAT commands for integration with radio transceivers.
- TCP Client: Enables remote control and status updates via TCP protocol.
- Wi-Fi Manager: Manages Wi-Fi connectivity for the ESP32.
- Web Server: Provides a web interface for configuration and control.
This project uses the ESP-IDF framework. To build and flash the project:
- Set up the ESP-IDF environment.
- Navigate to the project directory.
- Run
idf.py build
to build the project. - Run
idf.py -p (PORT) flash
to flash the ESP32, replacing (PORT) with your device's port.
The antenna switch can be configured through the web interface or by modifying the antenna_switch_config_t
structure
in the code. This includes setting up frequency bands, antenna ports, and TCP communication settings.
- Hot switch protection (don't switch if transmitting)
- Add support for RS485 to interface with the KC868 directly rather than over WiFI
- Interlock
- Port to to run on kc868 directly
Every time we change the output state of the mosfets on the KC868 it saves the state to NVS, This needs to somehow be turned off or custom firmware needs to be written (porting this project) to minimize the amount of writes to NVS for longevity reasons
Once flashed and powered on, the ESP32 will start the antenna switch controller. You can interact with it via:
- The web interface (connect to the ESP32's IP address)
- TCP commands sent to the configured IP and port
- CAT commands via the UART interface
This project is licensed under the GNU General Public License v3.0 License. See the LICENSE file for details.