mirror of
https://github.com/HendrikRauh/dmx-interface.git
synced 2026-04-09 03:11:29 +00:00
Merge branch 'idf' into idf-dmx
This commit is contained in:
commit
573757ffe0
18 changed files with 443 additions and 103 deletions
|
|
@ -1,3 +1,9 @@
|
|||
idf_component_register(SRCS "dmx-interface.c"
|
||||
INCLUDE_DIRS "."
|
||||
REQUIRES web_server dmx)
|
||||
idf_component_register(
|
||||
SRCS
|
||||
"dmx-interface.c"
|
||||
INCLUDE_DIRS
|
||||
"."
|
||||
REQUIRES
|
||||
dmx
|
||||
logger
|
||||
web_server)
|
||||
|
|
|
|||
|
|
@ -1,33 +1,39 @@
|
|||
#define LOG_TAG "MAIN" ///< "MAIN" log tag for this file
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#include "dmx.h"
|
||||
#include "esp_err.h"
|
||||
#include "esp_log.h"
|
||||
#include "freertos/FreeRTOS.h"
|
||||
#include "freertos/task.h"
|
||||
#include "logger.h"
|
||||
#include "web_server.h"
|
||||
#include "wifi.h"
|
||||
|
||||
static const char *TAG = "MAIN";
|
||||
|
||||
/**
|
||||
* @brief Main entry point for the DMX Interface application.
|
||||
*
|
||||
* Initializes WiFi Access Point and starts the web server.
|
||||
* Keeps the application running indefinitely.
|
||||
*/
|
||||
void app_main(void) {
|
||||
ESP_LOGI(TAG, "DMX Interface starting...");
|
||||
LOGI("DMX Interface starting...");
|
||||
|
||||
esp_err_t wifi_err = wifi_start_ap("DMX", "mbgmbgmbg", 1, 4);
|
||||
if (wifi_err != ESP_OK) {
|
||||
ESP_LOGE(TAG, "Failed to start WiFi AP: %s", esp_err_to_name(wifi_err));
|
||||
LOGE("Failed to start WiFi AP: %s", esp_err_to_name(wifi_err));
|
||||
return;
|
||||
}
|
||||
|
||||
// Start HTTP web server
|
||||
httpd_handle_t server = webserver_start(NULL);
|
||||
if (server == NULL) {
|
||||
ESP_LOGE(TAG, "Failed to start web server!");
|
||||
LOGE("Failed to start web server!");
|
||||
return;
|
||||
}
|
||||
|
||||
ESP_LOGI(TAG, "Web server started successfully");
|
||||
ESP_LOGI(TAG, "Open http://192.168.4.1 in your browser");
|
||||
LOGI("Web server started successfully");
|
||||
LOGI("Open http://192.168.4.1 in your browser");
|
||||
|
||||
init_dmx(DMX_NUM_1, 21, 33);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue