-
Notifications
You must be signed in to change notification settings - Fork 6.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
samples: net: sockets: echo: Add WiFi support
Modify the sample application to connect to a WiFi access point, if configured. Kconfig options are provided to specify the SSID and password. Configuration file is included for the Raspberry Pi Pico W. Signed-off-by: Steve Boylan <[email protected]>
- Loading branch information
1 parent
d04b3e0
commit 519b9ac
Showing
4 changed files
with
114 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Copyright (c) 2024 Steve Boylan <[email protected]> | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
mainmenu "Sample app Configuration" | ||
|
||
if WIFI | ||
config NET_SAMPLE_WIFI_SSID | ||
string "WIFI SSID - Network name" | ||
default "my_network" | ||
|
||
config NET_SAMPLE_WIFI_PSK | ||
string "WIFI PSK - Network password key" | ||
default "secret_passwd" | ||
endif | ||
|
||
source "Kconfig.zephyr" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
CONFIG_EARLY_CONSOLE=y | ||
|
||
CONFIG_MAIN_STACK_SIZE=5200 | ||
CONFIG_SHELL_STACK_SIZE=5200 | ||
CONFIG_NET_TX_STACK_SIZE=2048 | ||
CONFIG_NET_RX_STACK_SIZE=2048 | ||
CONFIG_HEAP_MEM_POOL_SIZE=16384 | ||
CONFIG_SHELL_STACK_SIZE=2560 | ||
|
||
CONFIG_WIFI=y | ||
CONFIG_WIFI_LOG_LEVEL_ERR=y | ||
CONFIG_NET_L2_WIFI_SHELL=y | ||
# printing of scan results puts pressure on queues in new locking | ||
# design in net_mgmt. So, use a higher timeout for a crowded | ||
# environment. | ||
CONFIG_NET_MGMT_EVENT_QUEUE_TIMEOUT=5000 | ||
CONFIG_NET_MGMT_EVENT_QUEUE_SIZE=16 | ||
|
||
CONFIG_NETWORKING=y | ||
CONFIG_NET_L2_ETHERNET=y | ||
|
||
CONFIG_NET_IPV6=n | ||
CONFIG_NET_IPV4=y | ||
CONFIG_NET_DHCPV4=y | ||
CONFIG_NET_CONFIG_MY_IPV4_ADDR="" | ||
CONFIG_NET_CONFIG_PEER_IPV4_ADDR="" | ||
|
||
CONFIG_NET_LOG=y | ||
CONFIG_INIT_STACKS=y | ||
|
||
CONFIG_NET_SHELL=y | ||
|
||
CONFIG_NET_STATISTICS=y | ||
CONFIG_NET_STATISTICS_PERIODIC_OUTPUT=n | ||
|
||
CONFIG_COMPILER_SAVE_TEMPS=y | ||
|
||
CONFIG_LOG=y | ||
CONFIG_LOG_MODE_IMMEDIATE=y | ||
CONFIG_LOG_BACKEND_SHOW_COLOR=n | ||
|
||
CONFIG_NET_SOCKETS_LOG_LEVEL_DBG=y | ||
CONFIG_NET_CONN_LOG_LEVEL_DBG=y | ||
CONFIG_NET_CONTEXT_LOG_LEVEL_DBG=y | ||
|
||
CONFIG_NET_TCP_LOG_LEVEL_DBG=y | ||
|
||
CONFIG_NET_SAMPLE_WIFI_SSID="<YOUR SSID HERE>" | ||
CONFIG_NET_SAMPLE_WIFI_PSK="<YOUR WIFI PASSWORD HERE>" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters