Safe Sprinkler
Master/slave irrigation system (ESP-NOW + LoRaWAN)
Loading...
Searching...
No Matches
Macros | Functions
wifi.h File Reference
#include "esp_err.h"
Include dependency graph for wifi.h:

Go to the source code of this file.

Macros

#define STATIC_IP_ADDR   "10.10.10.10"
 
#define DEFAULT_CHAN   1
 
#define MIN_WPA2_PW_LEN   8
 
#define DEFAULT_SSID   "NODE AP"
 
#define DEFAULT_PW   ""
 

Functions

int wifi_init_sta (void)
 Initialize WiFi in STA (station) mode.
 
int wifi_switch_apsta (void)
 Switch from STA to APSTA (station + access point)
 
int wifi_switch_sta (void)
 Switch from APSTA back to STA only.
 

Macro Definition Documentation

◆ DEFAULT_CHAN

#define DEFAULT_CHAN   1

◆ DEFAULT_PW

#define DEFAULT_PW   ""

◆ DEFAULT_SSID

#define DEFAULT_SSID   "NODE AP"

◆ MIN_WPA2_PW_LEN

#define MIN_WPA2_PW_LEN   8

◆ STATIC_IP_ADDR

#define STATIC_IP_ADDR   "10.10.10.10"

Function Documentation

◆ wifi_init_sta()

int wifi_init_sta ( void  )

Initialize WiFi in STA (station) mode.

Call once at slave startup before using ESP-NOW or AP.

Returns
ESP_OK on success, error code otherwise

◆ wifi_switch_apsta()

int wifi_switch_apsta ( void  )

Switch from STA to APSTA (station + access point)

Enables the node’s AP for configuration while keeping STA/ESP-NOW.

Returns
ESP_OK on success, error code otherwise

◆ wifi_switch_sta()

int wifi_switch_sta ( void  )

Switch from APSTA back to STA only.

Disables the access point; STA/ESP-NOW continue.

Returns
ESP_OK on success, error code otherwise