mirror of
https://github.com/ok-home/ota_ws_update.git
synced 2025-11-13 22:03:27 +03:00
test html
This commit is contained in:
@@ -2,9 +2,19 @@
|
||||
|
||||
idf_component_register(
|
||||
SRCS
|
||||
example_ota_ws.c
|
||||
example_ota_ws.c
|
||||
../source/ota_ws_esp.c
|
||||
../source/ota_ws_http.c
|
||||
INCLUDE_DIRS
|
||||
"."
|
||||
#EMBED_FILES
|
||||
ota_ws.html
|
||||
../include
|
||||
PRIV_INCLUDE_DIRS
|
||||
../private_include
|
||||
REQUIRES
|
||||
prv_Wifi_Connect
|
||||
esp_http_server
|
||||
mdns
|
||||
app_update
|
||||
esp_wifi
|
||||
EMBED_FILES
|
||||
../source/ota_ws.html
|
||||
)
|
||||
@@ -14,44 +14,45 @@
|
||||
#include "esp_ota_ops.h"
|
||||
#include "esp_wifi.h"
|
||||
|
||||
//#include <esp_log.h>
|
||||
// #include <esp_log.h>
|
||||
|
||||
#include "prv_wifi_connect.h"
|
||||
#include "ota_ws.h"
|
||||
|
||||
static const char *TAG = "ota_ws";
|
||||
|
||||
#define MDNS
|
||||
#ifdef MDNS
|
||||
#define HOST_NAME "esp-ota"
|
||||
#include "mdns.h"
|
||||
#include "lwip/apps/netbiosns.h"
|
||||
#endif //MDNS
|
||||
#endif // MDNS
|
||||
#ifdef MDNS
|
||||
static void initialise_mdns(void)
|
||||
{
|
||||
mdns_init();
|
||||
mdns_hostname_set("esp");
|
||||
mdns_hostname_set(HOST_NAME);
|
||||
mdns_instance_name_set("esp home web server");
|
||||
|
||||
mdns_txt_item_t serviceTxtData[] = {
|
||||
{"board", "esp32"},
|
||||
{"path", "/"}
|
||||
};
|
||||
{"path", "/"}};
|
||||
|
||||
ESP_ERROR_CHECK(mdns_service_add("ESP32-WebServer", "_http", "_tcp", 80, serviceTxtData,
|
||||
sizeof(serviceTxtData) / sizeof(serviceTxtData[0])));
|
||||
netbiosns_init();
|
||||
netbiosns_set_name(HOST_NAME);
|
||||
}
|
||||
#endif // MDNS
|
||||
|
||||
|
||||
void app_main(void)
|
||||
{
|
||||
prv_wifi_connect(); // return with error ?
|
||||
prv_wifi_connect(); // return with error ?
|
||||
|
||||
#ifdef MDNS
|
||||
initialise_mdns();
|
||||
netbiosns_init();
|
||||
netbiosns_set_name("esp");
|
||||
#endif // MDNS
|
||||
|
||||
prv_start_http_server(PRV_MODE_STAY_ACTIVE,NULL); // run server
|
||||
//example_echo_ws_server();
|
||||
prv_start_http_server(PRV_MODE_STAY_ACTIVE, ota_ws_register_uri_handler); // run server
|
||||
// example_echo_ws_server();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user