From c0a1c4f79ecabcabf9b18d77048802f353bdefef Mon Sep 17 00:00:00 2001 From: Eleon Date: Sun, 12 Sep 2021 21:42:55 +0200 Subject: [PATCH] mqtt verbindet --- firmware/Makefile | 3 ++- firmware/fiatlux.c | 3 +++ firmware/mqtt.cpp | 4 ++-- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/firmware/Makefile b/firmware/Makefile index e0a7ccb..2171e44 100644 --- a/firmware/Makefile +++ b/firmware/Makefile @@ -2,7 +2,8 @@ PROGRAM=fiatlux EXTRA_CFLAGS=-O3 -Ibuild/gen -EXTRA_COMPONENTS=extras/i2s_dma extras/ws2812_i2s extras/dhcpserver extras/rboot-ota extras/mbedtls extras/httpd extras/sntp extras/cpp_support + +EXTRA_COMPONENTS=extras/i2s_dma extras/ws2812_i2s extras/dhcpserver extras/rboot-ota extras/mbedtls extras/httpd extras/sntp extras/cpp_support extras/paho_mqtt_c LIBS = hal m diff --git a/firmware/fiatlux.c b/firmware/fiatlux.c index 9e3efeb..04e0ab1 100644 --- a/firmware/fiatlux.c +++ b/firmware/fiatlux.c @@ -13,6 +13,7 @@ void user_init(void) { + uart_set_baud(0, 115200); printf("SDK version: %s\n", sdk_system_get_sdk_version()); @@ -22,6 +23,8 @@ void user_init(void) wifi_available_semaphore = xSemaphoreCreateBinary(); + xTaskCreate(mqtt_task, "mqtt_task", 1024, NULL, 1, NULL); + xTaskCreate(wifi_task, "wifi_task", 1024, NULL, 1, NULL); xTaskCreate(&httpd_task, "httpd_task", 1024, NULL, 2, NULL); diff --git a/firmware/mqtt.cpp b/firmware/mqtt.cpp index 5cbeaac..3dedc99 100644 --- a/firmware/mqtt.cpp +++ b/firmware/mqtt.cpp @@ -22,7 +22,7 @@ extern "C" { /* You can use http://test.mosquitto.org/ to test mqtt_client instead * of setting up your own MQTT server */ -#define MQTT_HOST ("172.16.1.53") +#define MQTT_HOST ("172.16.0.42") #define MQTT_PORT 1883 #define MQTT_USER NULL @@ -157,4 +157,4 @@ extern "C" void mqtt_task(void *pvParameters) { mqtt_network_disconnect(&network); taskYIELD(); } -} \ No newline at end of file +}