34 Commits

Author SHA1 Message Date
agessaman
d084c6bd29 Enhance PrefixCommand to support multi-byte hex prefix lookups
- Updated the command to handle 1-, 2-, or 3-byte hex prefixes, with longer input truncated to 3 bytes.
- Improved usage instructions and examples to clarify accepted prefix formats (2, 4, or 6 hex characters).
- Enhanced validation logic for prefix format, ensuring proper handling of hex strings and truncation.
- Updated documentation strings to reflect changes in prefix handling and expected input formats.
2026-03-09 14:54:23 -07:00
agessaman
6b624c567a Enhance path handling and database schema for multi-byte prefix support
- Introduced a new utility function `decode_path_len_byte` to decode RF packet path length bytes, supporting both legacy and multi-byte paths.
- Updated various modules to utilize the new decoding logic, ensuring compatibility with configured prefix lengths.
- Modified database schemas to include `bytes_per_hop` and `out_bytes_per_hop` columns for better path management.
- Enhanced path parsing and validation across commands and services to accommodate variable prefix lengths.
- Improved logging and error handling for path-related operations, ensuring robustness during transitions.
2026-02-28 13:03:48 -08:00
Ian Rifkin
36a8a67543 Add transitional support for 2-byte prefixes while keeping legacy 1-byte compatibility
- Update prefix command to accept BOTH legacy 2-char prefixes and
  configured prefix_hex_chars (e.g. 4-char) during firmware transition
- Replace strict length validation with dual-length validation (2 or N)
- Ensure prefix lookups work with either input length via LIKE matching
- Update related SQL prefix extraction to use configured prefix length
- Add fallback handling in path parsing for legacy 2-char route data

Notes:
- This is an interim compatibility change to support mixed networks
  where RF path data is still 1-byte while bot config may be 2-byte.
- Needs additional testing across real multi-hop scenarios and mixed
  bot configurations.
- Translation updates are incomplete: only English strings were updated;
  other translation files still need review.
- Behavior and UX may need refinement after real-world testing.
2026-02-27 23:48:27 -05:00
agessaman
1b5a3dbd0e Improve message handling across multiple commands to respect per-user rate limits
- Updated the `send_response` method calls in various command classes to include a `skip_user_rate_limit` parameter for message continuations, ensuring that the per-user rate limit applies only to the first message.
- This change improves user experience by allowing seamless message continuations without unnecessary rate limiting.
2026-02-18 09:16:42 -08:00
agessaman
ec4b4dbc66 feat: Enhance PathCommand with SNR integration and location validation
- Added SNR (Signal-to-Noise Ratio) data handling to improve zero-hop bonus calculations for repeaters, enhancing selection accuracy.
- Implemented location validation checks to prioritize repeaters with valid geographic data, especially for final hop scenarios.
- Updated scoring logic to apply penalties for repeaters lacking valid location data, ensuring better routing decisions.
- Enhanced logging for SNR bonuses and location penalties to improve debugging and performance tracking.
2026-01-26 17:37:36 -08:00
agessaman
1559860dcb feat: Introduce prefix best location feature and enhance message handling
- Added configuration options for the "prefix best <location>" command in config.ini.example, allowing users to enable/disable the feature and customize its behavior.
- Implemented logic in the PrefixCommand class to find the best prefix for a given location, considering neighbor prefixes and user-defined criteria.
- Enhanced MessageHandler to skip processing old cached messages based on connection time, improving message handling efficiency.
- Updated core bot to track connection time, ensuring accurate message processing and cache management.
2026-01-26 17:15:25 -08:00
agessaman
d2abc49048 feat: Enhance command documentation and usage information
- Updated the `generate_html` function to include detailed command usage information, including syntax, examples, and parameters for better user guidance.
- Added CSS styles for improved presentation of command usage and parameters in the generated website documentation.
- Enhanced command classes with structured documentation fields, allowing for consistent and informative command descriptions across the platform.
2026-01-15 20:04:58 -08:00
agessaman
cc3fffeb54 feat: Add command enable/disable configuration for various commands
- Implemented a configuration option for enabling or disabling commands across multiple command classes.
- Each command now checks its enabled state before execution, improving control over command availability.
- Updated the configuration loading mechanism to retrieve the enabled state from the config file for commands like Advert, AQI, Catfact, and others.
2026-01-10 09:33:15 -08:00
agessaman
52d1dac3db feat: Introduce ESPN and TheSportsDB clients and enhance command code quality with type hints and docstrings. 2026-01-01 21:55:48 -08:00
agessaman
e4e70930f9 Update README and enhance command functionality
- Updated README to specify submitting pull requests against the dev branch.
- Added per-trigger lockout tracking in AnnouncementsCommand to prevent duplicate sends within a 60-second window.
- Implemented dynamic maximum message length calculation in BaseCommand for better message formatting.
- Enhanced response handling in PrefixCommand to support message splitting based on calculated length.
2025-12-31 16:54:38 -08:00
agessaman
32929dedad Update CommandManager with internet connectivity checks for commands
- Introduced caching mechanisms for internet connectivity status in CommandManager to optimize performance and reduce redundant checks.
- Updated command execution logic to skip commands requiring internet access when connectivity is unavailable, improving user experience and error handling.
- Added synchronous and asynchronous utility functions for checking internet connectivity in utils.py.
- Marked relevant commands (e.g., AlertCommand, AqiCommand, DadJokeCommand) as requiring internet access to ensure proper execution conditions.
2025-12-17 12:38:54 -08:00
agessaman
4abd6fff69 Update configuration and command handling for prefix settings
- Simplified comments in config.ini.example and core.py to clarify API endpoint configuration.
- Changed default value for prefix_free_days from 30 to 7 in prefix_command.py to align with recent adjustments in prefix handling logic.
- Enhanced logic in prefix_command.py to prioritize API cache for used prefixes and fallback to database only when necessary, improving efficiency and accuracy in prefix data retrieval.
2025-12-11 20:41:31 -08:00
agessaman
92f063b4bc Add Nominatim rate limiting and caching enhancements across commands. Introduce NominatimRateLimiter for API compliance, update geocoding methods to utilize rate-limited calls, and extend caching duration for geocoding results to 30 days. Refactor command implementations to improve efficiency and prevent duplicate API requests. 2025-11-26 14:34:45 -08:00
agessaman
6c660dc14c Enhance configuration and command files to support new distance metrics in message responses. Updated Keywords section to include {path_distance} and {firstlast_distance} placeholders. Refactored distance calculation methods into utils and improved path command logic for better accuracy in distance reporting. Added detailed logging for packet hash calculations and message handling in multitest command. 2025-11-20 21:41:10 -08:00
agessaman
7e2c478662 Implement localization support across various commands and configuration. Added language settings in config.ini.example, integrated translation functionality in command responses, and enhanced error handling with localized messages. Improved fallback mechanisms for missing translations and updated help text for better user guidance. 2025-11-16 20:17:58 -08:00
agessaman
fd7f64c346 Add max prefix range configuration and distance filtering in PrefixCommand 2025-11-09 21:14:44 -08:00
agessaman
e2fb2d8cf7 fixed situation where 0 free prefixes was being interpreted as an error instead of data 2025-11-08 08:23:11 -08:00
agessaman
b3ddef401c Add prefix time window configuration options
- Introduced `prefix_heard_days` and `prefix_free_days` settings in the configuration to define time windows for showing heard and free prefixes.
- Updated `PrefixCommand` to utilize these new settings for filtering repeaters based on their last heard time.
2025-11-02 21:41:21 -08:00
agessaman
b773dcd0a1 Update help text in PrefixCommand to include 'available' as an option for listing free prefixes and adjust command handling to recognize 'AVAILABLE' alongside 'FREE'. 2025-11-02 16:41:21 -08:00
agessaman
7bb51f219b Web Viewer Integration
- Add Flask + Flask-SocketIO web viewer with dashboard (modules/web_viewer/app.py and related)
- Add web viewer templates: index, realtime, tracking (contacts), cache, purging, stats (modules/web_viewer/templates/)
- Add integration hooks and utility functions for web viewer (modules/web_viewer/integration.py, modules/utils.py)
- Add command to launch web viewer from bot CLI (modules/commands/webviewer_command.py)
- Update .gitignore: ignore db/log files, test scripts, and web viewer artifacts
- Add restart_viewer.sh helper script for standalone web viewer restart/troubleshooting
- Add guidance and documentation for modern viewer in WEB_VIEWER.md and docs/
- Various code structure and import improvements to core bot and command modules to support integration
- Add ACL support for sensitive commands
- Example config updates

Benefits:
- Decouples monitoring/UI from bot core process
- Enables real-time browser dashboard and unified contact/repeater tracking
- Easier integration, dev, and troubleshooting
2025-10-21 21:57:00 -07:00
agessaman
f524b3109d removed hardcoded reference to map.w0z.is, updated the path command to try to resolve prefix collisions using proximity and recency 2025-10-18 18:24:22 -07:00
agessaman
ae43a53793 added option to geolocate repeaters by their location, used by the prefix command 2025-10-07 17:29:58 -07:00
agessaman
025d3d539f Refactor command syntax and enhance test command functionality
- Updated the test command response format to include optional phrases.
- Removed the at_phrase command and its references from the command manager and help command.
- Adjusted configuration examples to reflect the new syntax for message acknowledgments.
- Enhanced the sports command with additional WNBA team support and improved city mappings for team searches.
2025-09-17 21:12:43 -07:00
agessaman
845d5fb4b0 Add total count context to 'prefix free' command 2025-09-07 16:08:20 -07:00
agessaman
7b6ddc97fc Update invalid prefix format message to clarify usage example 2025-09-07 15:49:21 -07:00
agessaman
69bac5585f Restrict prefix command to beginning of messages only 2025-09-07 15:44:25 -07:00
agessaman
41205fb2f4 added prefix command to check usage of prefixes and list free prefixes 2025-09-07 15:26:01 -07:00
agessaman
cb6a319b1b Add random selection to 'prefix free' command 2025-09-07 15:18:18 -07:00
agessaman
226fa8ee76 Fix 'prefix free' command accuracy 2025-09-07 15:16:46 -07:00
agessaman
5e0c937df2 Add 'prefix free' command to list available prefixes 2025-09-07 15:14:35 -07:00
agessaman
39c7aedc05 Make API source dynamic based on configured URL 2025-09-07 15:10:55 -07:00
agessaman
20d59c2452 Improve prefix command response formatting 2025-09-07 15:07:53 -07:00
agessaman
f4bddd1ec4 Add database fallback to prefix command
- Prefix command now falls back to local SQLite database when API is unavailable
- Queries repeater_contacts table for repeaters matching prefix pattern
- Uses public_key LIKE 'prefix%' to find repeaters by first two characters
- Only returns active repeaters (is_active = 1)
- Adds device type indicators: (Repeater) or (Room Server)
- Response indicates data source: 'API cache' vs 'local database (offline mode)'
- Updated help text to mention database fallback capability
- Tested with sample data: correctly finds repeaters by prefix
- Provides offline functionality when API is down or network unavailable
- Maintains API-first approach with intelligent fallback
2025-09-07 15:01:10 -07:00
agessaman
d695d0177a added prefix command that accesses MeshExplorer with configurable endpoint 2025-09-07 14:57:31 -07:00