Skip to content

Commit 0fdfad8

Browse files
rluboscarlescufi
authored andcommitted
snippets: Add Wi-Fi IPv4 snippet
Introduce a snippet for configuring IPv4 over Wi-Fi support in networking samples. Signed-off-by: Robert Lubos <[email protected]>
1 parent b2e61ef commit 0fdfad8

File tree

3 files changed

+62
-0
lines changed

3 files changed

+62
-0
lines changed

snippets/wifi-ipv4/README.rst

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
.. _snippet-wifi-ipv4:
2+
3+
Wi-Fi IPv4 Snippet (wifi-ipv4)
4+
##############################
5+
6+
.. code-block:: console
7+
8+
west build -S wifi-ipv4 [...]
9+
10+
Overview
11+
********
12+
13+
This snippet enables IPv4 Wi-Fi support in supported networking samples.
14+
The sample execution is postponed until Wi-Fi connectivity is established.
15+
16+
Use Wi-Fi shell to connect to the Wi-Fi network:
17+
18+
.. code-block:: console
19+
20+
wifi connect -s <SSID> -k <key_management> -p <passphrase>
21+
22+
Requirements
23+
************
24+
25+
Hardware support for:
26+
27+
- :kconfig:option:`CONFIG_WIFI`
28+
- :kconfig:option:`CONFIG_WIFI_USE_NATIVE_NETWORKING`

snippets/wifi-ipv4/snippet.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
name: wifi-ipv4
2+
append:
3+
EXTRA_CONF_FILE: wifi-ipv4.conf

snippets/wifi-ipv4/wifi-ipv4.conf

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Wi-Fi
2+
CONFIG_WIFI=y
3+
CONFIG_NET_L2_ETHERNET=y
4+
CONFIG_WIFI_NM_WPA_SUPPLICANT=y
5+
6+
# Make sure there is enough resources for supplicant and most of the samples
7+
CONFIG_MAIN_STACK_SIZE=2048
8+
CONFIG_ZVFS_OPEN_MAX=24
9+
CONFIG_NET_MAX_CONN=10
10+
CONFIG_NET_SOCKETS_POLL_MAX=9
11+
12+
# IPv4 only for now
13+
CONFIG_NET_IPV6=n
14+
CONFIG_NET_CONFIG_NEED_IPV6=n
15+
CONFIG_NET_IPV4=y
16+
17+
# DHCPv4
18+
CONFIG_NET_DHCPV4=y
19+
CONFIG_NET_CONFIG_MY_IPV4_ADDR=""
20+
CONFIG_NET_CONFIG_INIT_TIMEOUT=0
21+
22+
# DNS
23+
CONFIG_DNS_RESOLVER=y
24+
25+
# Connection manager
26+
CONFIG_NET_CONNECTION_MANAGER=y
27+
28+
# Wi-Fi shell
29+
CONFIG_NET_SHELL=y
30+
CONFIG_NET_L2_WIFI_SHELL=y
31+
CONFIG_SHELL_STACK_SIZE=5200

0 commit comments

Comments
 (0)