WIFI

WiFi ( -- )

Select WiFi vocabulary:

WIFI_MODE_APSTA
WIFI_MODE_AP
WIFI_MODE_STA
WIFI_MODE_NULL
 
WiFi.begin
WiFi.config
WiFi.disconnect
WiFi.getTxPower
WiFi.localIP
WiFi.macAddress
WiFi.mode
WiFi.setTxPower
WiFi.status

The esp32 WiFi programming model can be depicted as following picture:

                            default handler              user handler
  -------------             ---------------             ---------------
  |           |   event     |             | callback or |             |
  |   tcpip   | --------->  |    event    | ----------> | application |
  |   stack   |             |     task    |  event      |    task     |
  |-----------|             |-------------|             |-------------|
                                  /|\                          |
                                   |                           |
                            event  |                           |
                                   |                           |
                                   |                           |
                             ---------------                   |
                             |             |                   |
                             | WiFi Driver |/__________________|
                             |             |\     API call
                             |             |
                             |-------------|

Wifi.begin ( ssid-z password-z -- )

Initializes the WiFi library's network settings and provides the current status.

z" mySSID"
z" myPASSWORD"  Wifi.begin

WiFi.config ( ip dns gateway subnet -- )

WiFi.config allows you to configure a static IP address as well as change the DNS, gateway, and subnet addresses on the WiFi shield.

Unlike WiFi.begin which automatically configures the WiFi shield to use DHCP, WiFi.config allows you to manually set the network address of the shield.

Calling WiFi.config before WiFi.begin forces to configure the WiFi with the network addresses specified in WiFi.config.

Parameters:

Wifi.disconnect ( -- )

Disconnects the WiFi shield from the current network.

WiFi.getTxPower ( -- powerx4 )

Get power x4

WiFi.localIP ( -- ip )

Get local IP

WiFi.macAddress ( a -- )

Gets the MAC Address of your ESP32 WiFi port.

create mac 6 allot
mac WiFi WiFi.macAddress

WiFi.status ( -- n )

Return the connection status:

Example:

WiFi.status .  \ display status

WiFi.mode ( mode -- )

Constants:

WiFi.setTxPower ( powerx4 -- )

Set power x4