View Source VintageNetWiFi.Cookbook (vintage_net_wifi v0.12.5)

Recipes for common WiFi network configurations

For example, if you want the standard configuration for the most common type of WiFi network (WPA2 Preshared Key networks), pass the SSID and password to wpa_psk/2

Summary

Functions

Return a generic configuration for connecting to preshared-key networks

Return a configuration for creating an open access point

Return a configuration for connecting to open WiFi network

Return a configuration for connecting to a WPA3 network

Return a configuration for connecting to a WPA-EAP PEAP network

Return a configuration for connecting to a WPA-PSK network

Functions

Link to this function

generic(ssid, passphrase)

View Source

Return a generic configuration for connecting to preshared-key networks

The returned configuration should be able to connect to an access point configured to use WPA3-only, WPA2/3 transitional or WPA2. The WiFi module must also support WPA3 for this to work.

Pass an SSID and passphrase. If the SSID and passphrase are ok, you'll get an :ok tuple with the configuration. If there's a problem, you'll get an error tuple with a reason.

Link to this function

open_access_point(ssid, ipv4_subnet \\ "192.168.24.0")

View Source
@spec open_access_point(String.t(), VintageNet.any_ip_address()) ::
  {:ok, map()} | {:error, term()}

Return a configuration for creating an open access point

Pass an SSID and an optional IPv4 class C network.

@spec open_wifi(String.t()) ::
  {:ok, map()} | {:error, VintageNetWiFi.WPA2.invalid_ssid_error()}

Return a configuration for connecting to open WiFi network

Pass an SSID and passphrase. If the SSID and passphrase are ok, you'll get an :ok tuple with the configuration. If there's a problem, you'll get an error tuple with a reason.

Link to this function

wpa3_sae(ssid, passphrase)

View Source

Return a configuration for connecting to a WPA3 network

Pass an SSID and passphrase. If the SSID and passphrase are ok, you'll get an :ok tuple with the configuration. If there's a problem, you'll get an error tuple with a reason.

Link to this function

wpa_eap_peap(ssid, username, passphrase)

View Source
@spec wpa_eap_peap(String.t(), String.t(), String.t()) ::
  {:ok, map()} | {:error, VintageNetWiFi.WPA2.invalid_ssid_error()}

Return a configuration for connecting to a WPA-EAP PEAP network

Pass an SSID and login credentials. If valid, you'll get an :ok tuple with the configuration. If there's a problem, you'll get an error tuple with a reason.

Link to this function

wpa_psk(ssid, passphrase)

View Source

Return a configuration for connecting to a WPA-PSK network

Pass an SSID and passphrase. If the SSID and passphrase are ok, you'll get an :ok tuple with the configuration. If there's a problem, you'll get an error tuple with a reason.