diff --git a/components/truma_inetbox/LinBusListener.cpp b/components/truma_inetbox/LinBusListener.cpp index ff7795c..d1ce5f4 100644 --- a/components/truma_inetbox/LinBusListener.cpp +++ b/components/truma_inetbox/LinBusListener.cpp @@ -63,7 +63,6 @@ void LinBusListener::setup() { this->setup_framework(); #ifdef USE_ESP32 - this->stream_try_init_(); if (this->stream_queue_ == nullptr) { this->stream_queue_ = xQueueCreateStatic( STREAM_QUEUE_LEN, STREAM_QUEUE_ITEM_MAX, @@ -76,7 +75,7 @@ void LinBusListener::setup() { this, 1, &this->streamTaskHandle_, - 0); + 1); // pin to core 1 to avoid impacting WiFi on core 0 } #endif @@ -96,6 +95,9 @@ void LinBusListener::setup() { void LinBusListener::update() { this->check_for_lin_fault_(); #ifdef USE_ESP32 + if (this->stream_enabled_ && this->udp_sock_ < 0) { + this->stream_try_init_(); + } this->stream_maybe_keepalive_(); #endif } @@ -423,7 +425,7 @@ void LinBusListener::process_log_queue(TickType_t xTicksToWait) { log_msg.message_source_know ? (log_msg.message_from_master ? " - MASTER" : " - SLAVE") : "", log_msg.current_data_valid ? "" : "INVALID"); } else { - ESP_LOGV(TAG, "PID %02X %s %s %S", current_PID_, format_hex_pretty(log_msg.data, log_msg.len).c_str(), + ESP_LOGV(TAG, "PID %02X %s %s %s", current_PID_, format_hex_pretty(log_msg.data, log_msg.len).c_str(), log_msg.message_source_know ? (log_msg.message_from_master ? " - MASTER" : " - SLAVE") : "", log_msg.current_data_valid ? "" : "INVALID"); }