From e7a95326d392646a781a39634e3349211f033a88 Mon Sep 17 00:00:00 2001 From: Rutger Huijgen Date: Sat, 18 Apr 2020 20:02:27 +0200 Subject: [PATCH 1/3] Added the ESP-wifi-config submodule to the ESP-RTOS and also add a example --- .gitmodules | 3 +++ examples/wifi-config-v2/Makefile | 18 ++++++++++++++++++ examples/wifi-config-v2/main.c | 19 +++++++++++++++++++ extras/wifi-config-v2 | 1 + 4 files changed, 41 insertions(+) create mode 100644 examples/wifi-config-v2/Makefile create mode 100644 examples/wifi-config-v2/main.c create mode 160000 extras/wifi-config-v2 diff --git a/.gitmodules b/.gitmodules index 5647056..0e153bd 100644 --- a/.gitmodules +++ b/.gitmodules @@ -46,3 +46,6 @@ [submodule "lvgl/lv_examples"] path = lvgl/lv_examples url = https://github.com/littlevgl/lv_examples.git +[submodule "extras/wifi-config-v2"] + path = extras/wifi-config-v2 + url = https://github.com/maximkulkin/esp-wifi-config.git diff --git a/examples/wifi-config-v2/Makefile b/examples/wifi-config-v2/Makefile new file mode 100644 index 0000000..7d82827 --- /dev/null +++ b/examples/wifi-config-v2/Makefile @@ -0,0 +1,18 @@ +# Makefile for wificfg example +PROGRAM=wifi-config-v2 +EXTRA_COMPONENTS=extras/wifi-config-v2 extras/http-parser extras/dhcpserver + +# For the mDNS responder included under extras: +#EXTRA_COMPONENTS += extras/mdnsresponder +#EXTRA_CFLAGS += -DEXTRAS_MDNS_RESPONDER + +# For the mDNS responder included with lwip: +EXTRA_CFLAGS += -DLWIP_MDNS_RESPONDER=1 -DLWIP_NUM_NETIF_CLIENT_DATA=1 -DLWIP_NETIF_EXT_STATUS_CALLBACK=1 + +# Avoid writing the wifi state to flash when using wificfg. +EXTRA_CFLAGS += -DWIFI_PARAM_SAVE=0 + +# enable debugging for the wifi config tasks +EXTRA_CFLAGS += -DWIFI_CONFIG_DEBUG + +include ../../common.mk diff --git a/examples/wifi-config-v2/main.c b/examples/wifi-config-v2/main.c new file mode 100644 index 0000000..17392f9 --- /dev/null +++ b/examples/wifi-config-v2/main.c @@ -0,0 +1,19 @@ +#include +#include + +#include "wifi_config.h" + + +void on_wifi_event(wifi_config_event_t event) { + if (event == WIFI_CONFIG_CONNECTED) { + printf("Connected to WiFi\n"); + } else if (event == WIFI_CONFIG_DISCONNECTED) { + printf("Disconnected from WiFi\n"); + } +} + +void user_init(void) { + uart_set_baud(0, 115200); + + wifi_config_init2("my-accessory", NULL, on_wifi_event); +} \ No newline at end of file diff --git a/extras/wifi-config-v2 b/extras/wifi-config-v2 new file mode 160000 index 0000000..0b385c6 --- /dev/null +++ b/extras/wifi-config-v2 @@ -0,0 +1 @@ +Subproject commit 0b385c69a001db475e8152080f33c8afa0395784 From 3e2b2830e5abddca2412b1e52ab58310b481aed5 Mon Sep 17 00:00:00 2001 From: Rutger Huijgen Date: Mon, 20 Apr 2020 16:54:18 +0200 Subject: [PATCH 2/3] Fixed issue in sntp, same as master --- extras/sntp/sntp_fun.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/extras/sntp/sntp_fun.c b/extras/sntp/sntp_fun.c index b4210ec..d677c07 100644 --- a/extras/sntp/sntp_fun.c +++ b/extras/sntp/sntp_fun.c @@ -68,7 +68,7 @@ void sntp_initialize(const struct timezone *tz) { cal = 1; tim_ref = TIMER_COUNT; sntp_sem = xSemaphoreCreateMutex(); - assert(sntp_sem == NULL); + assert(sntp_sem != NULL); sntp_init(); } @@ -97,7 +97,7 @@ int _gettimeofday_r(struct _reent *r, struct timeval *tp, void *tzp) { if (tzp || !tp) return EINVAL; if (sntp_base == 0) { - printf("Time not valid yet"); + printf("Time not valid yet\n"); return EINVAL; } From e497936422d5f1e9c039dcdf9c4e7322824f84b7 Mon Sep 17 00:00:00 2001 From: Rutger Huijgen Date: Thu, 23 Apr 2020 20:24:25 +0200 Subject: [PATCH 3/3] For now point the wifi-config-v2 to my fork --- .gitmodules | 2 +- extras/wifi-config-v2 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitmodules b/.gitmodules index 0e153bd..2917de2 100644 --- a/.gitmodules +++ b/.gitmodules @@ -48,4 +48,4 @@ url = https://github.com/littlevgl/lv_examples.git [submodule "extras/wifi-config-v2"] path = extras/wifi-config-v2 - url = https://github.com/maximkulkin/esp-wifi-config.git + url = https://github.com/Rutger798/esp-wifi-config.git diff --git a/extras/wifi-config-v2 b/extras/wifi-config-v2 index 0b385c6..287b8a0 160000 --- a/extras/wifi-config-v2 +++ b/extras/wifi-config-v2 @@ -1 +1 @@ -Subproject commit 0b385c69a001db475e8152080f33c8afa0395784 +Subproject commit 287b8a0c717412a970c14c2603058bc041b11928