diff --git a/CmakeLists.txt b/CmakeLists.txt index aae6fa9..aca00e5 100644 --- a/CmakeLists.txt +++ b/CmakeLists.txt @@ -78,8 +78,6 @@ target_link_libraries(${TARGET_NAME} hardware_adc pico_cyw43_arch_lwip_threadsafe_background pico_lwip_mqtt - pico_mbedtls - pico_lwip_mbedtls ) target_include_directories(${TARGET_NAME} PRIVATE @@ -96,10 +94,3 @@ target_compile_definitions(${TARGET_NAME} PRIVATE ) pico_add_extra_outputs(${TARGET_NAME}) - -# Ignore warnings from lwip code -set_source_files_properties( - ${PICO_LWIP_PATH}/src/apps/altcp_tls/altcp_tls_mbedtls.c - PROPERTIES - COMPILE_OPTIONS "-Wno-unused-result" - ) diff --git a/mqtt_client.c b/mqtt_client.c index 2d9e98c..50a5781 100644 --- a/mqtt_client.c +++ b/mqtt_client.c @@ -1,22 +1,13 @@ /** - * Copyright (c) 2022 Raspberry Pi (Trading) Ltd. - * - * SPDX-License-Identifier: BSD-3-Clause + * MQTT Client to publish sensor data to homeassistant + * MQTT client doc: https://www.nongnu.org/lwip/2_1_x/group__mqtt.html#gafdfa0e65b217e92835d35858924565cf + * PICO W MQTT example: https://github.com/raspberrypi/pico-examples/blob/master/pico_w/wifi/mqtt/README */ -// -// Created by elliot on 25/05/24. -// #include "pico/stdlib.h" #include "pico/cyw43_arch.h" -#include "pico/unique_id.h" -#include "hardware/gpio.h" -#include "hardware/irq.h" #include "hardware/adc.h" #include "lwip/apps/mqtt.h" -#include "lwip/apps/mqtt_priv.h" // needed to set hostname -#include "lwip/dns.h" -#include "lwip/altcp_tls.h" // Temperature #ifndef TEMPERATURE_UNITS