festival_finder/20250815_basic_finder.ino/wifi_save.h

47 lines
906 B
C
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*
Author : Vincent
Create : 2021/2/5
if ESP32开机检测SSID == NULL
ESP32通过AP模式访问192.168.4.1进行修改获得SSID和PASSWORD
通过NVS存储到FLASH中
重启
else
根据FLASH的SSID和PASSWORD连接wifi
while 重启五秒内 && 重置按键被按下
将NVS设置为NULL
重启
用户程序()
*/
#include <Arduino.h>
#include <stdio.h>
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "esp_system.h"
#include "nvs_flash.h"
#include "nvs.h"
#include "config_secrets.h"
#include <WiFi.h>
#include <WiFiClient.h>
#include <WiFiAP.h>
#include <config_secrets.h>
#define SSID_LENGTH 40
int record_rst_time();
void nvs_test();
void record_wifi(char *ssid, char *password);
void check_wifi(char *ssid, char *password);
void ap_init();
int wifi_config_server();
void set_wifi_from_url(String get_url);
int wifi_set_main();