|
Safe Sprinkler
Master/slave irrigation system (ESP-NOW + LoRaWAN)
|
#include "esp_err.h"#include "esp_event.h"#include "esp_log.h"#include "esp_netif.h"#include "esp_now.h"#include "esp_wifi.h"#include "general/message_protocol.h"#include "lwip/ip_addr.h"#include "master/main_master.h"#include "nvs_flash.h"#include <freertos/FreeRTOS.h>#include <freertos/task.h>#include <string.h>

Go to the source code of this file.
Macros | |
| #define | MODULE_TAG "ACCESS POINT" |
| #define | MIN_WPA2_PW_LEN 8u |
Functions | |
| void | start_espnow_at_boot (void) |
| Start ESP-NOW at boot (STA or default wireless mode) | |
| int | switch_back_to_espnow_only (void) |
| Switch back from AP/APSTA to ESP-NOW-only mode. | |
| int | switch_to_ap_mode_keep_espnow (const char *ssid, const char *pw, uint8_t channel, const char *ip_str) |
| Switch to AP or APSTA mode while keeping ESP-NOW. | |
| #define MIN_WPA2_PW_LEN 8u |
| #define MODULE_TAG "ACCESS POINT" |
| void start_espnow_at_boot | ( | void | ) |
Start ESP-NOW at boot (STA or default wireless mode)
Initializes WiFi/NVS and configures ESP-NOW for slave discovery and messaging. Call once at master startup.
| int switch_back_to_espnow_only | ( | void | ) |
Switch back from AP/APSTA to ESP-NOW-only mode.
Disables AP and keeps ESP-NOW running.
| int switch_to_ap_mode_keep_espnow | ( | const char * | ssid, |
| const char * | pw, | ||
| uint8_t | channel, | ||
| const char * | ip_str | ||
| ) |
Switch to AP or APSTA mode while keeping ESP-NOW.
Enables an access point with the given SSID/password for config UI; ESP-NOW continues to work.
| ssid | AP SSID |
| pw | AP password (min MIN_WPA2_PW_LEN chars) |
| channel | WiFi channel (e.g. 1) |
| ip_str | Optional IP string for AP (can be NULL for default) |