Add MQTT telemetry with Core 0 execution to avoid mining disruption#29
Add MQTT telemetry with Core 0 execution to avoid mining disruption#29
Conversation
Co-authored-by: v-Kaefer <128633407+v-Kaefer@users.noreply.github.com>
Co-authored-by: v-Kaefer <128633407+v-Kaefer@users.noreply.github.com>
Test Coverage AnalysisChanged Files:main/main.c Functions Found in Changed Files:main/main.c61:void wifi_init(void) main/mqtt_handler.c15:static void mqtt_event_handler(void *handler_args, esp_event_base_t base, int32_t event_id, void *event_data) main/mqtt_handler.h29:esp_err_t mqtt_handler_init(void); Test Coverage Status:Recommendation: Create a test directory and add unit tests for:
|
1 similar comment
Test Coverage AnalysisChanged Files:main/main.c Functions Found in Changed Files:main/main.c61:void wifi_init(void) main/mqtt_handler.c15:static void mqtt_event_handler(void *handler_args, esp_event_base_t base, int32_t event_id, void *event_data) main/mqtt_handler.h29:esp_err_t mqtt_handler_init(void); Test Coverage Status:Recommendation: Create a test directory and add unit tests for:
|
Implements MQTT client for real-time mining telemetry as requested in #[issue_number]. MQTT operations run on Core 0 (secondary processor) while SHA256 mining remains on Core 1.
Changes
New modules:
mqtt_handler.{c,h}- MQTT client wrapper with non-blocking publish APIConfiguration:
config.h.examplewithENABLE_MQTTflagmqtt://broker.emqx.io:1883btc_miner/{hashrate,total_hashes,best_difficulty,status}Integration:
mqtt_handler_init()called fromwifi_init()after network setupmqtt_publish_mining_stats()called every 2s from mining task update loop#if defined(WIFI_SSID) && ENABLE_MQTTfor CI/CD compatibilityDocumentation:
Example Usage
Subscribe to
btc_miner/#in MQTTX to see real-time mining stats.Technical Notes
PRIu64/PRIu32macros for portable integer formattingOriginal prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.