mirror of
https://github.com/ChuckBuilds/LEDMatrix.git
synced 2026-04-10 13:02:59 +00:00
Docs/consolidate documentation (#217)
* docs: rename FONT_MANAGER_USAGE.md to FONT_MANAGER.md Renamed for clearer naming convention. Part of documentation consolidation effort. * docs: consolidate Plugin Store guides (2→1) Merged: - PLUGIN_STORE_USER_GUIDE.md - PLUGIN_STORE_QUICK_REFERENCE.md Into: PLUGIN_STORE_GUIDE.md - Unified writing style to professional technical - Added Quick Reference section at top for easy access - Removed duplicate content - Added cross-references to related documentation - Updated formatting to match style guidelines * docs: create user-focused Web Interface Guide Created WEB_INTERFACE_GUIDE.md consolidating: - V3_INTERFACE_README.md (technical details) - User-facing interface documentation - Focused on end-user tasks and navigation - Removed technical implementation details - Added common tasks section - Included troubleshooting - Professional technical writing style * docs: consolidate WiFi setup guides (4→1) Merged: - WIFI_SETUP.md - OPTIMAL_WIFI_AP_FAILOVER_SETUP.md - AP_MODE_MANUAL_ENABLE.md - WIFI_ETHERNET_AP_MODE_FIX.md (behavior documentation) Into: WIFI_NETWORK_SETUP.md - Comprehensive coverage of WiFi setup and configuration - Clear explanation of AP mode failover and grace period - Configuration scenarios and best practices - Troubleshooting section combining all sources - Professional technical writing style - Added quick reference table for behavior * docs: consolidate troubleshooting guides (4→1) Merged: - TROUBLESHOOTING_QUICK_START.md - WEB_INTERFACE_TROUBLESHOOTING.md - CAPTIVE_PORTAL_TROUBLESHOOTING.md - WEATHER_TROUBLESHOOTING.md Into: TROUBLESHOOTING.md - Organized by issue category (web, WiFi, plugins) - Comprehensive diagnostic commands reference - Quick diagnosis steps at the top - Service file template preserved - Complete diagnostic script included - Professional technical writing style * docs: create consolidated Advanced Features guide Merged: - VEGAS_SCROLL_MODE.md - ON_DEMAND_DISPLAY_QUICK_START.md - ON_DEMAND_DISPLAY_API.md - ON_DEMAND_CACHE_MANAGEMENT.md - BACKGROUND_SERVICE_README.md - PERMISSION_MANAGEMENT_GUIDE.md Into: ADVANCED_FEATURES.md - Comprehensive guide covering all advanced features - Vegas scroll mode with integration examples - On-demand display with API reference - Cache management troubleshooting - Background service documentation - Permission management patterns - Professional technical writing style * docs: create Getting Started guide for first-time users Created GETTING_STARTED.md: - Quick start guide (5 minutes) - Initial configuration walkthrough - Common first-time issues and solutions - Next steps and quick reference - User-friendly tone for beginners - Links to detailed documentation * docs: archive consolidated source files and ephemeral docs Archived files that have been consolidated: - Plugin Store guides (2 files → PLUGIN_STORE_GUIDE.md) - Web Interface guide (V3_INTERFACE_README.md → WEB_INTERFACE_GUIDE.md) - WiFi Setup guides (4 files → WIFI_NETWORK_SETUP.md) - Troubleshooting guides (4 files → TROUBLESHOOTING.md) - Advanced Features (6 files → ADVANCED_FEATURES.md) Archived ephemeral/debug documentation: - DEBUG_WEB_ISSUE.md - BROWSER_ERRORS_EXPLANATION.md - FORM_VALIDATION_FIXES.md - WEB_UI_RELIABILITY_IMPROVEMENTS.md - CAPTIVE_PORTAL_TESTING.md - NEXT_STEPS_COMMANDS.md - STATIC_IMAGE_MULTI_UPLOAD_PLAN.md - RECONNECT_AFTER_CAPTIVE_PORTAL_TESTING.md Archived implementation summaries: - PLUGIN_CONFIG_TABS_SUMMARY.md - PLUGIN_CONFIG_SYSTEM_VERIFICATION.md - PLUGIN_SCHEMA_AUDIT_SUMMARY.md - STARTUP_OPTIMIZATION_SUMMARY.md - PLUGIN_DISPATCH_IMPLEMENTATION.md - NESTED_SCHEMA_IMPLEMENTATION.md - AP_MODE_MANUAL_ENABLE_CHANGES.md - PLUGIN_CONFIG_SYSTEM_EXPLANATION.md Total archived: 27 files Preserves git history while cleaning up main docs directory * docs: rename API_REFERENCE.md to REST_API_REFERENCE.md Renamed for clarity - this is specifically the REST API reference for the web interface, not a general API reference. * docs: update README.md to reflect consolidated documentation structure Updated documentation index: - Reflects new consolidated guides (51 → 16-17 files) - Updated Quick Start sections with new file names - Added consolidation history (January 2026) - Updated file references (API_REFERENCE → REST_API_REFERENCE) - Documented archival of 33 files - Added benefits of consolidation - Updated statistics and highlights - Removed outdated references - Professional writing style maintained throughout * docs: add Vegas scroll mode system architecture documentation Added comprehensive internal architecture section for Vegas mode: - Component overview with diagram - VegasModeCoordinator responsibilities and main loop - StreamManager buffering strategy and content flow - PluginAdapter integration and fallback behavior - RenderPipeline 125 FPS rendering process - Component interaction flows - Thread safety patterns - Performance characteristics Covers: - How the four components work together - Initialization and render loop flows - Config update handling - Frame rate management and optimization - Memory usage and CPU characteristics --------- Co-authored-by: Chuck <chuck@example.com>
This commit is contained in:
1032
docs/ADVANCED_FEATURES.md
Normal file
1032
docs/ADVANCED_FEATURES.md
Normal file
File diff suppressed because it is too large
Load Diff
324
docs/GETTING_STARTED.md
Normal file
324
docs/GETTING_STARTED.md
Normal file
@@ -0,0 +1,324 @@
|
||||
# Getting Started with LEDMatrix
|
||||
|
||||
## Welcome
|
||||
|
||||
This guide will help you set up your LEDMatrix display for the first time and get it running in under 30 minutes.
|
||||
|
||||
---
|
||||
|
||||
## Prerequisites
|
||||
|
||||
**Hardware:**
|
||||
- Raspberry Pi (3, 4, or 5 recommended)
|
||||
- RGB LED Matrix panel (32x64 or 64x64)
|
||||
- Adafruit RGB Matrix HAT or similar
|
||||
- Power supply (5V, 4A minimum recommended)
|
||||
- MicroSD card (16GB minimum)
|
||||
|
||||
**Network:**
|
||||
- WiFi network (or Ethernet cable)
|
||||
- Computer with web browser on same network
|
||||
|
||||
---
|
||||
|
||||
## Quick Start (5 Minutes)
|
||||
|
||||
### 1. First Boot
|
||||
|
||||
1. Insert the MicroSD card with LEDMatrix installed
|
||||
2. Connect the LED matrix to your Raspberry Pi
|
||||
3. Plug in the power supply
|
||||
4. Wait for the Pi to boot (about 60 seconds)
|
||||
|
||||
**Expected Behavior:**
|
||||
- LED matrix will light up
|
||||
- Display will show default plugins (clock, weather, etc.)
|
||||
- Pi creates WiFi network "LEDMatrix-Setup" if not connected
|
||||
|
||||
### 2. Connect to WiFi
|
||||
|
||||
**If you see "LEDMatrix-Setup" WiFi network:**
|
||||
1. Connect your device to "LEDMatrix-Setup" (open network, no password)
|
||||
2. Open browser to: `http://192.168.4.1:5050`
|
||||
3. Navigate to the WiFi tab
|
||||
4. Click "Scan" to find your WiFi network
|
||||
5. Select your network, enter password
|
||||
6. Click "Connect"
|
||||
7. Wait for connection (LED matrix will show confirmation)
|
||||
|
||||
**If already connected to WiFi:**
|
||||
1. Find your Pi's IP address (check your router, or run `hostname -I` on the Pi)
|
||||
2. Open browser to: `http://your-pi-ip:5050`
|
||||
|
||||
### 3. Access the Web Interface
|
||||
|
||||
Once connected, access the web interface:
|
||||
|
||||
```
|
||||
http://your-pi-ip:5050
|
||||
```
|
||||
|
||||
You should see:
|
||||
- Overview tab with system stats
|
||||
- Live display preview
|
||||
- Quick action buttons
|
||||
|
||||
---
|
||||
|
||||
## Initial Configuration (15 Minutes)
|
||||
|
||||
### Step 1: Configure Display Hardware
|
||||
|
||||
1. Navigate to Settings → **Display Settings**
|
||||
2. Set your matrix configuration:
|
||||
- **Rows**: 32 or 64 (match your hardware)
|
||||
- **Columns**: 64, 128, or 256 (match your hardware)
|
||||
- **Chain Length**: Number of panels chained together
|
||||
- **Brightness**: 50-75% recommended for indoor use
|
||||
3. Click **Save Configuration**
|
||||
4. Click **Restart Display** to apply changes
|
||||
|
||||
**Tip:** If the display doesn't look right, try different hardware mapping options.
|
||||
|
||||
### Step 2: Set Timezone and Location
|
||||
|
||||
1. Navigate to Settings → **General Settings**
|
||||
2. Set your timezone (e.g., "America/New_York")
|
||||
3. Set your location (city, state, country)
|
||||
4. Click **Save Configuration**
|
||||
|
||||
**Why it matters:** Correct timezone ensures accurate time display. Location enables weather and location-based features.
|
||||
|
||||
### Step 3: Install Plugins
|
||||
|
||||
1. Navigate to **Plugin Store** tab
|
||||
2. Browse available plugins:
|
||||
- **Time & Date**: Clock, calendar
|
||||
- **Weather**: Weather forecasts
|
||||
- **Sports**: NHL, NBA, NFL, MLB scores
|
||||
- **Finance**: Stocks, crypto
|
||||
- **Custom**: Community plugins
|
||||
3. Click **Install** on desired plugins
|
||||
4. Wait for installation to complete
|
||||
5. Navigate to **Plugin Management** tab
|
||||
6. Enable installed plugins (toggle switch)
|
||||
7. Click **Restart Display**
|
||||
|
||||
**Popular First Plugins:**
|
||||
- `clock-simple` - Simple digital clock
|
||||
- `weather` - Weather forecast
|
||||
- `nhl-scores` - NHL scores (if you're a hockey fan)
|
||||
|
||||
### Step 4: Configure Plugins
|
||||
|
||||
1. Navigate to **Plugin Management** tab
|
||||
2. Find a plugin you installed
|
||||
3. Click the ⚙️ **Configure** button
|
||||
4. Edit settings (e.g., favorite teams, update intervals)
|
||||
5. Click **Save**
|
||||
6. Click **Restart Display**
|
||||
|
||||
**Example: Weather Plugin**
|
||||
- Set your location (city, state, country)
|
||||
- Add API key from OpenWeatherMap (free signup)
|
||||
- Set update interval (300 seconds recommended)
|
||||
|
||||
---
|
||||
|
||||
## Testing Your Display
|
||||
|
||||
### Quick Test
|
||||
|
||||
1. Navigate to **Overview** tab
|
||||
2. Click **Test Display** button
|
||||
3. You should see a test pattern on your LED matrix
|
||||
|
||||
### Manual Plugin Trigger
|
||||
|
||||
1. Navigate to **Plugin Management** tab
|
||||
2. Find a plugin
|
||||
3. Click **Show Now** button
|
||||
4. The plugin should display immediately
|
||||
5. Click **Stop** to return to rotation
|
||||
|
||||
### Check Logs
|
||||
|
||||
1. Navigate to **Logs** tab
|
||||
2. Watch real-time logs
|
||||
3. Look for any ERROR messages
|
||||
4. Normal operation shows INFO messages about plugin rotation
|
||||
|
||||
---
|
||||
|
||||
## Common First-Time Issues
|
||||
|
||||
### Display Not Showing Anything
|
||||
|
||||
**Check:**
|
||||
1. Power supply connected and adequate (5V, 4A minimum)
|
||||
2. LED matrix connected to GPIO pins correctly
|
||||
3. Display service running: `sudo systemctl status ledmatrix`
|
||||
4. Hardware configuration matches your matrix (rows/columns)
|
||||
|
||||
**Fix:**
|
||||
1. Restart display: Settings → Overview → Restart Display
|
||||
2. Or via SSH: `sudo systemctl restart ledmatrix`
|
||||
|
||||
### Web Interface Won't Load
|
||||
|
||||
**Check:**
|
||||
1. Pi is connected to network: `ping your-pi-ip`
|
||||
2. Web service running: `sudo systemctl status ledmatrix-web`
|
||||
3. Correct port: Use `:5050` not `:5000`
|
||||
4. Firewall not blocking port 5050
|
||||
|
||||
**Fix:**
|
||||
1. Restart web service: `sudo systemctl restart ledmatrix-web`
|
||||
2. Check logs: `sudo journalctl -u ledmatrix-web -n 50`
|
||||
|
||||
### Plugins Not Showing
|
||||
|
||||
**Check:**
|
||||
1. Plugins are enabled (toggle switch in Plugin Management)
|
||||
2. Display has been restarted after enabling
|
||||
3. Plugin duration is reasonable (not too short)
|
||||
4. No errors in logs for the plugin
|
||||
|
||||
**Fix:**
|
||||
1. Enable plugin in Plugin Management
|
||||
2. Restart display
|
||||
3. Check logs for plugin-specific errors
|
||||
|
||||
### Weather Plugin Shows "No Data"
|
||||
|
||||
**Check:**
|
||||
1. API key configured (OpenWeatherMap)
|
||||
2. Location is correct (city, state, country)
|
||||
3. Internet connection working
|
||||
|
||||
**Fix:**
|
||||
1. Sign up at openweathermap.org (free)
|
||||
2. Add API key to config_secrets.json or plugin config
|
||||
3. Restart display
|
||||
|
||||
---
|
||||
|
||||
## Next Steps
|
||||
|
||||
### Customize Your Display
|
||||
|
||||
**Adjust Display Durations:**
|
||||
- Navigate to Settings → Durations
|
||||
- Set how long each plugin displays
|
||||
- Save and restart
|
||||
|
||||
**Organize Plugin Order:**
|
||||
- Use Plugin Management to enable/disable plugins
|
||||
- Display cycles through enabled plugins in order
|
||||
|
||||
**Add More Plugins:**
|
||||
- Check Plugin Store regularly for new plugins
|
||||
- Install from GitHub URLs for custom/community plugins
|
||||
|
||||
### Enable Advanced Features
|
||||
|
||||
**Vegas Scroll Mode:**
|
||||
- Continuous scrolling ticker display
|
||||
- See [ADVANCED_FEATURES.md](ADVANCED_FEATURES.md) for details
|
||||
|
||||
**On-Demand Display:**
|
||||
- Manually trigger specific plugins
|
||||
- Pin important information
|
||||
- See [ADVANCED_FEATURES.md](ADVANCED_FEATURES.md) for details
|
||||
|
||||
**Background Services:**
|
||||
- Non-blocking data fetching
|
||||
- Faster plugin rotation
|
||||
- See [ADVANCED_FEATURES.md](ADVANCED_FEATURES.md) for details
|
||||
|
||||
### Explore Documentation
|
||||
|
||||
- [WEB_INTERFACE_GUIDE.md](WEB_INTERFACE_GUIDE.md) - Complete web interface guide
|
||||
- [WIFI_NETWORK_SETUP.md](WIFI_NETWORK_SETUP.md) - WiFi configuration details
|
||||
- [PLUGIN_STORE_GUIDE.md](PLUGIN_STORE_GUIDE.md) - Installing and managing plugins
|
||||
- [TROUBLESHOOTING.md](TROUBLESHOOTING.md) - Solving common issues
|
||||
- [ADVANCED_FEATURES.md](ADVANCED_FEATURES.md) - Advanced functionality
|
||||
|
||||
### Join the Community
|
||||
|
||||
- Report issues on GitHub
|
||||
- Share your custom plugins
|
||||
- Help others in discussions
|
||||
- Contribute improvements
|
||||
|
||||
---
|
||||
|
||||
## Quick Reference
|
||||
|
||||
### Service Commands
|
||||
|
||||
```bash
|
||||
# Check status
|
||||
sudo systemctl status ledmatrix
|
||||
sudo systemctl status ledmatrix-web
|
||||
|
||||
# Restart services
|
||||
sudo systemctl restart ledmatrix
|
||||
sudo systemctl restart ledmatrix-web
|
||||
|
||||
# View logs
|
||||
sudo journalctl -u ledmatrix -f
|
||||
sudo journalctl -u ledmatrix-web -f
|
||||
```
|
||||
|
||||
### File Locations
|
||||
|
||||
```
|
||||
/home/ledpi/LEDMatrix/
|
||||
├── config/
|
||||
│ ├── config.json # Main configuration
|
||||
│ ├── config_secrets.json # API keys and secrets
|
||||
│ └── wifi_config.json # WiFi settings
|
||||
├── plugins/ # Installed plugins
|
||||
├── cache/ # Cached data
|
||||
└── web_interface/ # Web interface files
|
||||
```
|
||||
|
||||
### Web Interface
|
||||
|
||||
```
|
||||
Main Interface: http://your-pi-ip:5050
|
||||
|
||||
Tabs:
|
||||
- Overview: System stats and quick actions
|
||||
- General Settings: Timezone, location, autostart
|
||||
- Display Settings: Hardware configuration
|
||||
- Durations: Plugin display times
|
||||
- Sports Configuration: Per-league settings
|
||||
- Plugin Management: Enable/disable, configure
|
||||
- Plugin Store: Install new plugins
|
||||
- Font Management: Upload and manage fonts
|
||||
- Logs: Real-time log viewing
|
||||
```
|
||||
|
||||
### WiFi Access Point
|
||||
|
||||
```
|
||||
Network Name: LEDMatrix-Setup
|
||||
Password: (none - open network)
|
||||
URL when connected: http://192.168.4.1:5050
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Congratulations!
|
||||
|
||||
Your LEDMatrix display is now set up and running. Explore the web interface, try different plugins, and customize it to your liking.
|
||||
|
||||
**Need Help?**
|
||||
- Check [TROUBLESHOOTING.md](TROUBLESHOOTING.md)
|
||||
- Review detailed guides for specific features
|
||||
- Report issues on GitHub
|
||||
- Ask questions in community discussions
|
||||
|
||||
Enjoy your LED matrix display!
|
||||
493
docs/PLUGIN_STORE_GUIDE.md
Normal file
493
docs/PLUGIN_STORE_GUIDE.md
Normal file
@@ -0,0 +1,493 @@
|
||||
# Plugin Store Guide
|
||||
|
||||
## Overview
|
||||
|
||||
The LEDMatrix Plugin Store allows you to discover, install, and manage display plugins for your LED matrix. Install curated plugins from the official registry or add custom plugins directly from any GitHub repository.
|
||||
|
||||
---
|
||||
|
||||
## Quick Reference
|
||||
|
||||
### Install from Store
|
||||
```bash
|
||||
# Web UI: Plugin Store → Search → Click Install
|
||||
# API:
|
||||
curl -X POST http://your-pi-ip:5050/api/plugins/install \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{"plugin_id": "clock-simple"}'
|
||||
```
|
||||
|
||||
### Install from GitHub URL
|
||||
```bash
|
||||
# Web UI: Plugin Store → "Install from URL" → Paste URL
|
||||
# API:
|
||||
curl -X POST http://your-pi-ip:5050/api/plugins/install-from-url \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{"repo_url": "https://github.com/user/ledmatrix-plugin"}'
|
||||
```
|
||||
|
||||
### Manage Plugins
|
||||
```bash
|
||||
# List installed
|
||||
curl "http://your-pi-ip:5050/api/plugins/installed"
|
||||
|
||||
# Enable/disable
|
||||
curl -X POST http://your-pi-ip:5050/api/plugins/toggle \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{"plugin_id": "clock-simple", "enabled": true}'
|
||||
|
||||
# Update
|
||||
curl -X POST http://your-pi-ip:5050/api/plugins/update \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{"plugin_id": "clock-simple"}'
|
||||
|
||||
# Uninstall
|
||||
curl -X POST http://your-pi-ip:5050/api/plugins/uninstall \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{"plugin_id": "clock-simple"}'
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Installation Methods
|
||||
|
||||
### Method 1: From Official Plugin Store (Recommended)
|
||||
|
||||
The official plugin store contains curated, verified plugins that have been reviewed by maintainers.
|
||||
|
||||
**Via Web Interface:**
|
||||
1. Open the web interface at http://your-pi-ip:5050
|
||||
2. Navigate to the "Plugin Store" tab
|
||||
3. Browse or search for plugins
|
||||
4. Click "Install" on the desired plugin
|
||||
5. Wait for installation to complete
|
||||
6. Restart the display to activate the plugin
|
||||
|
||||
**Via REST API:**
|
||||
```bash
|
||||
curl -X POST http://your-pi-ip:5050/api/plugins/install \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{"plugin_id": "clock-simple"}'
|
||||
```
|
||||
|
||||
**Via Python:**
|
||||
```python
|
||||
from src.plugin_system.store_manager import PluginStoreManager
|
||||
|
||||
store = PluginStoreManager()
|
||||
success = store.install_plugin('clock-simple')
|
||||
if success:
|
||||
print("Plugin installed!")
|
||||
```
|
||||
|
||||
### Method 2: From Custom GitHub URL
|
||||
|
||||
Install any plugin directly from a GitHub repository, even if it's not in the official store. This method is useful for:
|
||||
- Testing your own plugins during development
|
||||
- Installing community plugins before they're in the official store
|
||||
- Using private plugins
|
||||
- Sharing plugins with specific users
|
||||
|
||||
**Via Web Interface:**
|
||||
1. Open the web interface
|
||||
2. Navigate to the "Plugin Store" tab
|
||||
3. Find the "Install from URL" section
|
||||
4. Paste the GitHub repository URL (e.g., `https://github.com/user/ledmatrix-my-plugin`)
|
||||
5. Click "Install from URL"
|
||||
6. Review the warning about unverified plugins
|
||||
7. Confirm installation
|
||||
8. Wait for installation to complete
|
||||
9. Restart the display
|
||||
|
||||
**Via REST API:**
|
||||
```bash
|
||||
curl -X POST http://your-pi-ip:5050/api/plugins/install-from-url \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{"repo_url": "https://github.com/user/ledmatrix-my-plugin"}'
|
||||
```
|
||||
|
||||
**Via Python:**
|
||||
```python
|
||||
from src.plugin_system.store_manager import PluginStoreManager
|
||||
|
||||
store = PluginStoreManager()
|
||||
result = store.install_from_url('https://github.com/user/ledmatrix-my-plugin')
|
||||
|
||||
if result['success']:
|
||||
print(f"Installed: {result['plugin_id']}")
|
||||
else:
|
||||
print(f"Error: {result['error']}")
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Searching for Plugins
|
||||
|
||||
**Via Web Interface:**
|
||||
- Use the search bar to search by name, description, or author
|
||||
- Filter by category (sports, weather, time, finance, etc.)
|
||||
- Click on tags to filter by specific tags
|
||||
|
||||
**Via REST API:**
|
||||
```bash
|
||||
# Search by query
|
||||
curl "http://your-pi-ip:5050/api/plugins/store/search?q=hockey"
|
||||
|
||||
# Filter by category
|
||||
curl "http://your-pi-ip:5050/api/plugins/store/search?category=sports"
|
||||
|
||||
# Filter by tags
|
||||
curl "http://your-pi-ip:5050/api/plugins/store/search?tags=nhl&tags=hockey"
|
||||
```
|
||||
|
||||
**Via Python:**
|
||||
```python
|
||||
from src.plugin_system.store_manager import PluginStoreManager
|
||||
|
||||
store = PluginStoreManager()
|
||||
|
||||
# Search by query
|
||||
results = store.search_plugins(query="hockey")
|
||||
|
||||
# Filter by category
|
||||
results = store.search_plugins(category="sports")
|
||||
|
||||
# Filter by tags
|
||||
results = store.search_plugins(tags=["nhl", "hockey"])
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Managing Installed Plugins
|
||||
|
||||
### List Installed Plugins
|
||||
|
||||
**Via Web Interface:**
|
||||
- Navigate to the "Plugin Manager" tab
|
||||
- View all installed plugins with their status
|
||||
|
||||
**Via REST API:**
|
||||
```bash
|
||||
curl "http://your-pi-ip:5050/api/plugins/installed"
|
||||
```
|
||||
|
||||
**Via Python:**
|
||||
```python
|
||||
from src.plugin_system.store_manager import PluginStoreManager
|
||||
|
||||
store = PluginStoreManager()
|
||||
installed = store.list_installed_plugins()
|
||||
|
||||
for plugin_id in installed:
|
||||
info = store.get_installed_plugin_info(plugin_id)
|
||||
print(f"{info['name']} (Last updated: {info.get('last_updated', 'unknown')})")
|
||||
```
|
||||
|
||||
### Enable/Disable Plugins
|
||||
|
||||
**Via Web Interface:**
|
||||
1. Navigate to the "Plugin Manager" tab
|
||||
2. Use the toggle switch next to each plugin
|
||||
3. Restart the display to apply changes
|
||||
|
||||
**Via REST API:**
|
||||
```bash
|
||||
curl -X POST http://your-pi-ip:5050/api/plugins/toggle \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{"plugin_id": "clock-simple", "enabled": true}'
|
||||
```
|
||||
|
||||
### Update Plugins
|
||||
|
||||
**Via Web Interface:**
|
||||
1. Navigate to the "Plugin Manager" tab
|
||||
2. Click the "Update" button next to the plugin
|
||||
3. Wait for the update to complete
|
||||
4. Restart the display
|
||||
|
||||
**Via REST API:**
|
||||
```bash
|
||||
curl -X POST http://your-pi-ip:5050/api/plugins/update \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{"plugin_id": "clock-simple"}'
|
||||
```
|
||||
|
||||
**Via Python:**
|
||||
```python
|
||||
from src.plugin_system.store_manager import PluginStoreManager
|
||||
|
||||
store = PluginStoreManager()
|
||||
success = store.update_plugin('clock-simple')
|
||||
```
|
||||
|
||||
### Uninstall Plugins
|
||||
|
||||
**Via Web Interface:**
|
||||
1. Navigate to the "Plugin Manager" tab
|
||||
2. Click the "Uninstall" button next to the plugin
|
||||
3. Confirm removal
|
||||
4. Restart the display
|
||||
|
||||
**Via REST API:**
|
||||
```bash
|
||||
curl -X POST http://your-pi-ip:5050/api/plugins/uninstall \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{"plugin_id": "clock-simple"}'
|
||||
```
|
||||
|
||||
**Via Python:**
|
||||
```python
|
||||
from src.plugin_system.store_manager import PluginStoreManager
|
||||
|
||||
store = PluginStoreManager()
|
||||
success = store.uninstall_plugin('clock-simple')
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Configuring Plugins
|
||||
|
||||
Each plugin can have its own configuration in `config/config.json`:
|
||||
|
||||
```json
|
||||
{
|
||||
"clock-simple": {
|
||||
"enabled": true,
|
||||
"display_duration": 15,
|
||||
"color": [255, 255, 255],
|
||||
"time_format": "12h"
|
||||
},
|
||||
"nhl-scores": {
|
||||
"enabled": true,
|
||||
"favorite_teams": ["TBL", "FLA"],
|
||||
"show_favorite_teams_only": true
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
**Via Web Interface:**
|
||||
1. Navigate to the "Plugin Manager" tab
|
||||
2. Click the Configure (⚙️) button next to the plugin
|
||||
3. Edit the configuration in the form
|
||||
4. Save changes
|
||||
5. Restart the display to apply changes
|
||||
|
||||
---
|
||||
|
||||
## Safety and Security
|
||||
|
||||
### Verified vs Unverified Plugins
|
||||
|
||||
- **Verified Plugins**: Reviewed by maintainers, follow best practices, no known security issues
|
||||
- **Unverified Plugins**: User-contributed, not reviewed, install at your own risk
|
||||
|
||||
When installing from a custom GitHub URL, you'll see a warning about installing an unverified plugin. The plugin will have access to your display manager, cache manager, configuration files, and network access.
|
||||
|
||||
### Best Practices
|
||||
|
||||
1. Only install plugins from trusted sources
|
||||
2. Review plugin code before installing (click "View on GitHub")
|
||||
3. Keep plugins updated for security patches
|
||||
4. Report suspicious plugins to maintainers
|
||||
|
||||
---
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Plugin Won't Install
|
||||
|
||||
**Problem:** Installation fails with "Failed to clone or download repository"
|
||||
|
||||
**Solutions:**
|
||||
- Check that git is installed: `which git`
|
||||
- Verify the GitHub URL is correct
|
||||
- Check your internet connection
|
||||
- The system will automatically try ZIP download as fallback
|
||||
|
||||
### Plugin Won't Load
|
||||
|
||||
**Problem:** Plugin installed but doesn't appear in rotation
|
||||
|
||||
**Solutions:**
|
||||
1. Check that the plugin is enabled in config: `"enabled": true`
|
||||
2. Verify manifest.json exists and is valid
|
||||
3. Check logs for errors: `sudo journalctl -u ledmatrix -f`
|
||||
4. Restart the display service: `sudo systemctl restart ledmatrix`
|
||||
|
||||
### Dependencies Failed
|
||||
|
||||
**Problem:** "Error installing dependencies" message
|
||||
|
||||
**Solutions:**
|
||||
- Check that pip3 is installed
|
||||
- Manually install: `pip3 install --break-system-packages -r plugins/plugin-id/requirements.txt`
|
||||
- Check for conflicting package versions
|
||||
|
||||
### Plugin Shows Errors
|
||||
|
||||
**Problem:** Plugin loads but shows error message on display
|
||||
|
||||
**Solutions:**
|
||||
1. Check that the plugin configuration is correct
|
||||
2. Verify API keys are set (if the plugin requires them)
|
||||
3. Check plugin logs: `sudo journalctl -u ledmatrix -f | grep plugin-id`
|
||||
4. Report the issue to the plugin developer on GitHub
|
||||
|
||||
---
|
||||
|
||||
## API Reference
|
||||
|
||||
All API endpoints return JSON with this structure:
|
||||
|
||||
```json
|
||||
{
|
||||
"status": "success" | "error",
|
||||
"message": "Human-readable message",
|
||||
"data": { ... }
|
||||
}
|
||||
```
|
||||
|
||||
### Endpoints
|
||||
|
||||
| Method | Endpoint | Description |
|
||||
|--------|----------|-------------|
|
||||
| GET | `/api/plugins/store/list` | List all plugins in store |
|
||||
| GET | `/api/plugins/store/search` | Search for plugins |
|
||||
| GET | `/api/plugins/installed` | List installed plugins |
|
||||
| POST | `/api/plugins/install` | Install from registry |
|
||||
| POST | `/api/plugins/install-from-url` | Install from GitHub URL |
|
||||
| POST | `/api/plugins/uninstall` | Uninstall plugin |
|
||||
| POST | `/api/plugins/update` | Update plugin |
|
||||
| POST | `/api/plugins/toggle` | Enable/disable plugin |
|
||||
| POST | `/api/plugins/config` | Update plugin config |
|
||||
|
||||
---
|
||||
|
||||
## Examples
|
||||
|
||||
### Example 1: Install Clock Plugin
|
||||
|
||||
```bash
|
||||
# Install
|
||||
curl -X POST http://192.168.1.100:5050/api/plugins/install \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{"plugin_id": "clock-simple"}'
|
||||
|
||||
# Configure in config/config.json
|
||||
{
|
||||
"clock-simple": {
|
||||
"enabled": true,
|
||||
"display_duration": 20,
|
||||
"time_format": "24h"
|
||||
}
|
||||
}
|
||||
|
||||
# Restart display
|
||||
sudo systemctl restart ledmatrix
|
||||
```
|
||||
|
||||
### Example 2: Install Custom Plugin from GitHub
|
||||
|
||||
```bash
|
||||
# Install your own plugin during development
|
||||
curl -X POST http://192.168.1.100:5050/api/plugins/install-from-url \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{"repo_url": "https://github.com/myusername/ledmatrix-my-custom-plugin"}'
|
||||
|
||||
# Enable it
|
||||
curl -X POST http://192.168.1.100:5050/api/plugins/toggle \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{"plugin_id": "my-custom-plugin", "enabled": true}'
|
||||
|
||||
# Restart
|
||||
sudo systemctl restart ledmatrix
|
||||
```
|
||||
|
||||
### Example 3: Share Plugin with Others
|
||||
|
||||
As a plugin developer, you can share your plugin with others even before it's in the official store:
|
||||
|
||||
1. Push your plugin to GitHub: `https://github.com/yourusername/ledmatrix-awesome-plugin`
|
||||
2. Share the URL with users
|
||||
3. Users install via:
|
||||
- Open the LEDMatrix web interface
|
||||
- Click "Plugin Store" tab
|
||||
- Scroll to "Install from URL"
|
||||
- Paste the URL
|
||||
- Click "Install from URL"
|
||||
|
||||
---
|
||||
|
||||
## Command-Line Usage
|
||||
|
||||
For advanced users, manage plugins via command line:
|
||||
|
||||
```bash
|
||||
# Install from registry
|
||||
python3 -c "
|
||||
from src.plugin_system.store_manager import PluginStoreManager
|
||||
store = PluginStoreManager()
|
||||
store.install_plugin('clock-simple')
|
||||
"
|
||||
|
||||
# Install from URL
|
||||
python3 -c "
|
||||
from src.plugin_system.store_manager import PluginStoreManager
|
||||
store = PluginStoreManager()
|
||||
result = store.install_from_url('https://github.com/user/plugin')
|
||||
print(result)
|
||||
"
|
||||
|
||||
# List installed
|
||||
python3 -c "
|
||||
from src.plugin_system.store_manager import PluginStoreManager
|
||||
store = PluginStoreManager()
|
||||
for plugin_id in store.list_installed_plugins():
|
||||
info = store.get_installed_plugin_info(plugin_id)
|
||||
print(f'{plugin_id}: {info[\"name\"]} (Last updated: {info.get(\"last_updated\", \"unknown\")})')
|
||||
"
|
||||
|
||||
# Uninstall
|
||||
python3 -c "
|
||||
from src.plugin_system.store_manager import PluginStoreManager
|
||||
store = PluginStoreManager()
|
||||
store.uninstall_plugin('clock-simple')
|
||||
"
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## FAQ
|
||||
|
||||
**Q: Do I need to restart the display after installing a plugin?**
|
||||
A: Yes, plugins are loaded when the display controller starts.
|
||||
|
||||
**Q: Can I install plugins while the display is running?**
|
||||
A: Yes, you can install anytime, but you must restart the display to load them.
|
||||
|
||||
**Q: What happens if I install a plugin with the same ID as an existing one?**
|
||||
A: The existing copy will be replaced with the latest code from the repository.
|
||||
|
||||
**Q: Can I install multiple versions of the same plugin?**
|
||||
A: No, each plugin ID maps to a single checkout of the repository's default branch.
|
||||
|
||||
**Q: How do I update all plugins at once?**
|
||||
A: Currently, you need to update each plugin individually. Bulk update is planned for a future release.
|
||||
|
||||
**Q: Can plugins access my API keys from config_secrets.json?**
|
||||
A: Yes, if a plugin needs API keys, it can access them like core managers do.
|
||||
|
||||
**Q: How much disk space do plugins use?**
|
||||
A: Most plugins are small (1-5MB). Check individual plugin documentation for specific requirements.
|
||||
|
||||
**Q: Can I create my own plugin?**
|
||||
A: Yes! See [PLUGIN_DEVELOPMENT.md](PLUGIN_DEVELOPMENT.md) for instructions.
|
||||
|
||||
---
|
||||
|
||||
## Related Documentation
|
||||
|
||||
- [PLUGIN_DEVELOPMENT.md](PLUGIN_DEVELOPMENT.md) - Create your own plugins
|
||||
- [PLUGIN_API_REFERENCE.md](PLUGIN_API_REFERENCE.md) - Plugin API documentation
|
||||
- [PLUGIN_ARCHITECTURE.md](PLUGIN_ARCHITECTURE.md) - Plugin system architecture
|
||||
- [REST_API_REFERENCE.md](REST_API_REFERENCE.md) - Complete REST API reference
|
||||
212
docs/README.md
212
docs/README.md
@@ -4,174 +4,196 @@ Welcome to the LEDMatrix documentation! This directory contains comprehensive gu
|
||||
|
||||
## 📚 Documentation Overview
|
||||
|
||||
This documentation has been consolidated and organized to reduce redundancy while maintaining comprehensive coverage. Recent improvements include complete API references, enhanced plugin development guides, and better organization for both end users and developers.
|
||||
This documentation has been recently consolidated (January 2026) to reduce redundancy while maintaining comprehensive coverage. We've reduced from 51 main documents to 16-17 well-organized files (~68% reduction) by merging duplicates, archiving ephemeral content, and unifying writing styles.
|
||||
|
||||
## 📖 Quick Start
|
||||
|
||||
### For New Users
|
||||
1. **Installation**: Follow the main [README.md](../README.md) in the project root
|
||||
2. **First Setup**: Run `first_time_install.sh` for initial configuration
|
||||
3. **Basic Usage**: See [TROUBLESHOOTING_QUICK_START.md](TROUBLESHOOTING_QUICK_START.md) for common issues
|
||||
2. **First Setup**: See [GETTING_STARTED.md](GETTING_STARTED.md) for first-time setup guide
|
||||
3. **Web Interface**: Use [WEB_INTERFACE_GUIDE.md](WEB_INTERFACE_GUIDE.md) to learn the control panel
|
||||
4. **Troubleshooting**: Check [TROUBLESHOOTING.md](TROUBLESHOOTING.md) for common issues
|
||||
|
||||
### For Developers
|
||||
1. **Plugin System**: Read [PLUGIN_QUICK_REFERENCE.md](PLUGIN_QUICK_REFERENCE.md) for an overview
|
||||
2. **Plugin Development**: See [PLUGIN_DEVELOPMENT_GUIDE.md](PLUGIN_DEVELOPMENT_GUIDE.md) for development workflow
|
||||
1. **Plugin Development**: See [PLUGIN_DEVELOPMENT_GUIDE.md](PLUGIN_DEVELOPMENT_GUIDE.md) for complete guide
|
||||
2. **Advanced Patterns**: Read [ADVANCED_PLUGIN_DEVELOPMENT.md](ADVANCED_PLUGIN_DEVELOPMENT.md) for advanced techniques
|
||||
3. **API Reference**: Check [PLUGIN_API_REFERENCE.md](PLUGIN_API_REFERENCE.md) for available methods
|
||||
4. **Configuration**: Check [PLUGIN_CONFIGURATION_GUIDE.md](PLUGIN_CONFIGURATION_GUIDE.md)
|
||||
4. **Configuration**: See [PLUGIN_CONFIGURATION_GUIDE.md](PLUGIN_CONFIGURATION_GUIDE.md) for config schemas
|
||||
|
||||
### For API Integration
|
||||
1. **REST API**: See [API_REFERENCE.md](API_REFERENCE.md) for all web interface endpoints
|
||||
1. **REST API**: See [REST_API_REFERENCE.md](REST_API_REFERENCE.md) for all web interface endpoints
|
||||
2. **Plugin API**: See [PLUGIN_API_REFERENCE.md](PLUGIN_API_REFERENCE.md) for plugin developer APIs
|
||||
3. **Quick Reference**: See [DEVELOPER_QUICK_REFERENCE.md](DEVELOPER_QUICK_REFERENCE.md) for common tasks
|
||||
3. **Developer Reference**: See [DEVELOPER_QUICK_REFERENCE.md](DEVELOPER_QUICK_REFERENCE.md) for common tasks
|
||||
|
||||
## 📋 Documentation Categories
|
||||
|
||||
### 🚀 Getting Started & Setup
|
||||
- [EMULATOR_SETUP_GUIDE.md](EMULATOR_SETUP_GUIDE.md) - Set up development environment with emulator
|
||||
- [TRIXIE_UPGRADE_GUIDE.md](TRIXIE_UPGRADE_GUIDE.md) - Upgrade to Raspbian OS 13 "Trixie"
|
||||
- [TROUBLESHOOTING_QUICK_START.md](TROUBLESHOOTING_QUICK_START.md) - Common issues and solutions
|
||||
### 🚀 Getting Started & User Guides
|
||||
- [GETTING_STARTED.md](GETTING_STARTED.md) - First-time setup and quick start guide
|
||||
- [WEB_INTERFACE_GUIDE.md](WEB_INTERFACE_GUIDE.md) - Complete web interface user guide
|
||||
- [WIFI_NETWORK_SETUP.md](WIFI_NETWORK_SETUP.md) - WiFi configuration and AP mode setup
|
||||
- [PLUGIN_STORE_GUIDE.md](PLUGIN_STORE_GUIDE.md) - Installing and managing plugins
|
||||
- [TROUBLESHOOTING.md](TROUBLESHOOTING.md) - Common issues and solutions
|
||||
|
||||
### 🏗️ Architecture & Design
|
||||
- [PLUGIN_ARCHITECTURE_SPEC.md](PLUGIN_ARCHITECTURE_SPEC.md) - Complete plugin system specification
|
||||
- [PLUGIN_IMPLEMENTATION_SUMMARY.md](PLUGIN_IMPLEMENTATION_SUMMARY.md) - Plugin system implementation details
|
||||
- [FEATURE_IMPLEMENTATION_SUMMARY.md](FEATURE_IMPLEMENTATION_SUMMARY.md) - Major feature implementations
|
||||
- [NESTED_CONFIG_SCHEMAS.md](NESTED_CONFIG_SCHEMAS.md) - Configuration schema design
|
||||
- [NESTED_SCHEMA_IMPLEMENTATION.md](NESTED_SCHEMA_IMPLEMENTATION.md) - Schema implementation details
|
||||
- [NESTED_SCHEMA_VISUAL_COMPARISON.md](NESTED_SCHEMA_VISUAL_COMPARISON.md) - Schema comparison visuals
|
||||
|
||||
### ⚙️ Configuration & Management
|
||||
- [PLUGIN_CONFIGURATION_GUIDE.md](PLUGIN_CONFIGURATION_GUIDE.md) - Complete plugin configuration guide
|
||||
- [PLUGIN_CONFIGURATION_TABS.md](PLUGIN_CONFIGURATION_TABS.md) - Configuration tabs feature
|
||||
- [PLUGIN_CONFIG_QUICK_START.md](PLUGIN_CONFIG_QUICK_START.md) - Quick configuration guide
|
||||
### ⚡ Advanced Features
|
||||
- [ADVANCED_FEATURES.md](ADVANCED_FEATURES.md) - Vegas scroll mode, on-demand display, cache management, background services, permissions
|
||||
|
||||
### 🔌 Plugin Development
|
||||
- [PLUGIN_DEVELOPMENT_GUIDE.md](PLUGIN_DEVELOPMENT_GUIDE.md) - Complete plugin development guide
|
||||
- [PLUGIN_DEVELOPMENT_GUIDE.md](PLUGIN_DEVELOPMENT_GUIDE.md) - Complete plugin development workflow
|
||||
- [PLUGIN_QUICK_REFERENCE.md](PLUGIN_QUICK_REFERENCE.md) - Plugin development quick reference
|
||||
- [PLUGIN_API_REFERENCE.md](PLUGIN_API_REFERENCE.md) - Complete API reference for plugin developers
|
||||
- [ADVANCED_PLUGIN_DEVELOPMENT.md](ADVANCED_PLUGIN_DEVELOPMENT.md) - Advanced patterns and examples
|
||||
- [PLUGIN_REGISTRY_SETUP_GUIDE.md](PLUGIN_REGISTRY_SETUP_GUIDE.md) - Setting up plugin registry
|
||||
- [PLUGIN_CONFIGURATION_GUIDE.md](PLUGIN_CONFIGURATION_GUIDE.md) - Configuration schema design
|
||||
- [PLUGIN_CONFIGURATION_TABS.md](PLUGIN_CONFIGURATION_TABS.md) - Configuration tabs feature
|
||||
- [PLUGIN_CONFIG_QUICK_START.md](PLUGIN_CONFIG_QUICK_START.md) - Quick configuration guide
|
||||
- [PLUGIN_DEPENDENCY_GUIDE.md](PLUGIN_DEPENDENCY_GUIDE.md) - Managing plugin dependencies
|
||||
- [PLUGIN_DEPENDENCY_TROUBLESHOOTING.md](PLUGIN_DEPENDENCY_TROUBLESHOOTING.md) - Dependency troubleshooting
|
||||
|
||||
### 🎮 Plugin Features
|
||||
- [ON_DEMAND_DISPLAY_QUICK_START.md](ON_DEMAND_DISPLAY_QUICK_START.md) - Manual display triggering
|
||||
- [PLUGIN_LIVE_PRIORITY_QUICK_START.md](PLUGIN_LIVE_PRIORITY_QUICK_START.md) - Live content priority
|
||||
- [PLUGIN_LIVE_PRIORITY_API.md](PLUGIN_LIVE_PRIORITY_API.md) - Live priority API reference
|
||||
- [PLUGIN_CUSTOM_ICONS_FEATURE.md](PLUGIN_CUSTOM_ICONS_FEATURE.md) - Custom plugin icons
|
||||
- [PLUGIN_DISPATCH_IMPLEMENTATION.md](PLUGIN_DISPATCH_IMPLEMENTATION.md) - Plugin dispatch system
|
||||
- [PLUGIN_TABS_FEATURE_COMPLETE.md](PLUGIN_TABS_FEATURE_COMPLETE.md) - Plugin tabs feature
|
||||
### 🏗️ Plugin Features & Extensions
|
||||
- [PLUGIN_CUSTOM_ICONS.md](PLUGIN_CUSTOM_ICONS.md) - Custom plugin icons
|
||||
- [PLUGIN_CUSTOM_ICONS_FEATURE.md](PLUGIN_CUSTOM_ICONS_FEATURE.md) - Custom icons implementation
|
||||
- [PLUGIN_IMPLEMENTATION_SUMMARY.md](PLUGIN_IMPLEMENTATION_SUMMARY.md) - Plugin system implementation
|
||||
- [PLUGIN_REGISTRY_SETUP_GUIDE.md](PLUGIN_REGISTRY_SETUP_GUIDE.md) - Setting up plugin registry
|
||||
- [PLUGIN_WEB_UI_ACTIONS.md](PLUGIN_WEB_UI_ACTIONS.md) - Web UI actions for plugins
|
||||
|
||||
### 📡 API Reference
|
||||
- [API_REFERENCE.md](API_REFERENCE.md) - Complete REST API documentation for web interface
|
||||
- [PLUGIN_API_REFERENCE.md](PLUGIN_API_REFERENCE.md) - Plugin developer API reference (Display Manager, Cache Manager, Plugin Manager)
|
||||
- [REST_API_REFERENCE.md](REST_API_REFERENCE.md) - Complete REST API documentation (71+ endpoints)
|
||||
- [PLUGIN_API_REFERENCE.md](PLUGIN_API_REFERENCE.md) - Plugin developer API (Display Manager, Cache Manager, Plugin Manager)
|
||||
- [DEVELOPER_QUICK_REFERENCE.md](DEVELOPER_QUICK_REFERENCE.md) - Quick reference for common developer tasks
|
||||
- [ON_DEMAND_DISPLAY_API.md](ON_DEMAND_DISPLAY_API.md) - On-demand display API reference
|
||||
|
||||
### 🏛️ Architecture & Design
|
||||
- [PLUGIN_ARCHITECTURE_SPEC.md](PLUGIN_ARCHITECTURE_SPEC.md) - Complete plugin system specification
|
||||
- [PLUGIN_CONFIG_ARCHITECTURE.md](PLUGIN_CONFIG_ARCHITECTURE.md) - Configuration system architecture
|
||||
- [PLUGIN_CONFIG_CORE_PROPERTIES.md](PLUGIN_CONFIG_CORE_PROPERTIES.md) - Core configuration properties
|
||||
|
||||
### 🛠️ Development & Tools
|
||||
- [BACKGROUND_SERVICE_README.md](BACKGROUND_SERVICE_README.md) - Background service architecture
|
||||
- [FONT_MANAGER_USAGE.md](FONT_MANAGER_USAGE.md) - Font management system
|
||||
- [DEVELOPMENT.md](DEVELOPMENT.md) - Development environment setup
|
||||
- [EMULATOR_SETUP_GUIDE.md](EMULATOR_SETUP_GUIDE.md) - Set up development environment with emulator
|
||||
- [HOW_TO_RUN_TESTS.md](HOW_TO_RUN_TESTS.md) - Testing documentation
|
||||
- [MULTI_ROOT_WORKSPACE_SETUP.md](MULTI_ROOT_WORKSPACE_SETUP.md) - Multi-workspace development
|
||||
- [FONT_MANAGER.md](FONT_MANAGER.md) - Font management system
|
||||
|
||||
### 🔍 Analysis & Compatibility
|
||||
- [RASPBIAN_TRIXIE_COMPATIBILITY_ANALYSIS.md](RASPBIAN_TRIXIE_COMPATIBILITY_ANALYSIS.md) - Detailed Trixie compatibility analysis
|
||||
- [CONFIGURATION_CLEANUP_SUMMARY.md](CONFIGURATION_CLEANUP_SUMMARY.md) - Configuration cleanup details
|
||||
- [football_plugin_comparison.md](football_plugin_comparison.md) - Football plugin analysis
|
||||
### 🔄 Migration & Updates
|
||||
- [MIGRATION_GUIDE.md](MIGRATION_GUIDE.md) - Breaking changes and migration instructions
|
||||
- [SSH_UNAVAILABLE_AFTER_INSTALL.md](SSH_UNAVAILABLE_AFTER_INSTALL.md) - SSH troubleshooting after install
|
||||
|
||||
### 📊 Utility & Scripts
|
||||
- [README_broadcast_logo_analyzer.md](README_broadcast_logo_analyzer.md) - Broadcast logo analysis tool
|
||||
- [README_soccer_logos.md](README_soccer_logos.md) - Soccer logo management
|
||||
- [WEB_INTERFACE_TROUBLESHOOTING.md](WEB_INTERFACE_TROUBLESHOOTING.md) - Web interface troubleshooting
|
||||
|
||||
## 🔄 Migration & Updates
|
||||
|
||||
### Recent Consolidations (October 2025)
|
||||
- **Implementation Summaries**: Consolidated 7 separate implementation summaries into 2 comprehensive guides:
|
||||
- `FEATURE_IMPLEMENTATION_SUMMARY.md` (AP Top 25, Plugin System, Configuration, Web Interface, Trixie Compatibility)
|
||||
- `PLUGIN_IMPLEMENTATION_SUMMARY.md` (Plugin system technical details)
|
||||
- **Trixie Documentation**: Merged 4 Trixie-related documents into `TRIXIE_UPGRADE_GUIDE.md`
|
||||
- **Removed Redundancy**: Eliminated duplicate documents and outdated debug guides
|
||||
- **Total Reduction**: 53 → 39 documents (26% reduction)
|
||||
|
||||
### Migration Notes
|
||||
- Old implementation summary documents have been consolidated
|
||||
- Trixie upgrade information is now centralized in one guide
|
||||
- Deprecated manager documentation has been removed (no longer applicable)
|
||||
- Very specific debug documents have been archived or removed
|
||||
### 📚 Miscellaneous
|
||||
- [widget-guide.md](widget-guide.md) - Widget development guide
|
||||
- Template files:
|
||||
- [plugin_registry_template.json](plugin_registry_template.json) - Plugin registry template
|
||||
- [PLUGIN_WEB_UI_ACTIONS_EXAMPLE.json](PLUGIN_WEB_UI_ACTIONS_EXAMPLE.json) - Web UI actions example
|
||||
|
||||
## 🎯 Key Resources by Use Case
|
||||
|
||||
### I'm new to LEDMatrix
|
||||
1. [Main README](../README.md) - Installation and setup
|
||||
2. [EMULATOR_SETUP_GUIDE.md](EMULATOR_SETUP_GUIDE.md) - Development environment
|
||||
3. [PLUGIN_QUICK_REFERENCE.md](PLUGIN_QUICK_REFERENCE.md) - Understanding the system
|
||||
1. [GETTING_STARTED.md](GETTING_STARTED.md) - Start here for first-time setup
|
||||
2. [WEB_INTERFACE_GUIDE.md](WEB_INTERFACE_GUIDE.md) - Learn the control panel
|
||||
3. [PLUGIN_STORE_GUIDE.md](PLUGIN_STORE_GUIDE.md) - Install plugins
|
||||
|
||||
### I want to create a plugin
|
||||
1. [PLUGIN_DEVELOPMENT_GUIDE.md](PLUGIN_DEVELOPMENT_GUIDE.md) - Complete development guide
|
||||
2. [PLUGIN_API_REFERENCE.md](PLUGIN_API_REFERENCE.md) - Available methods and APIs
|
||||
3. [ADVANCED_PLUGIN_DEVELOPMENT.md](ADVANCED_PLUGIN_DEVELOPMENT.md) - Advanced patterns and examples
|
||||
3. [ADVANCED_PLUGIN_DEVELOPMENT.md](ADVANCED_PLUGIN_DEVELOPMENT.md) - Advanced patterns
|
||||
4. [PLUGIN_CONFIGURATION_GUIDE.md](PLUGIN_CONFIGURATION_GUIDE.md) - Configuration setup
|
||||
5. [PLUGIN_ARCHITECTURE_SPEC.md](PLUGIN_ARCHITECTURE_SPEC.md) - Complete specification
|
||||
|
||||
### I want to upgrade to Trixie
|
||||
1. [TRIXIE_UPGRADE_GUIDE.md](TRIXIE_UPGRADE_GUIDE.md) - Complete upgrade guide
|
||||
2. [RASPBIAN_TRIXIE_COMPATIBILITY_ANALYSIS.md](RASPBIAN_TRIXIE_COMPATIBILITY_ANALYSIS.md) - Technical details
|
||||
|
||||
### I need to troubleshoot an issue
|
||||
1. [TROUBLESHOOTING_QUICK_START.md](TROUBLESHOOTING_QUICK_START.md) - Common issues
|
||||
2. [WEB_INTERFACE_TROUBLESHOOTING.md](WEB_INTERFACE_TROUBLESHOOTING.md) - Web interface problems
|
||||
1. [TROUBLESHOOTING.md](TROUBLESHOOTING.md) - Comprehensive troubleshooting guide
|
||||
2. [WIFI_NETWORK_SETUP.md](WIFI_NETWORK_SETUP.md) - WiFi/network issues
|
||||
3. [PLUGIN_DEPENDENCY_TROUBLESHOOTING.md](PLUGIN_DEPENDENCY_TROUBLESHOOTING.md) - Dependency issues
|
||||
|
||||
### I want to use advanced features
|
||||
1. [ADVANCED_FEATURES.md](ADVANCED_FEATURES.md) - Vegas scroll, on-demand display, background services
|
||||
2. [FONT_MANAGER.md](FONT_MANAGER.md) - Font management
|
||||
3. [REST_API_REFERENCE.md](REST_API_REFERENCE.md) - API integration
|
||||
|
||||
### I want to understand the architecture
|
||||
1. [PLUGIN_ARCHITECTURE_SPEC.md](PLUGIN_ARCHITECTURE_SPEC.md) - System architecture
|
||||
2. [FEATURE_IMPLEMENTATION_SUMMARY.md](FEATURE_IMPLEMENTATION_SUMMARY.md) - Feature overview
|
||||
2. [PLUGIN_CONFIG_ARCHITECTURE.md](PLUGIN_CONFIG_ARCHITECTURE.md) - Configuration architecture
|
||||
3. [PLUGIN_IMPLEMENTATION_SUMMARY.md](PLUGIN_IMPLEMENTATION_SUMMARY.md) - Implementation details
|
||||
|
||||
## 🔄 Recent Consolidations (January 2026)
|
||||
|
||||
### Major Consolidation Effort
|
||||
- **Before**: 51 main documentation files
|
||||
- **After**: 16-17 well-organized files
|
||||
- **Reduction**: ~68% fewer files
|
||||
- **Archived**: 33 files (consolidated sources + ephemeral docs)
|
||||
|
||||
### New Consolidated Guides
|
||||
- **GETTING_STARTED.md** - New first-time user guide
|
||||
- **WEB_INTERFACE_GUIDE.md** - Consolidated web interface documentation
|
||||
- **WIFI_NETWORK_SETUP.md** - Consolidated WiFi setup (5 files → 1)
|
||||
- **PLUGIN_STORE_GUIDE.md** - Consolidated plugin store guides (2 files → 1)
|
||||
- **TROUBLESHOOTING.md** - Consolidated troubleshooting (4 files → 1)
|
||||
- **ADVANCED_FEATURES.md** - Consolidated advanced features (6 files → 1)
|
||||
|
||||
### What Was Archived
|
||||
- Ephemeral debug documents (DEBUG_WEB_ISSUE.md, BROWSER_ERRORS_EXPLANATION.md, etc.)
|
||||
- Implementation summaries (PLUGIN_CONFIG_TABS_SUMMARY.md, STARTUP_OPTIMIZATION_SUMMARY.md, etc.)
|
||||
- Consolidated source files (WIFI_SETUP.md, V3_INTERFACE_README.md, etc.)
|
||||
- Testing documentation (CAPTIVE_PORTAL_TESTING.md, etc.)
|
||||
|
||||
All archived files are preserved in `docs/archive/` with full git history.
|
||||
|
||||
### Benefits
|
||||
- ✅ Easier to find information (fewer files to search)
|
||||
- ✅ No duplicate content
|
||||
- ✅ Consistent writing style (professional technical)
|
||||
- ✅ Updated outdated references
|
||||
- ✅ Fixed broken internal links
|
||||
- ✅ Better organization for users vs developers
|
||||
|
||||
## 📝 Contributing to Documentation
|
||||
|
||||
### Documentation Standards
|
||||
- Use Markdown format with consistent headers
|
||||
- Professional technical writing style
|
||||
- Minimal emojis (1-2 per major section for navigation)
|
||||
- Include code examples where helpful
|
||||
- Provide both quick start and detailed reference sections
|
||||
- Keep implementation summaries focused on what was built, not how to use
|
||||
- Cross-reference related documentation
|
||||
|
||||
### Adding New Documentation
|
||||
1. Place in appropriate category (see sections above)
|
||||
2. Update this README.md with the new document
|
||||
3. Follow naming conventions (FEATURE_NAME.md)
|
||||
4. Consider if content should be consolidated with existing docs
|
||||
1. Consider if content should be added to existing docs first
|
||||
2. Place in appropriate category (see sections above)
|
||||
3. Update this README.md with the new document
|
||||
4. Follow naming conventions (FEATURE_NAME.md)
|
||||
5. Use consistent formatting and voice
|
||||
|
||||
### Consolidation Guidelines
|
||||
- **Implementation Summaries**: Consolidate into feature-specific summaries
|
||||
- **Quick References**: Keep if they provide unique value, otherwise merge
|
||||
- **Debug Documents**: Remove after issues are resolved
|
||||
- **Migration Guides**: Consolidate when migrations are complete
|
||||
- **User Guides**: Consolidate by topic (WiFi, troubleshooting, etc.)
|
||||
- **Developer Guides**: Keep development vs reference vs architecture separate
|
||||
- **Debug Documents**: Archive after issues are resolved
|
||||
- **Implementation Summaries**: Archive completed implementation details
|
||||
- **Ephemeral Content**: Archive, don't keep in main docs
|
||||
|
||||
## 🔗 Related Documentation
|
||||
|
||||
- [Main Project README](../README.md) - Installation and basic usage
|
||||
- [Web Interface README](../web_interface/README.md) - Web interface details
|
||||
- [LEDMatrix Wiki](../LEDMatrix.wiki/) - Extended documentation and guides
|
||||
- [GitHub Issues](https://github.com/ChuckBuilds/LEDMatrix/issues) - Bug reports and feature requests
|
||||
- [GitHub Discussions](https://github.com/ChuckBuilds/LEDMatrix/discussions) - Community support
|
||||
|
||||
## 📊 Documentation Statistics
|
||||
|
||||
- **Total Documents**: ~35 (after consolidation)
|
||||
- **Categories**: 8 major sections (including new API Reference section)
|
||||
- **Primary Languages**: English
|
||||
- **Main Documents**: 16-17 files (after consolidation)
|
||||
- **Archived Documents**: 33 files (in docs/archive/)
|
||||
- **Categories**: 9 major sections
|
||||
- **Primary Language**: English
|
||||
- **Format**: Markdown (.md)
|
||||
- **Last Update**: December 2025
|
||||
- **Coverage**: Installation, development, troubleshooting, architecture, API references
|
||||
- **Last Major Update**: January 2026
|
||||
- **Coverage**: Installation, user guides, development, troubleshooting, architecture, API references
|
||||
|
||||
### Recent Improvements (December 2025)
|
||||
- ✅ Complete REST API documentation (50+ endpoints)
|
||||
### Documentation Highlights
|
||||
- ✅ Comprehensive user guides for first-time setup
|
||||
- ✅ Complete REST API documentation (71+ endpoints)
|
||||
- ✅ Complete Plugin API reference (Display Manager, Cache Manager, Plugin Manager)
|
||||
- ✅ Advanced plugin development guide with examples
|
||||
- ✅ Consolidated plugin configuration documentation
|
||||
- ✅ Developer quick reference guide
|
||||
- ✅ Better organization for end users and developers
|
||||
- ✅ Consolidated configuration documentation
|
||||
- ✅ Professional technical writing throughout
|
||||
- ✅ ~68% reduction in file count while maintaining coverage
|
||||
|
||||
---
|
||||
|
||||
*This documentation index was last updated: December 2025*
|
||||
*This documentation index was last updated: January 2026*
|
||||
|
||||
*For questions or suggestions about the documentation, please open an issue or start a discussion on GitHub.*
|
||||
|
||||
915
docs/TROUBLESHOOTING.md
Normal file
915
docs/TROUBLESHOOTING.md
Normal file
@@ -0,0 +1,915 @@
|
||||
# Troubleshooting Guide
|
||||
|
||||
## Quick Diagnosis Steps
|
||||
|
||||
Run these checks first to quickly identify common issues:
|
||||
|
||||
### 1. Check Service Status
|
||||
|
||||
```bash
|
||||
# Check all LEDMatrix services
|
||||
sudo systemctl status ledmatrix
|
||||
sudo systemctl status ledmatrix-web
|
||||
sudo systemctl status ledmatrix-wifi-monitor
|
||||
|
||||
# Check AP mode services (if using WiFi)
|
||||
sudo systemctl status hostapd
|
||||
sudo systemctl status dnsmasq
|
||||
```
|
||||
|
||||
**Note:** Look for `active (running)` status and check for error messages in the output.
|
||||
|
||||
### 2. View Service Logs
|
||||
|
||||
**IMPORTANT:** The web service logs to **syslog**, NOT stdout. Use `journalctl` to view logs:
|
||||
|
||||
```bash
|
||||
# View all recent logs
|
||||
sudo journalctl -u ledmatrix -n 50
|
||||
sudo journalctl -u ledmatrix-web -n 50
|
||||
|
||||
# Follow logs in real-time
|
||||
sudo journalctl -u ledmatrix -f
|
||||
|
||||
# View logs from last hour
|
||||
sudo journalctl -u ledmatrix-web --since "1 hour ago"
|
||||
|
||||
# Filter for errors only
|
||||
sudo journalctl -u ledmatrix -p err
|
||||
```
|
||||
|
||||
### 3. Run Diagnostic Scripts
|
||||
|
||||
```bash
|
||||
# Web interface diagnostics
|
||||
bash scripts/diagnose_web_interface.sh
|
||||
|
||||
# WiFi setup verification
|
||||
./scripts/verify_wifi_setup.sh
|
||||
|
||||
# Weather plugin troubleshooting
|
||||
./troubleshoot_weather.sh
|
||||
|
||||
# Captive portal troubleshooting
|
||||
./scripts/troubleshoot_captive_portal.sh
|
||||
```
|
||||
|
||||
### 4. Check Configuration
|
||||
|
||||
```bash
|
||||
# Verify web interface autostart
|
||||
cat config/config.json | grep web_display_autostart
|
||||
|
||||
# Check plugin enabled status
|
||||
cat config/config.json | grep -A 2 "plugin-id"
|
||||
|
||||
# Verify API keys present
|
||||
ls -l config/config_secrets.json
|
||||
```
|
||||
|
||||
### 5. Test Manual Startup
|
||||
|
||||
```bash
|
||||
# Test web interface manually
|
||||
python3 web_interface/start.py
|
||||
|
||||
# If it works manually but not as a service, check systemd service file
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Common Issues by Category
|
||||
|
||||
### Web Interface & Service Issues
|
||||
|
||||
#### Service Not Running/Starting
|
||||
|
||||
**Symptoms:**
|
||||
- Cannot access web interface at http://your-pi-ip:5050
|
||||
- `systemctl status ledmatrix-web` shows `inactive (dead)`
|
||||
|
||||
**Solutions:**
|
||||
|
||||
1. **Start the service:**
|
||||
```bash
|
||||
sudo systemctl start ledmatrix-web
|
||||
```
|
||||
|
||||
2. **Enable on boot:**
|
||||
```bash
|
||||
sudo systemctl enable ledmatrix-web
|
||||
```
|
||||
|
||||
3. **Check why it failed:**
|
||||
```bash
|
||||
sudo journalctl -u ledmatrix-web -n 50
|
||||
```
|
||||
|
||||
#### web_display_autostart is False
|
||||
|
||||
**Symptoms:**
|
||||
- Service exists but web interface doesn't start automatically
|
||||
- Logs show service starting but nothing happens
|
||||
|
||||
**Solution:**
|
||||
|
||||
```bash
|
||||
# Edit config.json
|
||||
nano config/config.json
|
||||
|
||||
# Set web_display_autostart to true
|
||||
{
|
||||
"web_display_autostart": true,
|
||||
...
|
||||
}
|
||||
|
||||
# Restart service
|
||||
sudo systemctl restart ledmatrix-web
|
||||
```
|
||||
|
||||
#### Import or Dependency Errors
|
||||
|
||||
**Symptoms:**
|
||||
- Logs show `ModuleNotFoundError` or `ImportError`
|
||||
- Service fails to start with Python errors
|
||||
|
||||
**Solutions:**
|
||||
|
||||
1. **Install dependencies:**
|
||||
```bash
|
||||
pip3 install --break-system-packages -r requirements.txt
|
||||
pip3 install --break-system-packages -r web_interface/requirements.txt
|
||||
```
|
||||
|
||||
2. **Test imports step-by-step:**
|
||||
```bash
|
||||
python3 -c "from src.config_manager import ConfigManager; print('OK')"
|
||||
python3 -c "from src.plugin_system.plugin_manager import PluginManager; print('OK')"
|
||||
python3 -c "from web_interface.app import app; print('OK')"
|
||||
```
|
||||
|
||||
3. **Check Python path:**
|
||||
```bash
|
||||
python3 -c "import sys; print(sys.path)"
|
||||
```
|
||||
|
||||
#### Port Already in Use
|
||||
|
||||
**Symptoms:**
|
||||
- Error: `Address already in use`
|
||||
- Service fails to bind to port 5050
|
||||
|
||||
**Solutions:**
|
||||
|
||||
1. **Check what's using the port:**
|
||||
```bash
|
||||
sudo lsof -i :5050
|
||||
```
|
||||
|
||||
2. **Kill the conflicting process:**
|
||||
```bash
|
||||
sudo kill -9 <PID>
|
||||
```
|
||||
|
||||
3. **Or change the port in start.py:**
|
||||
```python
|
||||
app.run(host='0.0.0.0', port=5051)
|
||||
```
|
||||
|
||||
#### Permission Issues
|
||||
|
||||
**Symptoms:**
|
||||
- `Permission denied` errors in logs
|
||||
- Cannot read/write configuration files
|
||||
|
||||
**Solutions:**
|
||||
|
||||
```bash
|
||||
# Fix ownership of LEDMatrix directory
|
||||
sudo chown -R ledpi:ledpi /home/ledpi/LEDMatrix
|
||||
|
||||
# Fix config file permissions
|
||||
sudo chmod 644 config/config.json
|
||||
sudo chmod 640 config/config_secrets.json
|
||||
|
||||
# Verify service runs as correct user
|
||||
sudo systemctl cat ledmatrix-web | grep User
|
||||
```
|
||||
|
||||
#### Flask/Blueprint Import Errors
|
||||
|
||||
**Symptoms:**
|
||||
- `ImportError: cannot import name 'app'`
|
||||
- `ModuleNotFoundError: No module named 'blueprints'`
|
||||
|
||||
**Solutions:**
|
||||
|
||||
1. **Verify file structure:**
|
||||
```bash
|
||||
ls -l web_interface/app.py
|
||||
ls -l web_interface/blueprints/api_v3.py
|
||||
ls -l web_interface/blueprints/pages_v3.py
|
||||
```
|
||||
|
||||
2. **Check for __init__.py files:**
|
||||
```bash
|
||||
ls -l web_interface/__init__.py
|
||||
ls -l web_interface/blueprints/__init__.py
|
||||
```
|
||||
|
||||
3. **Test import manually:**
|
||||
```bash
|
||||
cd /home/ledpi/LEDMatrix
|
||||
python3 -c "from web_interface.app import app"
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### WiFi & AP Mode Issues
|
||||
|
||||
#### AP Mode Not Activating
|
||||
|
||||
**Symptoms:**
|
||||
- WiFi disconnected but AP mode doesn't start
|
||||
- Cannot find "LEDMatrix-Setup" network
|
||||
|
||||
**Solutions:**
|
||||
|
||||
1. **Check auto-enable setting:**
|
||||
```bash
|
||||
cat config/wifi_config.json | grep auto_enable_ap_mode
|
||||
# Should show: "auto_enable_ap_mode": true
|
||||
```
|
||||
|
||||
2. **Verify WiFi monitor service is running:**
|
||||
```bash
|
||||
sudo systemctl status ledmatrix-wifi-monitor
|
||||
```
|
||||
|
||||
3. **Wait for grace period (90 seconds):**
|
||||
- AP mode requires 3 consecutive disconnected checks at 30-second intervals
|
||||
- Total wait time: 90 seconds after WiFi disconnects
|
||||
|
||||
4. **Check if Ethernet is connected:**
|
||||
```bash
|
||||
nmcli device status
|
||||
# If Ethernet is connected, AP mode won't activate
|
||||
```
|
||||
|
||||
5. **Check required services:**
|
||||
```bash
|
||||
sudo systemctl status hostapd
|
||||
sudo systemctl status dnsmasq
|
||||
```
|
||||
|
||||
6. **Manually enable AP mode:**
|
||||
```bash
|
||||
# Via API
|
||||
curl -X POST http://localhost:5050/api/wifi/ap/enable
|
||||
|
||||
# Via Python
|
||||
python3 -c "
|
||||
from src.wifi_manager import WiFiManager
|
||||
wm = WiFiManager()
|
||||
wm.enable_ap_mode()
|
||||
"
|
||||
```
|
||||
|
||||
#### Cannot Connect to AP Mode / Connection Refused
|
||||
|
||||
**Symptoms:**
|
||||
- Can see "LEDMatrix-Setup" network but can't connect to web interface
|
||||
- Browser shows "Connection Refused" or "Can't connect to server"
|
||||
- AP mode active but web interface not accessible
|
||||
|
||||
**Solutions:**
|
||||
|
||||
1. **Verify web server is running:**
|
||||
```bash
|
||||
sudo systemctl status ledmatrix-web
|
||||
# Should be active (running)
|
||||
```
|
||||
|
||||
2. **Use correct IP address and port:**
|
||||
- Correct: `http://192.168.4.1:5050`
|
||||
- NOT: `http://192.168.4.1` (port 80)
|
||||
- NOT: `http://192.168.4.1:5000`
|
||||
|
||||
3. **Check wlan0 has correct IP:**
|
||||
```bash
|
||||
ip addr show wlan0
|
||||
# Should show: inet 192.168.4.1/24
|
||||
```
|
||||
|
||||
4. **Verify hostapd and dnsmasq are running:**
|
||||
```bash
|
||||
sudo systemctl status hostapd
|
||||
sudo systemctl status dnsmasq
|
||||
```
|
||||
|
||||
5. **Test from the Pi itself:**
|
||||
```bash
|
||||
curl http://192.168.4.1:5050
|
||||
# Should return HTML
|
||||
```
|
||||
|
||||
#### DNS Resolution Failures
|
||||
|
||||
**Symptoms:**
|
||||
- Captive portal doesn't redirect automatically
|
||||
- DNS lookups fail when connected to AP mode
|
||||
|
||||
**Solutions:**
|
||||
|
||||
1. **Check dnsmasq status:**
|
||||
```bash
|
||||
sudo systemctl status dnsmasq
|
||||
sudo journalctl -u dnsmasq -n 20
|
||||
```
|
||||
|
||||
2. **Verify DNS configuration:**
|
||||
```bash
|
||||
cat /etc/dnsmasq.conf | grep -v "^#" | grep -v "^$"
|
||||
```
|
||||
|
||||
3. **Test DNS resolution:**
|
||||
```bash
|
||||
nslookup captive.apple.com
|
||||
# Should resolve to 192.168.4.1 when in AP mode
|
||||
```
|
||||
|
||||
4. **Manual captive portal testing:**
|
||||
- Try these URLs manually:
|
||||
- `http://192.168.4.1:5050`
|
||||
- `http://captive.apple.com`
|
||||
- `http://connectivitycheck.gstatic.com/generate_204`
|
||||
|
||||
#### Firewall Blocking Port 5050
|
||||
|
||||
**Symptoms:**
|
||||
- Services running but cannot connect
|
||||
- Works from Pi but not from other devices
|
||||
|
||||
**Solutions:**
|
||||
|
||||
1. **Check UFW status:**
|
||||
```bash
|
||||
sudo ufw status
|
||||
```
|
||||
|
||||
2. **Allow port 5050:**
|
||||
```bash
|
||||
sudo ufw allow 5050/tcp
|
||||
```
|
||||
|
||||
3. **Check iptables:**
|
||||
```bash
|
||||
sudo iptables -L -n
|
||||
```
|
||||
|
||||
4. **Temporarily disable firewall to test:**
|
||||
```bash
|
||||
sudo ufw disable
|
||||
# Test if it works, then re-enable and add rule
|
||||
sudo ufw enable
|
||||
sudo ufw allow 5050/tcp
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### Plugin Issues
|
||||
|
||||
#### Plugin Not Enabled
|
||||
|
||||
**Symptoms:**
|
||||
- Plugin installed but doesn't appear in rotation
|
||||
- Plugin shows in web interface but is greyed out
|
||||
|
||||
**Solutions:**
|
||||
|
||||
1. **Enable in configuration:**
|
||||
```json
|
||||
{
|
||||
"plugin-id": {
|
||||
"enabled": true,
|
||||
...
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
2. **Restart display:**
|
||||
```bash
|
||||
sudo systemctl restart ledmatrix
|
||||
```
|
||||
|
||||
3. **Verify in web interface:**
|
||||
- Navigate to Plugin Management tab
|
||||
- Toggle the switch to enable
|
||||
- Restart display
|
||||
|
||||
#### Plugin Not Loading
|
||||
|
||||
**Symptoms:**
|
||||
- Plugin enabled but not showing
|
||||
- Errors in logs about plugin
|
||||
|
||||
**Solutions:**
|
||||
|
||||
1. **Check plugin directory exists:**
|
||||
```bash
|
||||
ls -ld plugins/plugin-id/
|
||||
```
|
||||
|
||||
2. **Verify manifest.json:**
|
||||
```bash
|
||||
cat plugins/plugin-id/manifest.json
|
||||
# Verify all required fields present
|
||||
```
|
||||
|
||||
3. **Check dependencies installed:**
|
||||
```bash
|
||||
if [ -f plugins/plugin-id/requirements.txt ]; then
|
||||
pip3 install --break-system-packages -r plugins/plugin-id/requirements.txt
|
||||
fi
|
||||
```
|
||||
|
||||
4. **Check logs for plugin errors:**
|
||||
```bash
|
||||
sudo journalctl -u ledmatrix -f | grep plugin-id
|
||||
```
|
||||
|
||||
5. **Test plugin import:**
|
||||
```bash
|
||||
python3 -c "
|
||||
import sys
|
||||
sys.path.insert(0, 'plugins/plugin-id')
|
||||
from manager import PluginClass
|
||||
print('Plugin imports successfully')
|
||||
"
|
||||
```
|
||||
|
||||
#### Stale Cache Data
|
||||
|
||||
**Symptoms:**
|
||||
- Plugin shows old data
|
||||
- Data doesn't update even after restarting
|
||||
- Clearing cache in web interface doesn't help
|
||||
|
||||
**Solutions:**
|
||||
|
||||
1. **Manual cache clearing:**
|
||||
```bash
|
||||
# Remove plugin-specific cache
|
||||
rm -rf cache/plugin-id*
|
||||
|
||||
# Or remove all cache
|
||||
rm -rf cache/*
|
||||
|
||||
# Restart display
|
||||
sudo systemctl restart ledmatrix
|
||||
```
|
||||
|
||||
2. **Check cache permissions:**
|
||||
```bash
|
||||
ls -ld cache/
|
||||
sudo chown -R ledpi:ledpi cache/
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### Weather Plugin Specific Issues
|
||||
|
||||
#### Missing or Invalid API Key
|
||||
|
||||
**Symptoms:**
|
||||
- "No Weather Data" message on display
|
||||
- Logs show API authentication errors
|
||||
|
||||
**Solutions:**
|
||||
|
||||
1. **Get OpenWeatherMap API key:**
|
||||
- Sign up at https://openweathermap.org/api
|
||||
- Free tier: 1,000 calls/day, 60 calls/minute
|
||||
- Copy your API key
|
||||
|
||||
2. **Add to config_secrets.json (recommended):**
|
||||
```json
|
||||
{
|
||||
"openweathermap_api_key": "your-api-key-here"
|
||||
}
|
||||
```
|
||||
|
||||
3. **Or add to config.json:**
|
||||
```json
|
||||
{
|
||||
"ledmatrix-weather": {
|
||||
"enabled": true,
|
||||
"openweathermap_api_key": "your-api-key-here",
|
||||
...
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
4. **Secure the API key file:**
|
||||
```bash
|
||||
chmod 640 config/config_secrets.json
|
||||
```
|
||||
|
||||
5. **Restart display:**
|
||||
```bash
|
||||
sudo systemctl restart ledmatrix
|
||||
```
|
||||
|
||||
#### API Rate Limits Exceeded
|
||||
|
||||
**Symptoms:**
|
||||
- Weather works initially then stops
|
||||
- Logs show HTTP 429 errors (Too Many Requests)
|
||||
- Error message: "Rate limit exceeded"
|
||||
|
||||
**Solutions:**
|
||||
|
||||
1. **Increase update interval:**
|
||||
```json
|
||||
{
|
||||
"ledmatrix-weather": {
|
||||
"update_interval": 300,
|
||||
...
|
||||
}
|
||||
}
|
||||
```
|
||||
**Note:** Minimum recommended: 300 seconds (5 minutes)
|
||||
|
||||
2. **Check current rate limit usage:**
|
||||
- OpenWeatherMap free tier: 1,000 calls/day, 60 calls/minute
|
||||
- With 300s interval: 288 calls/day (well within limits)
|
||||
|
||||
3. **Monitor API calls:**
|
||||
```bash
|
||||
sudo journalctl -u ledmatrix -f | grep "openweathermap"
|
||||
```
|
||||
|
||||
#### Invalid Location Configuration
|
||||
|
||||
**Symptoms:**
|
||||
- "No Weather Data" message
|
||||
- Logs show location not found errors
|
||||
|
||||
**Solutions:**
|
||||
|
||||
1. **Use correct location format:**
|
||||
```json
|
||||
{
|
||||
"ledmatrix-weather": {
|
||||
"city": "Tampa",
|
||||
"state": "FL",
|
||||
"country": "US"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
2. **Use ISO country codes:**
|
||||
- US = United States
|
||||
- GB = United Kingdom
|
||||
- CA = Canada
|
||||
- etc.
|
||||
|
||||
3. **Test API call manually:**
|
||||
```bash
|
||||
API_KEY="your-key-here"
|
||||
curl "http://api.openweathermap.org/data/2.5/weather?q=Tampa,FL,US&appid=${API_KEY}"
|
||||
```
|
||||
|
||||
#### Network Connectivity to OpenWeatherMap
|
||||
|
||||
**Symptoms:**
|
||||
- Other internet features work
|
||||
- Weather specifically fails
|
||||
- Connection timeout errors
|
||||
|
||||
**Solutions:**
|
||||
|
||||
1. **Test connectivity:**
|
||||
```bash
|
||||
ping api.openweathermap.org
|
||||
```
|
||||
|
||||
2. **Test DNS resolution:**
|
||||
```bash
|
||||
nslookup api.openweathermap.org
|
||||
```
|
||||
|
||||
3. **Test API endpoint:**
|
||||
```bash
|
||||
curl -I https://api.openweathermap.org
|
||||
# Should return HTTP 200 or 301
|
||||
```
|
||||
|
||||
4. **Check firewall:**
|
||||
```bash
|
||||
# Ensure HTTPS (443) is allowed for outbound connections
|
||||
sudo ufw status
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Diagnostic Commands Reference
|
||||
|
||||
### Service Commands
|
||||
|
||||
```bash
|
||||
# Check status
|
||||
sudo systemctl status ledmatrix
|
||||
sudo systemctl status ledmatrix-web
|
||||
sudo systemctl status ledmatrix-wifi-monitor
|
||||
|
||||
# Start service
|
||||
sudo systemctl start <service-name>
|
||||
|
||||
# Stop service
|
||||
sudo systemctl stop <service-name>
|
||||
|
||||
# Restart service
|
||||
sudo systemctl restart <service-name>
|
||||
|
||||
# Enable on boot
|
||||
sudo systemctl enable <service-name>
|
||||
|
||||
# Disable on boot
|
||||
sudo systemctl disable <service-name>
|
||||
|
||||
# View service file
|
||||
sudo systemctl cat <service-name>
|
||||
|
||||
# Reload systemd after editing service files
|
||||
sudo systemctl daemon-reload
|
||||
```
|
||||
|
||||
### Log Viewing Commands
|
||||
|
||||
```bash
|
||||
# View recent logs (last 50 lines)
|
||||
sudo journalctl -u ledmatrix -n 50
|
||||
|
||||
# Follow logs in real-time
|
||||
sudo journalctl -u ledmatrix -f
|
||||
|
||||
# View logs from specific time
|
||||
sudo journalctl -u ledmatrix --since "1 hour ago"
|
||||
sudo journalctl -u ledmatrix --since "2024-01-01 10:00:00"
|
||||
|
||||
# View logs until specific time
|
||||
sudo journalctl -u ledmatrix --until "2024-01-01 12:00:00"
|
||||
|
||||
# Filter by priority (errors only)
|
||||
sudo journalctl -u ledmatrix -p err
|
||||
|
||||
# Filter by priority (warnings and errors)
|
||||
sudo journalctl -u ledmatrix -p warning
|
||||
|
||||
# Search logs for specific text
|
||||
sudo journalctl -u ledmatrix | grep "error"
|
||||
sudo journalctl -u ledmatrix | grep -i "plugin"
|
||||
|
||||
# View logs for multiple services
|
||||
sudo journalctl -u ledmatrix -u ledmatrix-web -n 50
|
||||
|
||||
# Export logs to file
|
||||
sudo journalctl -u ledmatrix > ledmatrix.log
|
||||
```
|
||||
|
||||
### Network Testing Commands
|
||||
|
||||
```bash
|
||||
# Test connectivity
|
||||
ping -c 4 8.8.8.8
|
||||
ping -c 4 api.openweathermap.org
|
||||
|
||||
# Test DNS resolution
|
||||
nslookup api.openweathermap.org
|
||||
dig api.openweathermap.org
|
||||
|
||||
# Test HTTP endpoint
|
||||
curl -I http://your-pi-ip:5050
|
||||
curl http://192.168.4.1:5050
|
||||
|
||||
# Check listening ports
|
||||
sudo lsof -i :5050
|
||||
sudo netstat -tuln | grep 5050
|
||||
|
||||
# Check network interfaces
|
||||
ip addr show
|
||||
nmcli device status
|
||||
```
|
||||
|
||||
### File/Directory Verification
|
||||
|
||||
```bash
|
||||
# Check file exists
|
||||
ls -l config/config.json
|
||||
ls -l plugins/plugin-id/manifest.json
|
||||
|
||||
# Check directory structure
|
||||
ls -la web_interface/
|
||||
ls -la plugins/
|
||||
|
||||
# Check file permissions
|
||||
ls -l config/config_secrets.json
|
||||
|
||||
# Check file contents
|
||||
cat config/config.json | jq .
|
||||
cat config/wifi_config.json | grep auto_enable
|
||||
```
|
||||
|
||||
### Python Import Testing
|
||||
|
||||
```bash
|
||||
# Test core imports
|
||||
python3 -c "from src.config_manager import ConfigManager; print('OK')"
|
||||
python3 -c "from src.plugin_system.plugin_manager import PluginManager; print('OK')"
|
||||
python3 -c "from src.display_manager import DisplayManager; print('OK')"
|
||||
|
||||
# Test web interface imports
|
||||
python3 -c "from web_interface.app import app; print('OK')"
|
||||
python3 -c "from web_interface.blueprints.api_v3 import api_v3; print('OK')"
|
||||
|
||||
# Test WiFi manager
|
||||
python3 -c "from src.wifi_manager import WiFiManager; print('OK')"
|
||||
|
||||
# Test plugin import
|
||||
python3 -c "
|
||||
import sys
|
||||
sys.path.insert(0, 'plugins/plugin-id')
|
||||
from manager import PluginClass
|
||||
print('Plugin imports OK')
|
||||
"
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Service File Template
|
||||
|
||||
If your systemd service file is corrupted or missing, use this template:
|
||||
|
||||
```ini
|
||||
[Unit]
|
||||
Description=LEDMatrix Web Interface
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=ledpi
|
||||
Group=ledpi
|
||||
WorkingDirectory=/home/ledpi/LEDMatrix
|
||||
Environment="PYTHONUNBUFFERED=1"
|
||||
ExecStart=/usr/bin/python3 /home/ledpi/LEDMatrix/web_interface/start.py
|
||||
Restart=on-failure
|
||||
RestartSec=5s
|
||||
StandardOutput=journal
|
||||
StandardError=journal
|
||||
SyslogIdentifier=ledmatrix-web
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
```
|
||||
|
||||
Save to `/etc/systemd/system/ledmatrix-web.service` and run:
|
||||
|
||||
```bash
|
||||
sudo systemctl daemon-reload
|
||||
sudo systemctl enable ledmatrix-web
|
||||
sudo systemctl start ledmatrix-web
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Complete Diagnostic Script
|
||||
|
||||
Run this script for comprehensive diagnostics:
|
||||
|
||||
```bash
|
||||
#!/bin/bash
|
||||
|
||||
echo "=== LEDMatrix Diagnostic Report ==="
|
||||
echo ""
|
||||
|
||||
echo "1. Service Status:"
|
||||
systemctl status ledmatrix --no-pager -n 5
|
||||
systemctl status ledmatrix-web --no-pager -n 5
|
||||
echo ""
|
||||
|
||||
echo "2. Recent Logs:"
|
||||
journalctl -u ledmatrix -n 20 --no-pager
|
||||
echo ""
|
||||
|
||||
echo "3. Configuration:"
|
||||
cat config/config.json | grep -E "(web_display_autostart|enabled)"
|
||||
echo ""
|
||||
|
||||
echo "4. Network Status:"
|
||||
ip addr show | grep -E "(wlan|eth|inet )"
|
||||
curl -s http://localhost:5050 > /dev/null && echo "Web interface: OK" || echo "Web interface: FAILED"
|
||||
echo ""
|
||||
|
||||
echo "5. File Structure:"
|
||||
ls -la web_interface/ | head -10
|
||||
ls -la plugins/ | head -10
|
||||
echo ""
|
||||
|
||||
echo "6. Python Imports:"
|
||||
python3 -c "from src.config_manager import ConfigManager" && echo "ConfigManager: OK" || echo "ConfigManager: FAILED"
|
||||
python3 -c "from web_interface.app import app" && echo "Web app: OK" || echo "Web app: FAILED"
|
||||
echo ""
|
||||
|
||||
echo "=== End Diagnostic Report ==="
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Success Indicators
|
||||
|
||||
A properly functioning system should show:
|
||||
|
||||
1. **Services Running:**
|
||||
```
|
||||
● ledmatrix.service - active (running)
|
||||
● ledmatrix-web.service - active (running)
|
||||
```
|
||||
|
||||
2. **Web Interface Accessible:**
|
||||
- Navigate to http://your-pi-ip:5050
|
||||
- Page loads successfully
|
||||
- Display preview visible
|
||||
|
||||
3. **Logs Show Normal Operation:**
|
||||
```
|
||||
INFO: Web interface started on port 5050
|
||||
INFO: Loaded X plugins
|
||||
INFO: Display rotation active
|
||||
```
|
||||
|
||||
4. **Process Listening on Port:**
|
||||
```bash
|
||||
$ sudo lsof -i :5050
|
||||
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
|
||||
python3 1234 ledpi 3u IPv4 12345 0t0 TCP *:5050 (LISTEN)
|
||||
```
|
||||
|
||||
5. **Plugins Loading:**
|
||||
- Logs show plugin initialization
|
||||
- Plugins appear in web interface
|
||||
- Display cycles through enabled plugins
|
||||
|
||||
---
|
||||
|
||||
## Emergency Recovery
|
||||
|
||||
If the system is completely broken:
|
||||
|
||||
### 1. Git Rollback
|
||||
|
||||
```bash
|
||||
# View recent commits
|
||||
git log --oneline -10
|
||||
|
||||
# Rollback to previous commit
|
||||
git reset --hard HEAD~1
|
||||
|
||||
# Or rollback to specific commit
|
||||
git reset --hard <commit-hash>
|
||||
|
||||
# Restart all services
|
||||
sudo systemctl restart ledmatrix
|
||||
sudo systemctl restart ledmatrix-web
|
||||
```
|
||||
|
||||
### 2. Fresh Service Installation
|
||||
|
||||
```bash
|
||||
# Reinstall WiFi monitor
|
||||
sudo ./scripts/install/install_wifi_monitor.sh
|
||||
|
||||
# Recreate service files from templates
|
||||
sudo cp templates/ledmatrix.service /etc/systemd/system/
|
||||
sudo cp templates/ledmatrix-web.service /etc/systemd/system/
|
||||
|
||||
# Reload and restart
|
||||
sudo systemctl daemon-reload
|
||||
sudo systemctl restart ledmatrix ledmatrix-web
|
||||
```
|
||||
|
||||
### 3. Full System Reboot
|
||||
|
||||
```bash
|
||||
# As a last resort
|
||||
sudo reboot
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Related Documentation
|
||||
|
||||
- [WEB_INTERFACE_GUIDE.md](WEB_INTERFACE_GUIDE.md) - Web interface usage
|
||||
- [WIFI_NETWORK_SETUP.md](WIFI_NETWORK_SETUP.md) - WiFi configuration
|
||||
- [PLUGIN_STORE_GUIDE.md](PLUGIN_STORE_GUIDE.md) - Plugin installation
|
||||
- [REST_API_REFERENCE.md](REST_API_REFERENCE.md) - API documentation
|
||||
442
docs/WEB_INTERFACE_GUIDE.md
Normal file
442
docs/WEB_INTERFACE_GUIDE.md
Normal file
@@ -0,0 +1,442 @@
|
||||
# Web Interface Guide
|
||||
|
||||
## Overview
|
||||
|
||||
The LEDMatrix web interface provides a complete control panel for managing your LED matrix display. Access all features through a modern, responsive web interface that works on desktop, tablet, and mobile devices.
|
||||
|
||||
---
|
||||
|
||||
## Quick Start
|
||||
|
||||
### Accessing the Interface
|
||||
|
||||
1. Find your Raspberry Pi's IP address:
|
||||
```bash
|
||||
hostname -I
|
||||
```
|
||||
|
||||
2. Open a web browser and navigate to:
|
||||
```
|
||||
http://your-pi-ip:5050
|
||||
```
|
||||
|
||||
3. The interface will load with the Overview tab displaying system stats and a live display preview.
|
||||
|
||||
**Note:** If the interface doesn't load, verify the web service is running:
|
||||
```bash
|
||||
sudo systemctl status ledmatrix-web
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Navigation
|
||||
|
||||
The interface uses a tab-based layout for easy navigation between features:
|
||||
|
||||
- **Overview** - System stats, quick actions, and display preview
|
||||
- **General Settings** - Timezone, location, and autostart configuration
|
||||
- **Display Settings** - Hardware configuration, brightness, and display options
|
||||
- **Durations** - Display rotation timing configuration
|
||||
- **Sports Configuration** - Per-league settings and on-demand modes
|
||||
- **Plugin Management** - Install, configure, enable/disable plugins
|
||||
- **Plugin Store** - Discover and install plugins
|
||||
- **Font Management** - Upload fonts, manage overrides, and preview
|
||||
- **Logs** - Real-time log streaming with filtering and search
|
||||
|
||||
---
|
||||
|
||||
## Features and Usage
|
||||
|
||||
### Overview Tab
|
||||
|
||||
The Overview tab provides at-a-glance information and quick actions:
|
||||
|
||||
**System Stats:**
|
||||
- CPU usage and temperature
|
||||
- Memory usage
|
||||
- Disk usage
|
||||
- Network status
|
||||
|
||||
**Quick Actions:**
|
||||
- **Start/Stop Display** - Control the display service
|
||||
- **Restart Display** - Restart to apply configuration changes
|
||||
- **Test Display** - Run a quick test pattern
|
||||
|
||||
**Display Preview:**
|
||||
- Live preview of what's currently shown on the LED matrix
|
||||
- Updates in real-time
|
||||
- Useful for remote monitoring
|
||||
|
||||
### General Settings Tab
|
||||
|
||||
Configure basic system settings:
|
||||
|
||||
**Timezone:**
|
||||
- Set your local timezone for accurate time display
|
||||
- Auto-detects common timezones
|
||||
|
||||
**Location:**
|
||||
- Set latitude/longitude for location-based features
|
||||
- Used by weather plugins and sunrise/sunset calculations
|
||||
|
||||
**Autostart:**
|
||||
- Enable/disable display autostart on boot
|
||||
- Configure systemd service settings
|
||||
|
||||
**Save Changes:**
|
||||
- Click "Save Configuration" to apply changes
|
||||
- Restart the display for changes to take effect
|
||||
|
||||
### Display Settings Tab
|
||||
|
||||
Configure your LED matrix hardware:
|
||||
|
||||
**Matrix Configuration:**
|
||||
- Rows: Number of LED rows (typically 32 or 64)
|
||||
- Columns: Number of LED columns (typically 64, 128, or 256)
|
||||
- Chain Length: Number of chained panels
|
||||
- Parallel Chains: Number of parallel chains
|
||||
|
||||
**Display Options:**
|
||||
- Brightness: Adjust LED brightness (0-100%)
|
||||
- Hardware Mapping: GPIO pin mapping
|
||||
- Slowdown GPIO: Timing adjustment for compatibility
|
||||
|
||||
**Save and Apply:**
|
||||
- Changes require a display restart
|
||||
- Use "Test Display" to verify configuration
|
||||
|
||||
### Durations Tab
|
||||
|
||||
Control how long each plugin displays:
|
||||
|
||||
**Global Settings:**
|
||||
- Default Duration: Default time for plugins without specific durations
|
||||
- Transition Speed: Speed of transitions between plugins
|
||||
|
||||
**Per-Plugin Durations:**
|
||||
- Set custom display duration for each plugin
|
||||
- Override global default for specific plugins
|
||||
- Measured in seconds
|
||||
|
||||
### Sports Configuration Tab
|
||||
|
||||
Configure sports-specific settings:
|
||||
|
||||
**Per-League Settings:**
|
||||
- Favorite teams
|
||||
- Show favorite teams only
|
||||
- Include scores/standings
|
||||
- Refresh intervals
|
||||
|
||||
**On-Demand Modes:**
|
||||
- Live Priority: Show live games immediately
|
||||
- Game Day Mode: Enhanced display during game days
|
||||
- Score Alerts: Highlight score changes
|
||||
|
||||
### Plugin Management Tab
|
||||
|
||||
Manage installed plugins:
|
||||
|
||||
**Plugin List:**
|
||||
- View all installed plugins
|
||||
- See plugin status (enabled/disabled)
|
||||
- Check last update time
|
||||
|
||||
**Actions:**
|
||||
- **Enable/Disable**: Toggle plugin using the switch
|
||||
- **Configure**: Click ⚙️ to edit plugin settings
|
||||
- **Update**: Update plugin to latest version
|
||||
- **Uninstall**: Remove plugin completely
|
||||
|
||||
**Configuration:**
|
||||
- Edit plugin-specific settings
|
||||
- Changes are saved to `config/config.json`
|
||||
- Restart display to apply changes
|
||||
|
||||
**Note:** See [PLUGIN_STORE_GUIDE.md](PLUGIN_STORE_GUIDE.md) for information on installing plugins.
|
||||
|
||||
### Plugin Store Tab
|
||||
|
||||
Discover and install new plugins:
|
||||
|
||||
**Browse Plugins:**
|
||||
- View available plugins in the official store
|
||||
- Filter by category (sports, weather, time, finance, etc.)
|
||||
- Search by name, description, or author
|
||||
|
||||
**Install Plugins:**
|
||||
- Click "Install" next to any plugin
|
||||
- Wait for installation to complete
|
||||
- Restart the display to activate
|
||||
|
||||
**Install from URL:**
|
||||
- Install plugins from any GitHub repository
|
||||
- Paste the repository URL in the "Install from URL" section
|
||||
- Review the warning about unverified plugins
|
||||
- Click "Install from URL"
|
||||
|
||||
**Plugin Information:**
|
||||
- View plugin descriptions, ratings, and screenshots
|
||||
- Check compatibility and requirements
|
||||
- Read user reviews (when available)
|
||||
|
||||
### Font Management Tab
|
||||
|
||||
Manage fonts for your display:
|
||||
|
||||
**Upload Fonts:**
|
||||
- Drag and drop font files (.ttf, .otf, .bdf)
|
||||
- Upload multiple files at once
|
||||
- Progress indicator shows upload status
|
||||
|
||||
**Font Catalog:**
|
||||
- View all available fonts
|
||||
- See font previews
|
||||
- Check font sizes and styles
|
||||
|
||||
**Plugin Font Overrides:**
|
||||
- Set custom fonts for specific plugins
|
||||
- Override default font choices
|
||||
- Preview font changes
|
||||
|
||||
**Delete Fonts:**
|
||||
- Remove unused fonts
|
||||
- Free up disk space
|
||||
|
||||
### Logs Tab
|
||||
|
||||
View real-time system logs:
|
||||
|
||||
**Log Viewer:**
|
||||
- Streaming logs from the display service
|
||||
- Auto-scroll to latest entries
|
||||
- Timestamps for each log entry
|
||||
|
||||
**Filtering:**
|
||||
- Filter by log level (INFO, WARNING, ERROR)
|
||||
- Search for specific text
|
||||
- Filter by plugin or component
|
||||
|
||||
**Actions:**
|
||||
- **Clear**: Clear the current view
|
||||
- **Download**: Download logs for offline analysis
|
||||
- **Pause**: Pause auto-scrolling
|
||||
|
||||
---
|
||||
|
||||
## Common Tasks
|
||||
|
||||
### Changing Display Brightness
|
||||
|
||||
1. Navigate to the **Display Settings** tab
|
||||
2. Adjust the **Brightness** slider (0-100%)
|
||||
3. Click **Save Configuration**
|
||||
4. Restart the display for changes to take effect
|
||||
|
||||
### Installing a New Plugin
|
||||
|
||||
1. Navigate to the **Plugin Store** tab
|
||||
2. Browse or search for the desired plugin
|
||||
3. Click **Install** next to the plugin
|
||||
4. Wait for installation to complete
|
||||
5. Restart the display
|
||||
6. Enable the plugin in the **Plugin Management** tab
|
||||
|
||||
### Configuring a Plugin
|
||||
|
||||
1. Navigate to the **Plugin Management** tab
|
||||
2. Find the plugin you want to configure
|
||||
3. Click the ⚙️ **Configure** button
|
||||
4. Edit the settings in the form
|
||||
5. Click **Save**
|
||||
6. Restart the display to apply changes
|
||||
|
||||
### Setting Favorite Sports Teams
|
||||
|
||||
1. Navigate to the **Sports Configuration** tab
|
||||
2. Select the league (NHL, NBA, MLB, NFL)
|
||||
3. Choose your favorite teams from the dropdown
|
||||
4. Enable "Show favorite teams only" if desired
|
||||
5. Click **Save Configuration**
|
||||
6. Restart the display
|
||||
|
||||
### Troubleshooting Display Issues
|
||||
|
||||
1. Navigate to the **Logs** tab
|
||||
2. Look for ERROR or WARNING messages
|
||||
3. Filter by the problematic plugin or component
|
||||
4. Check the error message for clues
|
||||
5. See [TROUBLESHOOTING.md](TROUBLESHOOTING.md) for common solutions
|
||||
|
||||
---
|
||||
|
||||
## Real-Time Features
|
||||
|
||||
The web interface uses Server-Sent Events (SSE) for real-time updates:
|
||||
|
||||
**Live Updates:**
|
||||
- System stats refresh automatically every few seconds
|
||||
- Display preview updates in real-time
|
||||
- Logs stream continuously
|
||||
- No page refresh required
|
||||
|
||||
**Performance:**
|
||||
- Minimal bandwidth usage
|
||||
- Server-side rendering for fast load times
|
||||
- Progressive enhancement - works without JavaScript
|
||||
|
||||
---
|
||||
|
||||
## Mobile Access
|
||||
|
||||
The interface is fully responsive and works on mobile devices:
|
||||
|
||||
**Mobile Features:**
|
||||
- Touch-friendly interface
|
||||
- Responsive layout adapts to screen size
|
||||
- All features available on mobile
|
||||
- Swipe navigation between tabs
|
||||
|
||||
**Tips for Mobile:**
|
||||
- Use landscape mode for better visibility
|
||||
- Pinch to zoom on display preview
|
||||
- Long-press for context menus
|
||||
|
||||
---
|
||||
|
||||
## Keyboard Shortcuts
|
||||
|
||||
Use keyboard shortcuts for faster navigation:
|
||||
|
||||
- **Tab**: Navigate between form fields
|
||||
- **Enter**: Submit forms
|
||||
- **Esc**: Close modals
|
||||
- **Ctrl+F**: Search in logs
|
||||
|
||||
---
|
||||
|
||||
## API Access
|
||||
|
||||
The web interface is built on a REST API that you can access programmatically:
|
||||
|
||||
**API Base URL:**
|
||||
```
|
||||
http://your-pi-ip:5050/api
|
||||
```
|
||||
|
||||
**Common Endpoints:**
|
||||
- `GET /api/config/main` - Get configuration
|
||||
- `POST /api/config/main` - Update configuration
|
||||
- `GET /api/system/status` - Get system status
|
||||
- `POST /api/system/action` - Control display (start/stop/restart)
|
||||
- `GET /api/plugins/installed` - List installed plugins
|
||||
|
||||
**Note:** See [REST_API_REFERENCE.md](REST_API_REFERENCE.md) for complete API documentation.
|
||||
|
||||
---
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Interface Won't Load
|
||||
|
||||
**Problem:** Browser shows "Unable to connect" or "Connection refused"
|
||||
|
||||
**Solutions:**
|
||||
1. Verify the web service is running:
|
||||
```bash
|
||||
sudo systemctl status ledmatrix-web
|
||||
```
|
||||
|
||||
2. Start the service if stopped:
|
||||
```bash
|
||||
sudo systemctl start ledmatrix-web
|
||||
```
|
||||
|
||||
3. Check that port 5050 is not blocked by firewall
|
||||
4. Verify the Pi's IP address is correct
|
||||
|
||||
### Changes Not Applying
|
||||
|
||||
**Problem:** Configuration changes don't take effect
|
||||
|
||||
**Solutions:**
|
||||
1. Ensure you clicked "Save Configuration"
|
||||
2. Restart the display service for changes to apply:
|
||||
```bash
|
||||
sudo systemctl restart ledmatrix
|
||||
```
|
||||
3. Check logs for error messages
|
||||
|
||||
### Display Preview Not Updating
|
||||
|
||||
**Problem:** Display preview shows old content or doesn't update
|
||||
|
||||
**Solutions:**
|
||||
1. Refresh the browser page (F5)
|
||||
2. Check that the display service is running
|
||||
3. Verify SSE streams are working (check browser console)
|
||||
|
||||
### Plugin Configuration Not Saving
|
||||
|
||||
**Problem:** Plugin settings revert after restart
|
||||
|
||||
**Solutions:**
|
||||
1. Check file permissions on `config/config.json`:
|
||||
```bash
|
||||
ls -l config/config.json
|
||||
```
|
||||
2. Ensure the web service has write permissions
|
||||
3. Check logs for permission errors
|
||||
|
||||
---
|
||||
|
||||
## Security Considerations
|
||||
|
||||
**Network Access:**
|
||||
- The interface is accessible to anyone on your local network
|
||||
- No authentication is currently implemented
|
||||
- Recommended for trusted networks only
|
||||
|
||||
**Best Practices:**
|
||||
1. Run on a private network (not exposed to internet)
|
||||
2. Use a firewall to restrict access if needed
|
||||
3. Consider VPN access for remote control
|
||||
4. Keep the system updated
|
||||
|
||||
---
|
||||
|
||||
## Technical Details
|
||||
|
||||
### Architecture
|
||||
|
||||
The web interface uses modern web technologies:
|
||||
|
||||
- **Backend:** Flask with Blueprint-based modular design
|
||||
- **Frontend:** HTMX for dynamic content, Alpine.js for reactive components
|
||||
- **Styling:** Tailwind CSS for responsive design
|
||||
- **Real-Time:** Server-Sent Events (SSE) for live updates
|
||||
|
||||
### File Locations
|
||||
|
||||
**Configuration:**
|
||||
- Main config: `/config/config.json`
|
||||
- Secrets: `/config/config_secrets.json`
|
||||
- WiFi config: `/config/wifi_config.json`
|
||||
|
||||
**Logs:**
|
||||
- Display service: `sudo journalctl -u ledmatrix -f`
|
||||
- Web service: `sudo journalctl -u ledmatrix-web -f`
|
||||
|
||||
**Plugins:**
|
||||
- Plugin directory: `/plugins/`
|
||||
- Plugin config: `/config/config.json` (per-plugin sections)
|
||||
|
||||
---
|
||||
|
||||
## Related Documentation
|
||||
|
||||
- [PLUGIN_STORE_GUIDE.md](PLUGIN_STORE_GUIDE.md) - Installing and managing plugins
|
||||
- [REST_API_REFERENCE.md](REST_API_REFERENCE.md) - Complete REST API documentation
|
||||
- [TROUBLESHOOTING.md](TROUBLESHOOTING.md) - Troubleshooting common issues
|
||||
- [FONT_MANAGER.md](FONT_MANAGER.md) - Font management details
|
||||
631
docs/WIFI_NETWORK_SETUP.md
Normal file
631
docs/WIFI_NETWORK_SETUP.md
Normal file
@@ -0,0 +1,631 @@
|
||||
# WiFi Network Setup Guide
|
||||
|
||||
## Overview
|
||||
|
||||
The LEDMatrix WiFi system provides automatic network configuration with intelligent failover to Access Point (AP) mode. When your Raspberry Pi loses network connectivity, it automatically creates a WiFi access point for easy configuration—ensuring you can always connect to your device.
|
||||
|
||||
### Key Features
|
||||
|
||||
- **Automatic AP Mode**: Creates a WiFi access point when network connection is lost
|
||||
- **Intelligent Failover**: Only activates after a grace period to prevent false positives
|
||||
- **Dual Connectivity**: Supports both WiFi and Ethernet with automatic priority management
|
||||
- **Web Interface**: Configure WiFi through an easy-to-use web interface
|
||||
- **Network Scanning**: Scan and connect to available WiFi networks
|
||||
- **Secure Storage**: WiFi credentials stored securely
|
||||
|
||||
---
|
||||
|
||||
## Quick Start
|
||||
|
||||
### Accessing WiFi Setup
|
||||
|
||||
**If not connected to WiFi:**
|
||||
1. Wait 90 seconds after boot (AP mode activation grace period)
|
||||
2. Connect to WiFi network: **LEDMatrix-Setup** (open network)
|
||||
3. Open browser to: `http://192.168.4.1:5050`
|
||||
4. Navigate to the WiFi tab
|
||||
5. Scan, select your network, and connect
|
||||
|
||||
**If already connected:**
|
||||
1. Open browser to: `http://your-pi-ip:5050`
|
||||
2. Navigate to the WiFi tab
|
||||
3. Configure as needed
|
||||
|
||||
---
|
||||
|
||||
## Installation
|
||||
|
||||
### Prerequisites
|
||||
|
||||
The following packages are required:
|
||||
- **hostapd** - Access point software
|
||||
- **dnsmasq** - DHCP server for AP mode
|
||||
- **NetworkManager** - WiFi management
|
||||
|
||||
### Install WiFi Monitor Service
|
||||
|
||||
```bash
|
||||
cd /home/ledpi/LEDMatrix
|
||||
sudo ./scripts/install/install_wifi_monitor.sh
|
||||
```
|
||||
|
||||
This script will:
|
||||
- Check for required packages and offer to install them
|
||||
- Create the systemd service file
|
||||
- Enable and start the WiFi monitor service
|
||||
- Configure the service to start on boot
|
||||
|
||||
### Verify Installation
|
||||
|
||||
```bash
|
||||
# Check service status
|
||||
sudo systemctl status ledmatrix-wifi-monitor
|
||||
|
||||
# Run verification script
|
||||
./scripts/verify_wifi_setup.sh
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Configuration
|
||||
|
||||
### Configuration File
|
||||
|
||||
WiFi settings are stored in `config/wifi_config.json`:
|
||||
|
||||
```json
|
||||
{
|
||||
"ap_ssid": "LEDMatrix-Setup",
|
||||
"ap_password": "",
|
||||
"ap_channel": 7,
|
||||
"auto_enable_ap_mode": true,
|
||||
"saved_networks": [
|
||||
{
|
||||
"ssid": "YourNetwork",
|
||||
"password": "your-password",
|
||||
"saved_at": 1234567890.0
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
### Configuration Options
|
||||
|
||||
| Setting | Default | Description |
|
||||
|---------|---------|-------------|
|
||||
| `ap_ssid` | `LEDMatrix-Setup` | Network name for AP mode |
|
||||
| `ap_password` | `` (empty) | AP password (empty = open network) |
|
||||
| `ap_channel` | `7` | WiFi channel (use 1, 6, or 11 for non-overlapping) |
|
||||
| `auto_enable_ap_mode` | `true` | Automatically enable AP mode when disconnected |
|
||||
| `saved_networks` | `[]` | Array of saved WiFi credentials |
|
||||
|
||||
### Auto-Enable AP Mode Behavior
|
||||
|
||||
**When enabled (`true` - recommended):**
|
||||
- AP mode activates automatically after 90-second grace period
|
||||
- Only when both WiFi AND Ethernet are disconnected
|
||||
- Automatically disables when either WiFi or Ethernet connects
|
||||
- Best for portable devices or unreliable network environments
|
||||
|
||||
**When disabled (`false`):**
|
||||
- AP mode must be manually enabled through web interface
|
||||
- Prevents unnecessary AP activation
|
||||
- Best for devices with stable network connections
|
||||
|
||||
---
|
||||
|
||||
## Using WiFi Setup
|
||||
|
||||
### Connecting to a WiFi Network
|
||||
|
||||
**Via Web Interface:**
|
||||
1. Navigate to the **WiFi** tab
|
||||
2. Click **Scan** to search for networks
|
||||
3. Select a network from the dropdown (or enter SSID manually)
|
||||
4. Enter the WiFi password (leave empty for open networks)
|
||||
5. Click **Connect**
|
||||
6. System will attempt connection
|
||||
7. AP mode automatically disables once connected
|
||||
|
||||
**Via API:**
|
||||
```bash
|
||||
# Scan for networks
|
||||
curl "http://your-pi-ip:5050/api/wifi/scan"
|
||||
|
||||
# Connect to network
|
||||
curl -X POST http://your-pi-ip:5050/api/wifi/connect \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{"ssid": "YourNetwork", "password": "your-password"}'
|
||||
```
|
||||
|
||||
### Manual AP Mode Control
|
||||
|
||||
**Via Web Interface:**
|
||||
- **Enable AP Mode**: Click "Enable AP Mode" button (only when WiFi/Ethernet disconnected)
|
||||
- **Disable AP Mode**: Click "Disable AP Mode" button (when AP is active)
|
||||
|
||||
**Via API:**
|
||||
```bash
|
||||
# Enable AP mode
|
||||
curl -X POST http://your-pi-ip:5050/api/wifi/ap/enable
|
||||
|
||||
# Disable AP mode
|
||||
curl -X POST http://your-pi-ip:5050/api/wifi/ap/disable
|
||||
```
|
||||
|
||||
**Note:** Manual enable still requires both WiFi and Ethernet to be disconnected.
|
||||
|
||||
---
|
||||
|
||||
## Understanding AP Mode Failover
|
||||
|
||||
### How the Grace Period Works
|
||||
|
||||
The system uses a **grace period mechanism** to prevent false positives from temporary network hiccups:
|
||||
|
||||
```
|
||||
Check Interval: 30 seconds (default)
|
||||
Required Checks: 3 consecutive
|
||||
Grace Period: 90 seconds total
|
||||
```
|
||||
|
||||
**Timeline Example:**
|
||||
```
|
||||
Time 0s: WiFi disconnects
|
||||
Time 30s: Check 1 - Disconnected (counter = 1)
|
||||
Time 60s: Check 2 - Disconnected (counter = 2)
|
||||
Time 90s: Check 3 - Disconnected (counter = 3) → AP MODE ENABLED
|
||||
```
|
||||
|
||||
If WiFi or Ethernet reconnects at any point, the counter resets to 0.
|
||||
|
||||
### Why Grace Period is Important
|
||||
|
||||
Without a grace period, AP mode would activate during:
|
||||
- Brief network hiccups
|
||||
- Router reboots
|
||||
- Temporary signal interference
|
||||
- NetworkManager reconnection attempts
|
||||
|
||||
The 90-second grace period ensures AP mode only activates during **sustained disconnection**.
|
||||
|
||||
### Connection Priority
|
||||
|
||||
The system checks connections in this order:
|
||||
1. **WiFi Connection** (highest priority)
|
||||
2. **Ethernet Connection** (fallback)
|
||||
3. **AP Mode** (last resort - only when both WiFi and Ethernet disconnected)
|
||||
|
||||
### Behavior Summary
|
||||
|
||||
| WiFi Status | Ethernet Status | Auto-Enable | AP Mode Behavior |
|
||||
|-------------|-----------------|-------------|------------------|
|
||||
| Any | Any | `false` | Manual enable only |
|
||||
| Connected | Any | `true` | Disabled |
|
||||
| Disconnected | Connected | `true` | Disabled (Ethernet available) |
|
||||
| Disconnected | Disconnected | `true` | Auto-enabled after 90s |
|
||||
|
||||
---
|
||||
|
||||
## Access Point Configuration
|
||||
|
||||
### AP Mode Settings
|
||||
|
||||
- **SSID**: LEDMatrix-Setup (configurable)
|
||||
- **Network**: Open (no password by default)
|
||||
- **IP Address**: 192.168.4.1
|
||||
- **DHCP Range**: 192.168.4.2 - 192.168.4.20
|
||||
- **Channel**: 7 (configurable)
|
||||
|
||||
### Accessing Services in AP Mode
|
||||
|
||||
When AP mode is active:
|
||||
- Web Interface: `http://192.168.4.1:5050`
|
||||
- SSH: `ssh ledpi@192.168.4.1`
|
||||
- Captive portal may automatically redirect browsers
|
||||
|
||||
---
|
||||
|
||||
## Best Practices
|
||||
|
||||
### Security Recommendations
|
||||
|
||||
**1. Change AP Password (Optional):**
|
||||
```json
|
||||
{
|
||||
"ap_password": "your-strong-password"
|
||||
}
|
||||
```
|
||||
|
||||
**Note:** The default is an open network for easy initial setup. For deployments in public areas, consider adding a password.
|
||||
|
||||
**2. Use Non-Overlapping WiFi Channels:**
|
||||
- Channels 1, 6, 11 are non-overlapping (2.4GHz)
|
||||
- Choose a channel that doesn't conflict with your primary network
|
||||
- Example: If primary uses channel 1, use channel 11 for AP mode
|
||||
|
||||
**3. Secure WiFi Credentials:**
|
||||
```bash
|
||||
sudo chmod 600 config/wifi_config.json
|
||||
```
|
||||
|
||||
### Network Configuration Tips
|
||||
|
||||
**Save Multiple Networks:**
|
||||
```json
|
||||
{
|
||||
"saved_networks": [
|
||||
{
|
||||
"ssid": "Home-Network",
|
||||
"password": "home-password"
|
||||
},
|
||||
{
|
||||
"ssid": "Office-Network",
|
||||
"password": "office-password"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
**Adjust Check Interval:**
|
||||
|
||||
Edit the systemd service file to change grace period:
|
||||
```bash
|
||||
sudo systemctl edit ledmatrix-wifi-monitor
|
||||
```
|
||||
|
||||
Add:
|
||||
```ini
|
||||
[Service]
|
||||
ExecStart=
|
||||
ExecStart=/usr/bin/python3 /path/to/LEDMatrix/scripts/utils/wifi_monitor_daemon.py --interval 20
|
||||
```
|
||||
|
||||
**Note:** Interval affects grace period:
|
||||
- 20-second interval = 60-second grace period (3 × 20)
|
||||
- 30-second interval = 90-second grace period (3 × 30) ← Default
|
||||
- 60-second interval = 180-second grace period (3 × 60)
|
||||
|
||||
---
|
||||
|
||||
## Configuration Scenarios
|
||||
|
||||
### Scenario 1: Portable Device with Auto-Failover (Recommended)
|
||||
|
||||
**Use Case:** Device may lose WiFi connection
|
||||
|
||||
**Configuration:**
|
||||
```json
|
||||
{
|
||||
"auto_enable_ap_mode": true
|
||||
}
|
||||
```
|
||||
|
||||
**Behavior:**
|
||||
- AP mode activates automatically after 90 seconds of disconnection
|
||||
- Always provides a way to connect
|
||||
- Best for devices that move or have unreliable WiFi
|
||||
|
||||
### Scenario 2: Stable Network Connection
|
||||
|
||||
**Use Case:** Ethernet or reliable WiFi connection
|
||||
|
||||
**Configuration:**
|
||||
```json
|
||||
{
|
||||
"auto_enable_ap_mode": false
|
||||
}
|
||||
```
|
||||
|
||||
**Behavior:**
|
||||
- AP mode must be manually enabled
|
||||
- Prevents unnecessary activation
|
||||
- Best for stationary devices with stable connections
|
||||
|
||||
### Scenario 3: Ethernet Primary with WiFi Backup
|
||||
|
||||
**Use Case:** Primary Ethernet, WiFi as backup
|
||||
|
||||
**Configuration:**
|
||||
```json
|
||||
{
|
||||
"auto_enable_ap_mode": true
|
||||
}
|
||||
```
|
||||
|
||||
**Behavior:**
|
||||
- Ethernet connection prevents AP mode activation
|
||||
- If Ethernet disconnects, WiFi is attempted
|
||||
- If both disconnect, AP mode activates after grace period
|
||||
- Best for devices with both Ethernet and WiFi
|
||||
|
||||
---
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### AP Mode Not Activating
|
||||
|
||||
**Check 1: Auto-Enable Setting**
|
||||
```bash
|
||||
cat config/wifi_config.json | grep auto_enable_ap_mode
|
||||
```
|
||||
Should show `"auto_enable_ap_mode": true`
|
||||
|
||||
**Check 2: Service Status**
|
||||
```bash
|
||||
sudo systemctl status ledmatrix-wifi-monitor
|
||||
```
|
||||
Service should be `active (running)`
|
||||
|
||||
**Check 3: Grace Period**
|
||||
- Wait at least 90 seconds after disconnection
|
||||
- Check logs: `sudo journalctl -u ledmatrix-wifi-monitor -f`
|
||||
|
||||
**Check 4: Ethernet Connection**
|
||||
- If Ethernet is connected, AP mode won't activate
|
||||
- Verify: `nmcli device status`
|
||||
- Disconnect Ethernet to test AP mode
|
||||
|
||||
**Check 5: Required Packages**
|
||||
```bash
|
||||
# Verify hostapd is installed
|
||||
which hostapd
|
||||
|
||||
# Verify dnsmasq is installed
|
||||
which dnsmasq
|
||||
```
|
||||
|
||||
### Cannot Access AP Mode
|
||||
|
||||
**Check 1: AP Mode Active**
|
||||
```bash
|
||||
sudo systemctl status hostapd
|
||||
sudo systemctl status dnsmasq
|
||||
```
|
||||
Both should be running
|
||||
|
||||
**Check 2: Network Interface**
|
||||
```bash
|
||||
ip addr show wlan0
|
||||
```
|
||||
Should show IP `192.168.4.1`
|
||||
|
||||
**Check 3: WiFi Interface Available**
|
||||
```bash
|
||||
ip link show wlan0
|
||||
```
|
||||
Interface should exist
|
||||
|
||||
**Check 4: Try Manual Enable**
|
||||
- Use web interface: WiFi tab → Enable AP Mode
|
||||
- Or via API: `curl -X POST http://localhost:5050/api/wifi/ap/enable`
|
||||
|
||||
### Cannot Connect to WiFi Network
|
||||
|
||||
**Check 1: Verify Credentials**
|
||||
- Ensure SSID and password are correct
|
||||
- Check for hidden networks (manual SSID entry required)
|
||||
|
||||
**Check 2: Check Logs**
|
||||
```bash
|
||||
# WiFi monitor logs
|
||||
sudo journalctl -u ledmatrix-wifi-monitor -f
|
||||
|
||||
# NetworkManager logs
|
||||
sudo journalctl -u NetworkManager -n 50
|
||||
```
|
||||
|
||||
**Check 3: Network Compatibility**
|
||||
- Verify network is 2.4GHz (5GHz may not be supported on all Pi models)
|
||||
- Check if network requires special authentication
|
||||
|
||||
### AP Mode Not Disabling After WiFi Connect
|
||||
|
||||
**Check 1: WiFi Connection Status**
|
||||
```bash
|
||||
nmcli device status
|
||||
```
|
||||
|
||||
**Check 2: Manually Disable**
|
||||
- Use web interface: WiFi tab → Disable AP Mode
|
||||
- Or restart service: `sudo systemctl restart ledmatrix-wifi-monitor`
|
||||
|
||||
**Check 3: Check Logs**
|
||||
```bash
|
||||
sudo journalctl -u ledmatrix-wifi-monitor -n 50
|
||||
```
|
||||
|
||||
### AP Mode Activating Unexpectedly
|
||||
|
||||
**Check 1: Network Stability**
|
||||
- Verify WiFi connection is stable
|
||||
- Check router status
|
||||
- Check signal strength
|
||||
|
||||
**Check 2: Disable Auto-Enable**
|
||||
```bash
|
||||
nano config/wifi_config.json
|
||||
# Change: "auto_enable_ap_mode": false
|
||||
sudo systemctl restart ledmatrix-wifi-monitor
|
||||
```
|
||||
|
||||
**Check 3: Increase Grace Period**
|
||||
- Edit service file to increase check interval
|
||||
- Longer interval = longer grace period
|
||||
- See "Best Practices" section above
|
||||
|
||||
---
|
||||
|
||||
## Monitoring and Diagnostics
|
||||
|
||||
### Check WiFi Status
|
||||
|
||||
**Via Python:**
|
||||
```python
|
||||
from src.wifi_manager import WiFiManager
|
||||
|
||||
wm = WiFiManager()
|
||||
status = wm.get_wifi_status()
|
||||
|
||||
print(f'Connected: {status.connected}')
|
||||
print(f'SSID: {status.ssid}')
|
||||
print(f'IP Address: {status.ip_address}')
|
||||
print(f'AP Mode Active: {status.ap_mode_active}')
|
||||
print(f'Auto-Enable: {wm.config.get("auto_enable_ap_mode", False)}')
|
||||
```
|
||||
|
||||
**Via NetworkManager:**
|
||||
```bash
|
||||
# View device status
|
||||
nmcli device status
|
||||
|
||||
# View connections
|
||||
nmcli connection show
|
||||
|
||||
# View available WiFi networks
|
||||
nmcli device wifi list
|
||||
```
|
||||
|
||||
### View Service Logs
|
||||
|
||||
```bash
|
||||
# Real-time logs
|
||||
sudo journalctl -u ledmatrix-wifi-monitor -f
|
||||
|
||||
# Recent logs (last 50 lines)
|
||||
sudo journalctl -u ledmatrix-wifi-monitor -n 50
|
||||
|
||||
# Logs from specific time
|
||||
sudo journalctl -u ledmatrix-wifi-monitor --since "1 hour ago"
|
||||
```
|
||||
|
||||
### Run Verification Script
|
||||
|
||||
```bash
|
||||
cd /home/ledpi/LEDMatrix
|
||||
./scripts/verify_wifi_setup.sh
|
||||
```
|
||||
|
||||
Checks:
|
||||
- Required packages installed
|
||||
- WiFi monitor service running
|
||||
- Configuration files valid
|
||||
- WiFi interface available
|
||||
- Current connection status
|
||||
- AP mode status
|
||||
|
||||
---
|
||||
|
||||
## Service Management
|
||||
|
||||
### Useful Commands
|
||||
|
||||
```bash
|
||||
# Check service status
|
||||
sudo systemctl status ledmatrix-wifi-monitor
|
||||
|
||||
# Start the service
|
||||
sudo systemctl start ledmatrix-wifi-monitor
|
||||
|
||||
# Stop the service
|
||||
sudo systemctl stop ledmatrix-wifi-monitor
|
||||
|
||||
# Restart the service
|
||||
sudo systemctl restart ledmatrix-wifi-monitor
|
||||
|
||||
# View logs
|
||||
sudo journalctl -u ledmatrix-wifi-monitor -f
|
||||
|
||||
# Disable service from starting on boot
|
||||
sudo systemctl disable ledmatrix-wifi-monitor
|
||||
|
||||
# Enable service to start on boot
|
||||
sudo systemctl enable ledmatrix-wifi-monitor
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## API Reference
|
||||
|
||||
The WiFi setup feature exposes the following API endpoints:
|
||||
|
||||
| Method | Endpoint | Description |
|
||||
|--------|----------|-------------|
|
||||
| GET | `/api/wifi/status` | Get current WiFi connection status |
|
||||
| GET | `/api/wifi/scan` | Scan for available WiFi networks |
|
||||
| POST | `/api/wifi/connect` | Connect to a WiFi network |
|
||||
| POST | `/api/wifi/ap/enable` | Enable access point mode |
|
||||
| POST | `/api/wifi/ap/disable` | Disable access point mode |
|
||||
| GET | `/api/wifi/ap/auto-enable` | Get auto-enable setting |
|
||||
| POST | `/api/wifi/ap/auto-enable` | Set auto-enable setting |
|
||||
|
||||
### Example Usage
|
||||
|
||||
```bash
|
||||
# Get WiFi status
|
||||
curl "http://your-pi-ip:5050/api/wifi/status"
|
||||
|
||||
# Scan for networks
|
||||
curl "http://your-pi-ip:5050/api/wifi/scan"
|
||||
|
||||
# Connect to network
|
||||
curl -X POST http://your-pi-ip:5050/api/wifi/connect \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{"ssid": "MyNetwork", "password": "mypassword"}'
|
||||
|
||||
# Enable AP mode
|
||||
curl -X POST http://your-pi-ip:5050/api/wifi/ap/enable
|
||||
|
||||
# Check auto-enable setting
|
||||
curl "http://your-pi-ip:5050/api/wifi/ap/auto-enable"
|
||||
|
||||
# Set auto-enable
|
||||
curl -X POST http://your-pi-ip:5050/api/wifi/ap/auto-enable \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{"auto_enable_ap_mode": true}'
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Technical Details
|
||||
|
||||
### WiFi Monitor Daemon
|
||||
|
||||
The WiFi monitor daemon (`wifi_monitor_daemon.py`) runs as a background service that:
|
||||
|
||||
1. Checks WiFi and Ethernet connection status every 30 seconds (configurable)
|
||||
2. Maintains disconnected check counter for grace period
|
||||
3. Automatically enables AP mode when:
|
||||
- `auto_enable_ap_mode` is enabled AND
|
||||
- Both WiFi and Ethernet disconnected AND
|
||||
- Grace period elapsed (3 consecutive checks)
|
||||
4. Automatically disables AP mode when WiFi or Ethernet connects
|
||||
5. Logs all state changes
|
||||
|
||||
### WiFi Detection Methods
|
||||
|
||||
The WiFi manager tries multiple methods:
|
||||
|
||||
1. **NetworkManager (nmcli)** - Preferred method
|
||||
2. **iwconfig** - Fallback for systems without NetworkManager
|
||||
|
||||
### Network Scanning Methods
|
||||
|
||||
1. **nmcli** - Fast, preferred method
|
||||
2. **iwlist** - Fallback for older systems
|
||||
|
||||
### Access Point Implementation
|
||||
|
||||
- Uses `hostapd` for WiFi access point functionality
|
||||
- Uses `dnsmasq` for DHCP and DNS services
|
||||
- Configures wlan0 interface with IP 192.168.4.1
|
||||
- Provides DHCP range: 192.168.4.2-20
|
||||
- Captive portal with DNS redirection
|
||||
|
||||
---
|
||||
|
||||
## Related Documentation
|
||||
|
||||
- [WEB_INTERFACE_GUIDE.md](WEB_INTERFACE_GUIDE.md) - Using the web interface
|
||||
- [TROUBLESHOOTING.md](TROUBLESHOOTING.md) - General troubleshooting
|
||||
- [GETTING_STARTED.md](GETTING_STARTED.md) - Initial setup guide
|
||||
Reference in New Issue
Block a user