Commit Graph
100 Commits
Author SHA1 Message Date
Adam Gessaman ccaaa534ff Added MQTTBridge memory management and debugging capabilities
- Added memory debugging features to log heap usage and fragmentation recovery for MQTT clients.
- Introduced `recreateMqttClientsForFragmentationRecovery()` to manage MQTT client lifecycles and reduce memory fragmentation.
- Updated critical memory checks to log detailed heap statistics and active MQTT client counts.
- Included new debug logging for memory status every 60 seconds when memory debugging is enabled.

This update aims to improve stability and performance in memory-constrained environments.
2026-02-04 18:28:17 -08:00
agessaman 498566e6c9 MQTT bridge: fix memory use, improve status reporting
- Main broker: only allocate _mqtt_client when custom broker configured
  (analyzer-only saves one PsychicMqttClient). Reconnect main broker after
  forced disconnect with 30s throttle; set last_attempt on disconnect so
  throttle applies and avoids reconnect storms on flaky WiFi.
- Analyzer clients: call disconnect() when WiFi transitions to disconnected
  so ESP-IDF frees MQTT buffers (it does not free on WiFi drop). Reduces
  fragmentation and Max drop after disconnect/reconnect cycles.
- get wifi.status: report WiFi uptime (Xd Xh Xm Xs) when WITH_MQTT_BRIDGE.
  Track connect time in bridge; backfill when already connected at first check.
- get mqtt.status: show msgs on/off, broker (connected/disconnected/n/a),
  analyzer US/EU (connected/disconnected/off), and queue count.

Note: PsychicMqttClient change (register event only on first client creation)
belongs in the library repo if committed separately.
2026-02-02 19:09:31 -08:00
Adam Gessaman 7fda48d5d6 Merge pull request #2 from atoomnetmarc/mqtt-bridge-implementation
Add Heltec_T190_repeater_observer_mqtt environment
2026-02-02 10:06:58 -08:00
agessaman f91b715e51 Refactor MQTTBridge packet handling to clarify ownership and memory management
- Updated comments to specify that the Dispatcher owns the packet memory and should handle freeing.
- Removed unnecessary calls to free queued packets in the MQTTBridge, ensuring only references are discarded.
- Enhanced code clarity regarding packet lifecycle management in the end and processPacketQueue methods.
2026-01-31 22:19:19 -08:00
agessaman ee57731441 Add receive error tracking to Dispatcher and MQTT message builder
- Introduced `getPacketsRecvErrors()` method in `Dispatcher` to track receive errors.
- Updated `buildStatusMessage()` in `MQTTMessageBuilder` to include `recv_errors` parameter.
- Modified `publishStatus()` in `MQTTBridge` to retrieve and send receive error statistics.
- Adjusted `RadioLibWrappers` to override `getPacketsRecvErrors()` for consistency.
2026-01-29 19:18:52 -08:00
Adam Gessaman 37e51f3eb1 Merge branch 'dev' into mqtt-bridge-implementation 2026-01-29 08:58:58 -08:00
agessaman bb27cdedb6 Fix display header include for heltec_v4 when DISPLAY_CLASS is set directly
When DISPLAY_CLASS is defined via build flags but HELTEC_LORA_V4_OLED
or HELTEC_LORA_V4_TFT flags aren't set, include SSD1306Display.h as
fallback. This fixes compilation errors for environments like
heltec_v4_repeater_observer_mqtt that extend Heltec_lora32_v4 directly
and set DISPLAY_CLASS=SSD1306Display.
2026-01-27 12:52:09 -08:00
agessaman d96c900f10 Merge upstream/dev into mqtt-bridge-implementation
Resolved conflict in variants/heltec_v4/platformio.ini by keeping
detailed comments and PIN_BOARD_SDA/SCL definitions from HEAD.
2026-01-27 12:50:30 -08:00
agessaman 066df192a3 Revert to upstream's _max variable name in RegionMap.cpp
Upstream has fixed the _max macro conflict issue. Accepting their solution.
2026-01-27 12:47:08 -08:00
agessaman 2c99967c35 Refactor BufStream class in RegionMap.cpp to rename max variable for clarity
Updated the variable name from _max to _max_size in the BufStream class to improve code readability and maintainability. This change ensures consistency in naming conventions within the class.
2026-01-26 19:38:04 -08:00
agessaman 2a84e58b3a Merge upstream/dev into mqtt-bridge-responsiveness-changes
Resolved conflicts in:
- examples/simple_repeater/MyMesh.cpp: kept analyzer/MQTT origin code, updated acl.load() signature
- examples/simple_room_server/MyMesh.cpp: kept MQTT bridge init, added acl parameter to _cli constructor
- src/helpers/CommonCLI.cpp: merged MQTT get commands with ADC/power management commands
2026-01-26 19:30:45 -08:00
agessaman 9e1ce23ed1 Optimize MQTTBridge memory usage and NTP synchronization handling
- Updated NTP synchronization logic to prevent multiple simultaneous syncs, enhancing stability.
- Optimized buffer allocation for JSON messages, reducing stack memory usage by using size-adaptive buffers.
- Improved publish functions to utilize active buffers based on packet size, ensuring efficient memory management.
2026-01-24 17:19:26 -08:00
agessaman c67c329565 Enhance MQTTBridge status handling and publish logic
- Implemented a mechanism to force MQTT session reinitialization if status publishes fail for over 10 minutes, improving resilience.
- Updated memory pressure checks to align with packet publishing thresholds, ensuring consistent behavior.
- Refined status publish logic to avoid aggressive pre-checks, relying on actual publish attempts to handle connection issues.
- Modified publish functions for analyzer servers to return success status, enhancing error handling and logging.
2026-01-23 15:47:47 -08:00
agessaman c055228c91 Refactor MQTTBridge connection handling for improved stability and responsiveness
- Simplified connection attempt logic to allow immediate reconnects after failures.
- Added checks to ensure the MQTT client is disconnected before new connection attempts.
- Enhanced error handling during publish operations to reset connection state on failures.
- Removed aggressive health checks that caused connection instability, relying on the MQTT client library for connection management.
- Updated status publishing to verify connection state before attempting to publish, ensuring accurate broker status.
2026-01-22 07:51:38 -08:00
agessaman 39ba020fab Merge upstream/dev into mqtt-bridge-responsiveness-changes
Resolved conflicts in:
- examples/simple_repeater/MyMesh.cpp: merged comparison functions with new handler functions
- src/helpers/CommonCLI.cpp: merged MQTT fields handling with adc_multiplier and owner_info
- src/helpers/CommonCLI.h: merged NodePrefs struct changes
- variants/heltec_v3/platformio.ini: kept upstream WiFi settings
- variants/xiao_s3_wio/platformio.ini: added upstream environment definitions

Verified observer firmwares compile successfully.
2026-01-21 20:37:40 -08:00
agessaman ed27ebd015 Refactor MQTTBridge to utilize FreeRTOS for improved task management and responsiveness
- Moved MQTT processing to a dedicated FreeRTOS task on Core 0, enhancing non-blocking behavior.
- Implemented a FreeRTOS queue for thread-safe packet handling, replacing the previous circular buffer approach.
- Updated WiFi initialization and connection management to occur within the FreeRTOS task, improving overall system responsiveness.
- Enhanced logging and error handling for MQTT connections and packet processing.
- Cached broker and analyzer server statuses to reduce redundant checks and improve efficiency.
2026-01-21 20:28:36 -08:00
agessaman 56f98997e6 Update MQTT preferences to support configurable WiFi power save mode
- Added conditional compilation for WiFi power save settings in setMQTTPrefsDefaults.
- Updated platformio.ini files across multiple variants to define MQTT_WIFI_POWER_SAVE_DEFAULT and related configurations.
- Set default WiFi power save mode to 1 (none) when not explicitly defined, enhancing flexibility for different hardware setups.
2026-01-18 13:40:01 -08:00
agessaman 3eaca31f0f Refactor HeltecTrackerV2 and HeltecV4 board initialization for GC1109 FEM support
- Updated the begin() method to handle deep sleep and cold boot scenarios for GC1109 FEM pins.
- Improved pin configuration logic for power management and transmission control.
- Enhanced comments for clarity on pin roles and behavior during sleep and wake cycles.
- Adjusted platformio.ini files to reflect updated pin definitions and usage notes.
2026-01-13 18:54:26 -08:00
agessaman 58cdd60c48 Add owner configuration commands to MQTT_IMPLEMENTATION.md
- Introduced commands to get and set the owner public key and email address.
- Specified that these commands are available via the serial console only.
- Added example usage for owner configuration in the documentation.
2026-01-12 18:47:25 -08:00
agessaman ffa2a1ecdd Refactor advert timer calculation in MyMesh and SensorMesh for type consistency
- Updated the advert timer calculation to explicitly cast the advert interval to an integer type, ensuring consistent behavior across different mesh implementations.
- Enhanced the savePrefs function in CommonCLI to trigger advert timer updates when the advert interval changes, improving responsiveness to user configuration changes.
- Removed the aggressive 4-hour health check in MQTTBridge to prevent connection instability, allowing the MQTT client library to manage connection health internally.
2026-01-08 20:57:28 -08:00
agessaman 2bd61c1324 Add device metadata setup in MyMesh bridge initialization and restart
- Implemented device metadata configuration in the bridge's start and restart methods.
- Added device ID, firmware version, board model, and build date settings.
- Included MQTT bridge statistics sources setup conditionally based on the WITH_MQTT_BRIDGE flag.
2026-01-03 11:09:37 -08:00
agessaman d1093b4390 Refactor MQTTBridge configuration validation to support optional username and password
- Simplified validation logic in MQTTBridge to only reject default placeholder values for username and password.
- Removed unnecessary checks for empty username and password, allowing for anonymous mode support.
2026-01-03 09:34:43 -08:00
agessaman e754317ceb Refactor JWTHelper and MQTTBridge for improved efficiency and clarity
- Removed unnecessary debug logging in JWTHelper to streamline token creation process.
- Simplified JWT token creation logic in MQTTBridge, deferring token generation until WiFi is connected and NTP is synced.
- Introduced a flag for pending NTP sync in MQTTBridge to manage synchronization more effectively.
- Enhanced error handling and logging for token creation and connection management in MQTTBridge.
2026-01-02 13:36:41 -08:00
agessaman 98f176c730 Fix MQTT connection stability and CLI responsiveness issues
- Remove blocking delays in main loop (health check, WiFi reconnect)
- Make WiFi initialization fully async and non-blocking
- Optimize token renewal to only disconnect when token expires (60s buffer)
- Fix health check connection state management
- Add comprehensive stability review documentation
2026-01-02 13:36:41 -08:00
agessaman 2185523df6 Add sorting functions for neighbour information in MyMesh and optimize MQTTBridge for memory efficiency
- Introduced comparison functions for sorting neighbours by timestamp and signal strength in MyMesh.
- Implemented early exit conditions in MQTTBridge to improve processing efficiency when no neighbours are present.
- Enhanced MQTTBridge to optimize memory usage by adjusting MQTT client configurations and implementing memory pressure checks.
- Reduced processing limits in MQTTBridge to maintain responsiveness and prevent blocking during packet handling.
2026-01-02 13:36:41 -08:00
agessaman 915f8b8e52 Update MQTT_IMPLEMENTATION.md to include WiFi power save mode configuration details. Add commands for retrieving and setting power save modes (none, min, max) with descriptions for each option. 2026-01-02 13:36:41 -08:00
agessaman 8fa99611cb Refactor loadPrefs in CommonCLI to handle fresh installs and upgrades. Introduce flags for fresh installations and upgrades, ensuring correct default settings for MQTT bridge. Migrate preferences from old filename and save updated settings accordingly. 2026-01-02 13:36:41 -08:00
agessaman 617e3b17c0 Enhance loop processing in MyMesh and MQTTBridge to prioritize radio reception and improve responsiveness. Add comments for clarity on packet processing limits and WiFi status handling during MQTT operations. 2026-01-02 13:36:41 -08:00
agessaman 5d4f1e4c02 Refactor MQTTBridge connection logic to defer server connections until WiFi is connected and NTP is synced. Enhance error logging to include socket error numbers for better diagnostics. Add DNS resolution check before NTP sync to prevent failures. Improve time synchronization handling and memory management for timezone settings. 2026-01-02 13:36:41 -08:00
agessaman f7f1f83812 Enhance WiFi status handling in CommonCLI and MQTTBridge. Add command to retrieve WiFi connection status in CommonCLI and implement event-driven WiFi diagnostics in MQTTBridge for improved connection management and logging. Introduce periodic checks for WiFi status to facilitate faster reconnection attempts and better monitoring of disconnection events. 2026-01-02 13:36:41 -08:00
agessaman 34c8bea77f Add WiFi power save mode configuration to CommonCLI and MQTTBridge. Update preferences structure to include power save settings and implement command handling for adjusting power save modes (none, min, max). Enhance MQTTBridge to apply power save settings on WiFi connection and enable auto-reconnect functionality. 2026-01-02 13:36:41 -08:00
agessaman b82d7e43d1 Add WiFi TX power configuration option for MQTT. Update MQTTBridge to use build flag for TX power, defaulting to 11dBm. Document available power levels in MQTT_IMPLEMENTATION.md and update platformio.ini with example usage. 2026-01-02 13:36:41 -08:00
agessaman 0b7c088899 Implement default bridge settings for fresh installs in CommonCLI and optimize JSON document usage in MQTTMessageBuilder to avoid heap fragmentation. Update token renewal logic in MQTTBridge to handle time synchronization more effectively. 2026-01-02 13:36:41 -08:00
agessaman 3589043b2e Enhance MQTT debug macros to prevent hangs by checking Serial availability before printing. 2026-01-02 13:36:41 -08:00
agessaman 03d519f8d4 Remove redundant MQTT and WiFi settings write operations from CommonCLI savePrefs function 2026-01-02 13:36:41 -08:00
agessaman 4f548ffc63 Add source filter for additional directories in platformio.ini for Xiao S3 WIO variant 2026-01-02 13:36:41 -08:00
agessaman 8fbdc98ad2 Add adc_multiplier to NodePrefs structure 2026-01-02 13:36:41 -08:00
agessaman 5cadf3d96b Convert IATA codes to uppercase in CommonCLI and MQTTBridge for consistency 2026-01-02 13:36:41 -08:00
agessaman 3726c472cc Enable MQTT_DEBUG flag for multiple platformio.ini configurations 2026-01-02 13:36:41 -08:00
agessaman 6b0c0e931f Add IP address display for MQTT bridge devices in UITask 2026-01-02 13:36:41 -08:00
agessaman 3c7ac9d154 add support for T-Beam ESP32 devices, add error logging for a situation where bridge.source is set to tx but tx logging is off. 2026-01-02 13:36:41 -08:00
agessaman 158748d41f remove extra conflict marker 2026-01-02 13:36:41 -08:00
agessaman 44c2451513 clean up unnecessary comments 2026-01-02 13:36:41 -08:00
agessaman 304a32dba4 Update MQTT configurations to change bridge to observer mode across multiple variants
added support for lilygo_t3s3, tbeam_supreme
2026-01-02 13:36:41 -08:00
agessaman aa242e786d Refactor client version string generation in MQTTBridge 2026-01-02 13:36:41 -08:00
agessaman bafa542678 enable wifi power save and limit wifi power to reduce potential interference with LoRa radio; fixed situation where retry logic failed when no brokers were connected 2026-01-02 13:36:41 -08:00
agessaman 25d40f0219 Add IATA validation to prevent MQTT publishing without configured IATA code 2026-01-02 13:36:41 -08:00
agessaman 9e06fffc31 Restore status publish retry delay to prevent MQTT server spam 2026-01-02 13:36:41 -08:00
agessaman 3feb2cd57b Remove final conflict marker from CommonCLI.cpp 2026-01-02 13:36:41 -08:00
agessaman ad68a29f37 Remove remaining conflict markers from CommonCLI.cpp 2026-01-02 13:36:41 -08:00
agessaman cf3a9c3126 Remove conflict marker from CommonCLI.cpp 2026-01-02 13:36:41 -08:00
agessaman 453c4184c3 Add missing member variables for token expiration and reconnection tracking 2026-01-02 13:36:41 -08:00
agessaman b04a1a1dc6 Fix remaining conflict marker and add missing RECONNECT_THROTTLE_MS constant 2026-01-02 13:36:41 -08:00
agessaman 0de7da8425 Fix remaining conflict marker in maintainAnalyzerConnections 2026-01-02 13:36:41 -08:00
agessaman 921c6112cb Remove WiFi credentials from platformio.ini - use CLI or build flags instead 2026-01-02 13:36:41 -08:00
agessaman c5e2f18d88 Remove duplicate MQTT function definitions from rebase 2026-01-02 13:36:41 -08:00
agessaman 5a816be80c Refactor MQTT preferences handling in CommonCLI
- Introduced a new MQTTPrefs struct to store MQTT settings separately from NodePrefs, enhancing compatibility and reducing conflicts.
- Implemented functions to load, save, and synchronize MQTT preferences, ensuring backward compatibility with existing configurations.
- Updated file handling to read and write MQTT settings from a dedicated /mqtt_prefs file, maintaining file format compatibility.
- Added default values for MQTT preferences to ensure proper initialization when files are missing or corrupted.
2026-01-02 13:36:41 -08:00
agessaman 72ca50b9bf added explicit dependency on paulstoffregen/Time to resolve potential pio compile issues 2026-01-02 13:36:41 -08:00
agessaman fef9225b1a removed cayennelpp patching script and just updated to the newest ArduinoJson like we should have from the beginning 2026-01-02 13:36:41 -08:00
agessaman b89ceeeaf2 Fix timezone command handling in CommonCLI by adjusting string comparison lengths for accurate parsing. Updated offsets to ensure correct handling of timezone and timezone.offset commands. 2026-01-02 13:36:41 -08:00
agessaman 1ed18f9e3b Enhance CommonCLI and JWTHelper to support MQTT email functionality
- Added loading and saving of MQTT email preferences in CommonCLI.
- Updated command handling in CommonCLI to retrieve and set the MQTT email.
- Modified JWTHelper to include an optional email parameter in JWT token creation.
- Adjusted MQTTBridge to utilize the email from preferences when creating JWT tokens.
2026-01-02 13:36:41 -08:00
agessaman e5dbd56b5d Enhance CommonCLI and JWTHelper for MQTT owner public key support
- Added functionality to load, save, and handle the MQTT owner public key in CommonCLI.
- Implemented validation for the owner public key format and updated command handling to set the key.
- Modified JWTHelper to include optional owner and client fields in JWT token creation.
- Increased buffer sizes for JWT tokens in MQTTBridge to accommodate new fields.
2026-01-02 13:36:41 -08:00
agessaman e4ff06cbfd Enhance MQTTBridge and related components for improved status reporting and stats collection
- Added support for automatic stats collection in MQTTBridge, allowing for detailed status messages including battery voltage, uptime, error flags, and air time metrics.
- Updated MQTTMessageBuilder to accommodate additional stats in the status message, increasing buffer size for JSON documents.
- Modified CommonCLI to display MQTT status interval in minutes and adjusted command handling for setting the interval.
- Introduced new methods in MQTTBridge for setting stats sources
2026-01-02 13:36:41 -08:00
agessaman 7df28557b6 Enhance MQTTBridge logging and connection handling
- Introduced throttling for log messages related to disconnected brokers and analyzer clients to reduce log spam.
- Added new member variables to track the last log timestamps for broker connection issues and analyzer client states.
- Updated the packet processing logic to reset log timers when brokers are connected, ensuring accurate logging behavior.
- Improved connection validation before publishing to prevent race conditions and maintain accurate broker states.
2026-01-02 13:36:41 -08:00
agessaman e77beff04b Implement memory monitoring and queue size reporting in MQTTBridge and CommonCLI
- Added `getQueueSize` method to `MyMesh` and `CommonCLI` for better queue management.
- Introduced memory logging functionality in `MQTTBridge` to monitor heap usage and detect potential memory leaks.
- Adjusted maximum queue size in `MQTTBridge` from 50 to 10 for improved resource management.
- Enhanced command handling in `CommonCLI` to report memory status upon request.
2026-01-02 13:36:41 -08:00
agessaman eee02025b8 Enhance MQTTMessageBuilder and MQTTBridge for improved packet handling and memory management
- Implemented size-adaptive JSON document allocation in MQTTMessageBuilder to reduce memory fragmentation.
- Increased buffer sizes for raw hex conversions to accommodate larger packets.
- Updated MQTTBridge to store raw radio data with each packet, improving data integrity during transmission.
- Enhanced packet queue management by clearing structures to prevent stale data and ensuring safe memory handling.
- Added debug logging for packet processing to aid in troubleshooting.
2026-01-02 13:36:41 -08:00
agessaman 2b0475998a Implement memory monitoring and queue size reporting in MQTTBridge and CommonCLI
- Added `getQueueSize` method to `MyMesh` and `CommonCLI` for better queue management.
- Introduced memory logging functionality in `MQTTBridge` to monitor heap usage and detect potential memory leaks.
- Adjusted maximum queue size in `MQTTBridge` from 50 to 10 for improved resource management.
- Enhanced command handling in `CommonCLI` to report memory status upon request.
2026-01-02 13:36:41 -08:00
agessaman 1219668fb1 Refactor JWTHelper base64 URL encoding to modify output in-place and improve memory efficiency. Enhance MQTTBridge cleanup process to prevent memory leaks by properly deleting queued packets and timezone objects. 2026-01-02 13:36:41 -08:00
agessaman 3851a84bbf don't start mqtt connection attempts until wifi credentials are valid (requires reboot)
display IP address on screen when connected

added quickstart section to MQTT_IMPLEMENTATION.md
2026-01-02 13:36:41 -08:00
agessaman eab70c3cf6 added configuration for mqtt.sever, mqtt.username, mqtt.pasword, and mqtt.port
validated primary MQTT server credentials are set before opening connection
2026-01-02 13:36:41 -08:00
agessaman c23663da98 Update MQTT implementation to include dynamic build date and enhance client versioning 2026-01-02 13:36:41 -08:00
agessaman a645355670 Implement Let's Mesh Analyzer integration in MQTT Bridge
- Switch from PubSub to PsychicMqttClient for async operations and websockets support
- Add support for US and EU Let's Mesh Analyzer servers with JWT authentication.
- Introduce CLI commands to enable/disable analyzer servers.
- Update NodePrefs to store analyzer server settings.
- Modify MQTTBridge to publish status and packet data to analyzer servers via WebSocket MQTT.
- Enhance documentation to reflect new features and configuration options.
2026-01-02 13:36:41 -08:00
agessaman f6a77d2f2b added build target for Station_G2_repeater_bridge_mqtt and improved documentation. 2026-01-02 13:36:41 -08:00
agessaman 787af7b026 added timezone handling, updated mqtt packet output to use the proper timezones for timestamp and time/date, updated mqtt packet to use raw data instead of parsed packet structure, updated packet upload to use proper packet hash 2026-01-02 13:36:41 -08:00
agessaman 26c4b9704c Add timezone support to MQTT Bridge and CLI configuration
- Introduce timezone settings in NodePrefs for persistent storage
- Update CLI commands to get/set timezone and offset
- Modify MQTT message builder to utilize timezone for accurate timestamps
- Implement timezone handling in MQTTBridge for local time conversion
- Include timezone library dependency in platformio.ini
2026-01-02 13:36:41 -08:00
agessaman efc15eb643 Add MQTT Bridge implementation with WiFi CLI configuration
- Implement MQTT bridge for packet uplink to multiple brokers
- Add JSON message formatting for status, packets, and raw data
- Add WiFi SSID/password CLI configuration (get/set wifi.ssid, wifi.pwd)
- Add persistent storage for WiFi credentials
- Add NTP time synchronization for accurate MQTT timestamps
- Add CLI commands for MQTT configuration (origin, iata, status, packets, raw)
- Support multiple MQTT brokers with automatic reconnection
- Integrate with existing MeshCore bridge architecture
2026-01-02 13:36:41 -08:00
agessaman 0cd0c36ab9 initial commit to add MQTT observer support to Room Servers 2026-01-02 13:36:41 -08:00
agessaman bffbbb762b clean up unnecessary comments 2026-01-02 13:36:41 -08:00
agessaman 72811df606 Update MQTT configurations to change bridge to observer mode across multiple variants
added support for lilygo_t3s3, tbeam_supreme
2026-01-02 13:36:41 -08:00
agessaman a3875d8727 Refactor client version string generation in MQTTBridge 2026-01-02 13:36:41 -08:00
agessaman dd9edbde52 enable wifi power save and limit wifi power to reduce potential interference with LoRa radio; fixed situation where retry logic failed when no brokers were connected 2026-01-02 13:36:41 -08:00
agessaman a4aace61a1 Add IATA validation to prevent MQTT publishing without configured IATA code 2026-01-02 13:36:41 -08:00
agessaman 09bc9cbc78 Restore status publish retry delay to prevent MQTT server spam 2026-01-02 13:36:41 -08:00
agessaman 4d7282c365 Remove final conflict marker from CommonCLI.cpp 2026-01-02 13:36:41 -08:00
agessaman 771698106f Remove remaining conflict markers from CommonCLI.cpp 2026-01-02 13:36:41 -08:00
agessaman c0c56039c5 Remove conflict marker from CommonCLI.cpp 2026-01-02 13:36:41 -08:00
agessaman c36aac9ae0 Add missing member variables for token expiration and reconnection tracking 2026-01-02 13:36:41 -08:00
agessaman b15912fe9f Fix remaining conflict marker and add missing RECONNECT_THROTTLE_MS constant 2026-01-02 13:36:41 -08:00
agessaman 76a5caa08d Fix remaining conflict marker in maintainAnalyzerConnections 2026-01-02 13:36:41 -08:00
agessaman a0e14f4bde Remove WiFi credentials from platformio.ini - use CLI or build flags instead 2026-01-02 13:36:41 -08:00
agessaman 2876ea6ea4 Remove duplicate MQTT function definitions from rebase 2026-01-02 13:36:41 -08:00
agessaman ca55c9bfeb Refactor MQTT preferences handling in CommonCLI
- Introduced a new MQTTPrefs struct to store MQTT settings separately from NodePrefs, enhancing compatibility and reducing conflicts.
- Implemented functions to load, save, and synchronize MQTT preferences, ensuring backward compatibility with existing configurations.
- Updated file handling to read and write MQTT settings from a dedicated /mqtt_prefs file, maintaining file format compatibility.
- Added default values for MQTT preferences to ensure proper initialization when files are missing or corrupted.
2026-01-02 13:36:41 -08:00
agessaman 9781583467 added explicit dependency on paulstoffregen/Time to resolve potential pio compile issues 2026-01-02 13:36:41 -08:00
agessaman fbc499e709 removed cayennelpp patching script and just updated to the newest ArduinoJson like we should have from the beginning 2026-01-02 13:36:41 -08:00
agessaman 39850fa411 Fix timezone command handling in CommonCLI by adjusting string comparison lengths for accurate parsing. Updated offsets to ensure correct handling of timezone and timezone.offset commands. 2026-01-02 13:36:41 -08:00
agessaman a8474c7cd4 Enhance CommonCLI and JWTHelper to support MQTT email functionality
- Added loading and saving of MQTT email preferences in CommonCLI.
- Updated command handling in CommonCLI to retrieve and set the MQTT email.
- Modified JWTHelper to include an optional email parameter in JWT token creation.
- Adjusted MQTTBridge to utilize the email from preferences when creating JWT tokens.
2026-01-02 13:36:41 -08:00
agessaman 8f34d96628 Enhance CommonCLI and JWTHelper for MQTT owner public key support
- Added functionality to load, save, and handle the MQTT owner public key in CommonCLI.
- Implemented validation for the owner public key format and updated command handling to set the key.
- Modified JWTHelper to include optional owner and client fields in JWT token creation.
- Increased buffer sizes for JWT tokens in MQTTBridge to accommodate new fields.
2026-01-02 13:36:41 -08:00
agessaman 8ca969be78 Enhance MQTTBridge and related components for improved status reporting and stats collection
- Added support for automatic stats collection in MQTTBridge, allowing for detailed status messages including battery voltage, uptime, error flags, and air time metrics.
- Updated MQTTMessageBuilder to accommodate additional stats in the status message, increasing buffer size for JSON documents.
- Modified CommonCLI to display MQTT status interval in minutes and adjusted command handling for setting the interval.
- Introduced new methods in MQTTBridge for setting stats sources
2026-01-02 13:36:41 -08:00
agessaman 9352db1ed7 Enhance MQTTBridge logging and connection handling
- Introduced throttling for log messages related to disconnected brokers and analyzer clients to reduce log spam.
- Added new member variables to track the last log timestamps for broker connection issues and analyzer client states.
- Updated the packet processing logic to reset log timers when brokers are connected, ensuring accurate logging behavior.
- Improved connection validation before publishing to prevent race conditions and maintain accurate broker states.
2026-01-02 13:36:41 -08:00
agessaman 08fb3046f5 Implement memory monitoring and queue size reporting in MQTTBridge and CommonCLI
- Added `getQueueSize` method to `MyMesh` and `CommonCLI` for better queue management.
- Introduced memory logging functionality in `MQTTBridge` to monitor heap usage and detect potential memory leaks.
- Adjusted maximum queue size in `MQTTBridge` from 50 to 10 for improved resource management.
- Enhanced command handling in `CommonCLI` to report memory status upon request.
2026-01-02 13:36:41 -08:00