Skip to content

cvalentine99/uConsole-RF-Tools

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hardware Control Center

A comprehensive graphical user interface for managing multiple hardware modules in embedded Linux systems.

Features

Integrated Hardware Support

  • GPS Module - Real-time position tracking, satellite display, NMEA logging
  • LoRa Radio - Message transmission/reception, signal monitoring
  • RTL-SDR - Software Defined Radio control and spectrum display
  • RTC - Real-time clock with alarm and temperature monitoring
  • USB Hub - Device enumeration and power management

Key Capabilities

  • Real-time Data Display - Live updates from all modules
  • Configuration Management - JSON-based configuration files
  • Event Logging - Track all hardware events
  • Dark Theme - Professional UI optimized for long-term use
  • Multi-Tab Interface - Easy navigation between modules

Screenshots

Hardware Control Center

Installation

Quick Install (Recommended)

The easiest way to install is using the automated installation script:

cd hardware-control-center
./install.sh

The installer will:

  1. Check Python version (3.7+ required)
  2. Install system dependencies (requires sudo)
  3. Create a Python virtual environment
  4. Install Python packages in the virtual environment
  5. Add your user to hardware access groups
  6. Create a desktop launcher
  7. Set executable permissions

IMPORTANT: After installation completes, logout and login for group changes to take effect!

Manual Installation

If you prefer manual installation:

# System dependencies (Debian/Ubuntu/Raspberry Pi OS)
sudo apt-get update
sudo apt-get install -y \
    python3-pip \
    python3-venv \
    python3-full \
    libusb-1.0-0 \
    i2c-tools \
    libi2c-dev

# Add user to required groups
sudo usermod -a -G dialout,i2c,spi,plugdev,gpio $USER
# Logout and login for group changes to take effect

# Create virtual environment
python3 -m venv venv

# Activate virtual environment
source venv/bin/activate

# Install Python packages
pip3 install -r requirements.txt

# Deactivate when done
deactivate

Usage

Basic Usage

# Run with default configuration
./run.sh

# Run with custom configuration
./run.sh --config my_config.json

# Run in fullscreen mode
./run.sh --fullscreen

# Or find "Hardware Control Center" in your application menu

The run.sh script automatically activates the virtual environment and launches the application.

Configuration

Create a configuration file (e.g., configs/my_config.json):

{
  "gps": {
    "enabled": true,
    "device": "/dev/ttyUSB0",
    "baud_rate": 9600
  },
  "lora": {
    "enabled": true,
    "spi_device": "/dev/spidev0.0",
    "frequency": 915000000,
    "spreading_factor": 7,
    "bandwidth": 125000,
    "tx_power": 17
  },
  "rtlsdr": {
    "enabled": false,
    "device_index": 0,
    "sample_rate": 2048000,
    "frequency": 100000000
  },
  "rtc": {
    "enabled": true,
    "type": "ds3231",
    "i2c_device": "/dev/i2c-1"
  },
  "usb": {
    "enabled": true
  }
}

Module Operation

GPS Tab

  1. Click Connect to connect to GPS module
  2. Wait for GPS fix (status will turn green)
  3. View real-time position, satellites, and speed
  4. Click Start Logging to save NMEA data to file
  5. Logged data saved in standard NMEA format

LoRa Tab

  1. Click Initialize LoRa to start LoRa radio
  2. Configure frequency, spreading factor, and power
  3. Click Apply Configuration to update settings
  4. Type message and click Send Message to transmit
  5. Click Start Listening to receive messages
  6. Received messages appear in log with RSSI/SNR

RTL-SDR Tab

  1. Click Initialize SDR to start RTL-SDR
  2. Set desired frequency and sample rate
  3. Click Apply Settings to update
  4. Click Start Capture to begin reception
  5. Spectrum display shows real-time waterfall (if pyqtgraph installed)

RTC Tab

  1. Click Connect RTC to initialize real-time clock
  2. View current date and time
  3. View temperature (DS3231 only)
  4. Set time manually or sync from system
  5. Configure alarms (future enhancement)

USB Tab

  1. View all connected USB devices
  2. See vendor/product IDs and descriptions
  3. Click Refresh to rescan devices
  4. Device power management (future enhancement)

Keyboard Shortcuts

  • F5 - Rescan devices
  • F11 - Toggle fullscreen
  • Ctrl+Q - Quit application

Menu Options

File Menu

  • Open Configuration - Load configuration from file
  • Save Configuration - Save current settings
  • Exit - Close application

View Menu

  • Fullscreen - Toggle fullscreen mode

Tools Menu

  • Settings - Open configuration dialog
  • Rescan Devices - Refresh all hardware connections

Help Menu

  • About - Application information
  • Documentation - Quick help guide

Troubleshooting

GPS Not Connecting

# Check device exists
ls -l /dev/ttyUSB*

# Check permissions
sudo usermod -a -G dialout $USER
# Logout and login

# Test with screen
screen /dev/ttyUSB0 9600

LoRa Not Working

# Check SPI is enabled
ls -l /dev/spidev*

# Enable SPI (Raspberry Pi)
sudo raspi-config
# Interface Options > SPI > Enable

RTC Not Responding

# Check I2C devices
i2cdetect -y 1

# Should show 0x68 for DS3231
# Enable I2C if not visible
sudo raspi-config
# Interface Options > I2C > Enable

USB Devices Not Showing

# Install pyusb
pip3 install pyusb

# Check USB devices from command line
lsusb

# Fix permissions
sudo usermod -a -G plugdev $USER

Permission Denied Errors

All hardware access requires appropriate permissions:

# Add to all required groups
sudo usermod -a -G dialout,i2c,spi,plugdev,gpio $USER

# Logout and login for changes to take effect

# Or run with sudo (not recommended for regular use)
sudo ./run.sh

Python Module Not Found

If you see "ModuleNotFoundError" errors:

# Make sure you're using the run.sh script (not python3 main.py directly)
./run.sh

# Or activate the virtual environment manually
source venv/bin/activate
python3 main.py
deactivate

PEP 668 / Externally Managed Environment

On newer systems (Debian 12+, Ubuntu 23.04+, Raspberry Pi OS Bookworm+), Python enforces PEP 668 which prevents system-wide pip installations. This is why we use a virtual environment. If you see this error:

error: externally-managed-environment

Solution: Use the provided install.sh script which creates a virtual environment automatically, or follow the manual installation instructions to create one yourself. Do not use --break-system-packages as it can damage your system.

Development

Project Structure

hardware-control-center/
├── main.py                    # Main application entry point
├── gui/                       # GUI modules
│   ├── __init__.py
│   ├── gps_panel.py          # GPS control panel
│   ├── lora_panel.py         # LoRa control panel
│   ├── rtc_panel.py          # RTC control panel
│   ├── rtlsdr_panel.py       # RTL-SDR control panel
│   ├── usb_panel.py          # USB management panel
│   └── config_dialog.py      # Configuration dialog
├── modules/                   # Hardware interface modules
├── utils/                     # Utility functions
├── resources/                 # Icons and images
├── configs/                   # Configuration files
├── requirements.txt           # Python dependencies
└── README.md                  # This file

Adding New Features

To add a new module panel:

  1. Create new panel file in gui/ directory
  2. Inherit from QWidget
  3. Implement initialize(), get_config(), apply_config(), cleanup() methods
  4. Add to main.py tab widget

Example:

from PyQt5.QtWidgets import QWidget, QVBoxLayout, QLabel

class MyPanel(QWidget):
    def __init__(self, config):
        super().__init__()
        self.config = config
        self.init_ui()

    def init_ui(self):
        layout = QVBoxLayout()
        layout.addWidget(QLabel("My Panel"))
        self.setLayout(layout)

    def initialize(self):
        # Initialize hardware
        pass

    def get_config(self):
        return self.config

    def apply_config(self, config):
        self.config = config

    def cleanup(self):
        # Cleanup resources
        pass

Hardware Requirements

Minimum

  • CPU: ARM Cortex-A7 or better (Raspberry Pi 3+)
  • RAM: 1GB
  • OS: Linux with Python 3.7+
  • Display: 800x600 minimum

Recommended

  • CPU: ARM Cortex-A72 or better (Raspberry Pi 4)
  • RAM: 2GB+
  • OS: Raspberry Pi OS (Debian-based)
  • Display: 1024x768 or higher

Supported Hardware

  • GPS: Any NMEA-compatible GPS (USB or UART)
  • LoRa: SX1276/SX1278-based modules (SPI)
  • RTL-SDR: RTL2832U-based SDR dongles
  • RTC: DS3231, DS1307, PCF8523, RV3028 (I2C)
  • USB: Built-in USB host

License

MIT License - Free to use for commercial and personal projects.

Related Projects

Support

For issues, questions, or contributions:

  1. Check the troubleshooting section above
  2. Review module-specific documentation
  3. Check system logs: dmesg | tail
  4. Verify hardware connections

Credits

Built with:

  • PyQt5 - GUI framework
  • pyserial - Serial communication
  • pyusb - USB device access
  • pynmea2 - GPS NMEA parsing

Version History

1.0.0 (2025-11-18)

  • Initial release
  • Support for GPS, LoRa, RTL-SDR, RTC, USB modules
  • JSON configuration
  • Dark theme UI
  • Real-time data display

About

Comprehensive hardware control center for uConsole - GPS, LoRa, RTL-SDR, RTC, and USB management with PyQt5 GUI

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages