-
Notifications
You must be signed in to change notification settings - Fork 145
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #538 from david-cermak/feat/wifi_remote_example
[wifi remote]: Add example without `esp_hosted`
- Loading branch information
Showing
41 changed files
with
1,277 additions
and
129 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
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
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 |
---|---|---|
@@ -1,15 +1,20 @@ | ||
if(NOT CONFIG_ESP_WIFI_ENABLED) | ||
set(src_wifi_is_remote esp_wifi_remote.c esp_wifi_with_remote.c) | ||
set(src_wifi_is_remote esp_wifi_remote.c esp_wifi_with_remote.c esp_wifi_remote_net.c) | ||
endif() | ||
|
||
if(CONFIG_ESP_WIFI_REMOTE_LIBRARY_EPPP) | ||
set(src_wifi_remote_eppp eppp/wifi_remote_rpc_client.cpp eppp/wifi_remote_rpc_server.cpp eppp/eppp_init.c) | ||
else() | ||
set(src_wifi_remote_weak esp_wifi_remote_weak.c) | ||
endif() | ||
|
||
idf_component_register(INCLUDE_DIRS include | ||
SRCS ${src_wifi_is_remote} | ||
esp_wifi_remote_net.c | ||
esp_wifi_remote_weak.c | ||
SRCS ${src_wifi_remote_weak} | ||
${src_wifi_remote_eppp} | ||
${src_wifi_is_remote} | ||
PRIV_INCLUDE_DIRS eppp | ||
REQUIRES esp_event esp_netif | ||
PRIV_REQUIRES esp_wifi) | ||
|
||
idf_component_optional_requires(PRIVATE esp_hosted) | ||
PRIV_REQUIRES esp_wifi esp-tls) | ||
|
||
idf_component_get_property(wifi esp_wifi COMPONENT_LIB) | ||
target_link_libraries(${wifi} PUBLIC ${COMPONENT_LIB}) |
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,57 @@ | ||
choice ESP_WIFI_REMOTE_LIBRARY | ||
prompt "Choose WiFi-remote implementation" | ||
default ESP_WIFI_REMOTE_LIBRARY_EPPP | ||
help | ||
Select type of WiFi Remote implementation | ||
|
||
ESP-HOSTED is the default and most versatile option. | ||
It's also possible to use EPPP, which uses PPPoS link between micros and NAPT, so it's slower | ||
and less universal. | ||
|
||
config ESP_WIFI_REMOTE_LIBRARY_HOSTED | ||
bool "ESP-HOSTED" | ||
config ESP_WIFI_REMOTE_LIBRARY_EPPP | ||
bool "EPPP" | ||
endchoice | ||
|
||
if ESP_WIFI_REMOTE_LIBRARY_EPPP | ||
|
||
config ESP_WIFI_REMOTE_EPPP_UART_TX_PIN | ||
int "TXD Pin Number" | ||
default 10 | ||
range 0 31 | ||
help | ||
Pin number of UART TX. | ||
|
||
config ESP_WIFI_REMOTE_EPPP_UART_RX_PIN | ||
int "RXD Pin Number" | ||
default 11 | ||
range 0 31 | ||
help | ||
Pin number of UART RX. | ||
|
||
config ESP_WIFI_REMOTE_EPPP_SERVER_CA | ||
string "Servers CA certificate" | ||
default "--- Please copy content of the CA certificate ---" | ||
|
||
config ESP_WIFI_REMOTE_EPPP_CLIENT_CRT | ||
string "Client certificate" | ||
default "--- Please copy content of the Client certificate ---" | ||
|
||
config ESP_WIFI_REMOTE_EPPP_CLIENT_KEY | ||
string "Client key" | ||
default "--- Please copy content of the Client key ---" | ||
|
||
config ESP_WIFI_REMOTE_EPPP_CLIENT_CA | ||
string "Clients CA certificate" | ||
default "--- Please copy content of the CA certificate ---" | ||
|
||
config ESP_WIFI_REMOTE_EPPP_SERVER_CRT | ||
string "Server certificate" | ||
default "--- Please copy content of the Client certificate ---" | ||
|
||
config ESP_WIFI_REMOTE_EPPP_SERVER_KEY | ||
string "Server key" | ||
default "--- Please copy content of the Client key ---" | ||
|
||
endif |
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,20 @@ | ||
/* | ||
* SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
#include "esp_log.h" | ||
#include "esp_wifi.h" | ||
#include "eppp_link.h" | ||
|
||
__attribute__((weak)) esp_netif_t *wifi_remote_eppp_init(eppp_type_t role) | ||
{ | ||
uint32_t our_ip = role == EPPP_SERVER ? EPPP_DEFAULT_SERVER_IP() : EPPP_DEFAULT_CLIENT_IP(); | ||
uint32_t their_ip = role == EPPP_SERVER ? EPPP_DEFAULT_CLIENT_IP() : EPPP_DEFAULT_SERVER_IP(); | ||
eppp_config_t config = EPPP_DEFAULT_CONFIG(our_ip, their_ip); | ||
// We currently support only UART transport | ||
config.transport = EPPP_TRANSPORT_UART; | ||
config.uart.tx_io = CONFIG_ESP_WIFI_REMOTE_EPPP_UART_TX_PIN; | ||
config.uart.rx_io = CONFIG_ESP_WIFI_REMOTE_EPPP_UART_RX_PIN; | ||
return eppp_open(role, &config, portMAX_DELAY); | ||
} |
Oops, something went wrong.