Improv wifi (#85)
* - add wifi credential reset
o press reset button (nRESET pin) 3 times
but wait about 1s between button presses
the button press counter is reset 5s after boot
* add wifi provisioning service through improv wifi (fix #75)
Signed-off-by: Karl Osterseher <karli_o@gmx.at>
This commit is contained in:
committed by
GitHub
Unverified
parent
b8cdafc22d
commit
a619587c03
@@ -1,5 +1,5 @@
|
||||
idf_component_register(SRCS "main.c"
|
||||
INCLUDE_DIRS "."
|
||||
PRIV_REQUIRES esp_timer esp_wifi eth_interface nvs_flash wifi_interface audio_board audio_hal audio_sal net_functions opus flac ota_server
|
||||
ui_http_server
|
||||
PRIV_REQUIRES esp_timer esp_wifi nvs_flash wifi_interface audio_board audio_hal audio_sal net_functions opus flac ota_server
|
||||
ui_http_server improv_wifi
|
||||
)
|
||||
|
||||
41
main/main.c
41
main/main.c
@@ -26,6 +26,8 @@
|
||||
#include "wifi_interface.h"
|
||||
|
||||
// Minimum ESP-IDF stuff only hardware abstraction stuff
|
||||
#include <wifi_provisioning.h>
|
||||
|
||||
#include "board.h"
|
||||
#include "es8388.h"
|
||||
#include "esp_netif.h"
|
||||
@@ -81,7 +83,7 @@ static QueueHandle_t decoderTaskQHdl = NULL;
|
||||
SemaphoreHandle_t decoderReadSemaphore = NULL;
|
||||
SemaphoreHandle_t decoderWriteSemaphore = NULL;
|
||||
|
||||
const char *VERSION_STRING = "0.0.2";
|
||||
const char *VERSION_STRING = "0.0.3";
|
||||
|
||||
#define HTTP_TASK_PRIORITY (configMAX_PRIORITIES - 2) // 9
|
||||
#define HTTP_TASK_CORE_ID 1 // 1 // tskNO_AFFINITY
|
||||
@@ -2747,14 +2749,15 @@ void app_main(void) {
|
||||
ESP_ERROR_CHECK(ret);
|
||||
|
||||
esp_log_level_set("*", ESP_LOG_INFO);
|
||||
// esp_log_level_set("c_I2S", ESP_LOG_NONE);
|
||||
|
||||
// if enabled these cause a timer srv stack overflow
|
||||
esp_log_level_set("HEADPHONE", ESP_LOG_NONE);
|
||||
esp_log_level_set("gpio", ESP_LOG_NONE);
|
||||
// esp_log_level_set("i2s_std", ESP_LOG_DEBUG);
|
||||
// esp_log_level_set("i2s_common", ESP_LOG_DEBUG);
|
||||
|
||||
esp_log_level_set("gpio", ESP_LOG_WARN);
|
||||
esp_log_level_set("uart", ESP_LOG_WARN);
|
||||
// esp_log_level_set("i2s_std", ESP_LOG_DEBUG);
|
||||
// esp_log_level_set("i2s_common", ESP_LOG_DEBUG);
|
||||
esp_log_level_set("wifi", ESP_LOG_WARN);
|
||||
esp_log_level_set("wifi_init", ESP_LOG_WARN);
|
||||
esp_log_level_set("wifi", ESP_LOG_WARN);
|
||||
esp_log_level_set("wifi_init", ESP_LOG_WARN);
|
||||
|
||||
@@ -2859,6 +2862,32 @@ void app_main(void) {
|
||||
|
||||
ESP_LOGI(TAG, "init player");
|
||||
init_player();
|
||||
|
||||
// ensure there is no noise from DAC
|
||||
{
|
||||
board_i2s_pin_t pin_config0;
|
||||
get_i2s_pins(I2S_NUM_0, &pin_config0);
|
||||
|
||||
gpio_config_t gpioCfg = {
|
||||
.pin_bit_mask =
|
||||
BIT64(pin_config0.mck_io_num) | BIT64(pin_config0.data_out_num) |
|
||||
BIT64(pin_config0.bck_io_num) | BIT64(pin_config0.ws_io_num),
|
||||
.mode = GPIO_MODE_OUTPUT,
|
||||
.pull_up_en = GPIO_PULLUP_DISABLE,
|
||||
.pull_down_en = GPIO_PULLDOWN_DISABLE,
|
||||
.intr_type = GPIO_INTR_DISABLE,
|
||||
};
|
||||
gpio_config(&gpioCfg);
|
||||
gpio_set_level(pin_config0.mck_io_num, 0);
|
||||
gpio_set_level(pin_config0.data_out_num, 0);
|
||||
gpio_set_level(pin_config0.bck_io_num, 0);
|
||||
gpio_set_level(pin_config0.ws_io_num, 0);
|
||||
|
||||
gpioCfg.pin_bit_mask = BIT64(pin_config0.data_in_num);
|
||||
gpioCfg.mode = GPIO_MODE_INPUT;
|
||||
gpioCfg.pull_up_en = GPIO_PULLUP_ENABLE;
|
||||
gpio_config(&gpioCfg);
|
||||
}
|
||||
|
||||
// ensure there is no noise from DAC
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user