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.
This commit is contained in:
1 parent
56f98997e6
commit
ed27ebd015
5 files changed
+703
-145
No files matched your search
@@ -898,7 +898,7 @@ void MyMesh::loop() {
|
||||
// MQTT processing can take time, so we prioritize radio reception
|
||||
mesh::Mesh::loop();
|
||||
#ifdef WITH_MQTT_BRIDGE
|
||||
bridge.loop();
|
||||
// bridge.loop() is now handled by FreeRTOS task on Core 0 - no need to call it here
|
||||
#endif
|
||||
|
||||
if (millisHasNowPassed(next_push) && acl.getNumClients() > 0) {
|
||||
|
||||
Reference in new issue
Block a user