diff --git a/main/osc_control.c b/main/osc_control.c --- a/main/osc_control.c +++ b/main/osc_control.c @@ -148,6 +148,7 @@ static void osc_send() vTaskDelay(pdMS_TO_TICKS(2000)); uint32_t last_tx = 0; + uint32_t last_discover = 0; for (;;) { @@ -165,12 +166,18 @@ static void osc_send() esp_osc_send(&client, &target, "/squeeze_value", "f", squeeze_value()); } + if(xTaskGetTickCount()*portTICK_PERIOD_MS - last_discover > 1000) + { + last_discover = xTaskGetTickCount() * portTICK_PERIOD_MS; + esp_osc_send(&client, &target, "/discover", "s", "ledstrip"); + } + vTaskDelay(pdMS_TO_TICKS(10)); } } void osc_init() { - esp_osc_init(&client, 1024, 5005); + esp_osc_init(&client, 1024, 5000); xTaskCreatePinnedToCore(osc_process, "osc_process", 1024*8, NULL, 10, NULL, 1); xTaskCreatePinnedToCore(osc_send, "osc_send", 1024*4, NULL, 10, NULL, 1);