Skip to content

Commit f032a9f

Browse files
authored
Merge pull request #538 from david-cermak/feat/wifi_remote_example
[wifi remote]: Add example without `esp_hosted`
2 parents bd6e120 + d163878 commit f032a9f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+1277
-129
lines changed

.github/workflows/wifi_remote__build.yml

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
3030
build_wifi_remote:
3131
if: contains(github.event.pull_request.labels.*.name, 'wifi_remote') || github.event_name == 'push'
32-
name: Build WiFi Remote
32+
name: Build WiFi Remote Test
3333
strategy:
3434
matrix:
3535
idf_ver: ["latest"]
@@ -49,3 +49,29 @@ jobs:
4949
${IDF_PATH}/install.sh --enable-pytest
5050
. ${IDF_PATH}/export.sh
5151
python ./ci/build_apps.py ./components/esp_wifi_remote/${{matrix.test.path}} -vv --preserve-all
52+
53+
build_wifi_remote_example:
54+
if: contains(github.event.pull_request.labels.*.name, 'wifi_remote') || github.event_name == 'push'
55+
name: Build WiFi Remote Example
56+
strategy:
57+
matrix:
58+
idf_ver: ["latest"]
59+
example: [ { app: host, path: "examples/mqtt" }, { app: slave, path: "examples/server" }]
60+
include:
61+
- idf_ver: "latest"
62+
example: { app: slave, path: "examples/server" }
63+
warning: "Warning: The smallest app partition is nearly full"
64+
65+
runs-on: ubuntu-20.04
66+
container: espressif/idf:${{ matrix.idf_ver }}
67+
steps:
68+
- name: Checkout esp-protocols
69+
uses: actions/checkout@v3
70+
- name: Build ${{ matrix.example.app }} with IDF-${{ matrix.idf_ver }}
71+
env:
72+
EXPECTED_WARNING: ${{ matrix.warning }}
73+
shell: bash
74+
run: |
75+
${IDF_PATH}/install.sh --enable-pytest
76+
. ${IDF_PATH}/export.sh
77+
python ./ci/build_apps.py ./components/esp_wifi_remote/${{matrix.example.path}} -vv --preserve-all

components/esp_wifi_remote/.cz.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ commitizen:
33
bump_message: 'bump(wifi_remote): $current_version -> $new_version'
44
pre_bump_hooks: python ../../ci/changelog.py esp_wifi_remote
55
tag_format: wifi_remote-v$version
6-
version: 0.1.12
6+
version: 0.2.0
77
version_files:
88
- idf_component.yml

components/esp_wifi_remote/CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
# Changelog
22

3+
## [0.2.0](https://github.com/espressif/esp-protocols/commits/wifi_remote-v0.2.0)
4+
5+
### Features
6+
7+
- Add support for simple eppp based RPC ([fd168d8](https://github.com/espressif/esp-protocols/commit/fd168d8))
8+
9+
### Bug Fixes
10+
11+
- Make services restartable, code cleanup ([6c82ce2](https://github.com/espressif/esp-protocols/commit/6c82ce2))
12+
- Add examples to CI ([d2b7c55](https://github.com/espressif/esp-protocols/commit/d2b7c55))
13+
314
## [0.1.12](https://github.com/espressif/esp-protocols/commits/wifi_remote-v0.1.12)
415

516
### Features
Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,20 @@
11
if(NOT CONFIG_ESP_WIFI_ENABLED)
2-
set(src_wifi_is_remote esp_wifi_remote.c esp_wifi_with_remote.c)
2+
set(src_wifi_is_remote esp_wifi_remote.c esp_wifi_with_remote.c esp_wifi_remote_net.c)
3+
endif()
4+
5+
if(CONFIG_ESP_WIFI_REMOTE_LIBRARY_EPPP)
6+
set(src_wifi_remote_eppp eppp/wifi_remote_rpc_client.cpp eppp/wifi_remote_rpc_server.cpp eppp/eppp_init.c)
7+
else()
8+
set(src_wifi_remote_weak esp_wifi_remote_weak.c)
39
endif()
410

511
idf_component_register(INCLUDE_DIRS include
6-
SRCS ${src_wifi_is_remote}
7-
esp_wifi_remote_net.c
8-
esp_wifi_remote_weak.c
12+
SRCS ${src_wifi_remote_weak}
13+
${src_wifi_remote_eppp}
14+
${src_wifi_is_remote}
15+
PRIV_INCLUDE_DIRS eppp
916
REQUIRES esp_event esp_netif
10-
PRIV_REQUIRES esp_wifi)
11-
12-
idf_component_optional_requires(PRIVATE esp_hosted)
17+
PRIV_REQUIRES esp_wifi esp-tls)
1318

1419
idf_component_get_property(wifi esp_wifi COMPONENT_LIB)
1520
target_link_libraries(${wifi} PUBLIC ${COMPONENT_LIB})

components/esp_wifi_remote/Kconfig

Lines changed: 29 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ menu "Wi-Fi Remote"
55
default y
66

77
orsource "./Kconfig.soc_wifi_caps.in"
8+
orsource "./Kconfig.rpc.in"
89

910
config ESP_WIFI_STATIC_RX_BUFFER_NUM
1011
int "Max number of WiFi static RX buffers"
@@ -191,7 +192,7 @@ menu "Wi-Fi Remote"
191192
Set the size of WiFi Block Ack RX window. Generally a bigger value means higher throughput and better
192193
compatibility but more memory. Most of time we should NOT change the default value unless special
193194
reason, e.g. test the maximum UDP RX throughput with iperf etc. For iperf test in shieldbox, the
194-
recommended value is 9~12. If PSRAM is used and WiFi memory is prefered to allocat in PSRAM first,
195+
recommended value is 9~12. If PSRAM is used and WiFi memory is preferred to allocate in PSRAM first,
195196
the default and minimum value should be 16 to achieve better throughput and compatibility with both
196197
stations and APs.
197198

@@ -228,14 +229,14 @@ menu "Wi-Fi Remote"
228229
help
229230
ESP-MESH utilizes beacon frames to detect and resolve root node conflicts (see documentation). However
230231
the default length of a beacon frame can simultaneously hold only five root node identifier structures,
231-
meaning that a root node conflict of up to five nodes can be detected at one time. In the occurence of
232+
meaning that a root node conflict of up to five nodes can be detected at one time. In the occurrence of
232233
more root nodes conflict involving more than five root nodes, the conflict resolution process will
233234
detect five of the root nodes, resolve the conflict, and re-detect more root nodes. This process will
234235
repeat until all root node conflicts are resolved. However this process can generally take a very long
235236
time.
236237

237238
To counter this situation, the beacon frame length can be increased such that more root nodes can be
238-
detected simultaneously. Each additional root node will require 36 bytes and should be added ontop of
239+
detected simultaneously. Each additional root node will require 36 bytes and should be added on top of
239240
the default beacon frame length of
240241
752 bytes. For example, if you want to detect 10 root nodes simultaneously, you need to set the beacon
241242
frame length as
@@ -487,9 +488,9 @@ menu "Wi-Fi Remote"
487488
help
488489
Select this option to use MbedTLS TLS client for WPA2 enterprise connection.
489490
Please note that from MbedTLS-3.0 onwards, MbedTLS does not support SSL-3.0
490-
TLS-v1.0, TLS-v1.1 versions. Incase your server is using one of these version,
491+
TLS-v1.0, TLS-v1.1 versions. In case your server is using one of these version,
491492
it is advisable to update your server.
492-
Please disable this option for compatibilty with older TLS versions.
493+
Please disable this option for compatibility with older TLS versions.
493494

494495
config ESP_WIFI_EAP_TLS1_3
495496
bool "Enable EAP-TLS v1.3 Support for WiFi Enterprise connection"
@@ -556,6 +557,26 @@ menu "Wi-Fi Remote"
556557
help
557558
Select this option to enable WiFi Multiband operation certification support.
558559

560+
config ESP_WIFI_ENABLE_ROAMING_APP
561+
bool "Advanced support for Wi-Fi Roaming (Experimental)"
562+
depends on IDF_EXPERIMENTAL_FEATURES
563+
default n
564+
select ESP_WIFI_SCAN_CACHE
565+
help
566+
Enable Espressif's roaming app to allow for efficient Wi-Fi roaming.
567+
This includes configurable periodic environment scans, maintaining a cache of the
568+
best APs, handling low rssi events etc.
569+
570+
Risk Warning
571+
Please note that this feature is still experimental and enabling this potentially can
572+
lead to unpredictable scanning, connection and roaming attempts.
573+
We are still working on tuning and optimising this feature to ensure reliable and stable use.
574+
575+
menu "Configure roaming App"
576+
depends on ESP_WIFI_ENABLE_ROAMING_APP
577+
rsource "wifi_apps/roaming_app/src/Kconfig.roaming"
578+
endmenu
579+
559580
config ESP_WIFI_DPP_SUPPORT
560581
bool "Enable DPP support"
561582
default n
@@ -597,17 +618,17 @@ menu "Wi-Fi Remote"
597618
default n
598619
help
599620
Select this option to enable validate each WPS attribute
600-
rigorously. Disabling this add the workaorunds with various APs.
621+
rigorously. Disabling this add the workarounds with various APs.
601622
Enabling this may cause inter operability issues with some APs.
602623

603624
config ESP_WIFI_WPS_PASSPHRASE
604625
bool "Get WPA2 passphrase in WPS config"
605626
default n
606627
help
607628
Select this option to get passphrase during WPS configuration.
608-
This option fakes the virtual display capabilites to get the
629+
This option fakes the virtual display capabilities to get the
609630
configuration in passphrase mode.
610-
Not recommanded to be used since WPS credentials should not
631+
Not recommended to be used since WPS credentials should not
611632
be shared to other devices, making it in readable format increases
612633
that risk, also passphrase requires pbkdf2 to convert in psk.
613634

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
choice ESP_WIFI_REMOTE_LIBRARY
2+
prompt "Choose WiFi-remote implementation"
3+
default ESP_WIFI_REMOTE_LIBRARY_EPPP
4+
help
5+
Select type of WiFi Remote implementation
6+
7+
ESP-HOSTED is the default and most versatile option.
8+
It's also possible to use EPPP, which uses PPPoS link between micros and NAPT, so it's slower
9+
and less universal.
10+
11+
config ESP_WIFI_REMOTE_LIBRARY_HOSTED
12+
bool "ESP-HOSTED"
13+
config ESP_WIFI_REMOTE_LIBRARY_EPPP
14+
bool "EPPP"
15+
endchoice
16+
17+
if ESP_WIFI_REMOTE_LIBRARY_EPPP
18+
19+
config ESP_WIFI_REMOTE_EPPP_UART_TX_PIN
20+
int "TXD Pin Number"
21+
default 10
22+
range 0 31
23+
help
24+
Pin number of UART TX.
25+
26+
config ESP_WIFI_REMOTE_EPPP_UART_RX_PIN
27+
int "RXD Pin Number"
28+
default 11
29+
range 0 31
30+
help
31+
Pin number of UART RX.
32+
33+
config ESP_WIFI_REMOTE_EPPP_SERVER_CA
34+
string "Servers CA certificate"
35+
default "--- Please copy content of the CA certificate ---"
36+
37+
config ESP_WIFI_REMOTE_EPPP_CLIENT_CRT
38+
string "Client certificate"
39+
default "--- Please copy content of the Client certificate ---"
40+
41+
config ESP_WIFI_REMOTE_EPPP_CLIENT_KEY
42+
string "Client key"
43+
default "--- Please copy content of the Client key ---"
44+
45+
config ESP_WIFI_REMOTE_EPPP_CLIENT_CA
46+
string "Clients CA certificate"
47+
default "--- Please copy content of the CA certificate ---"
48+
49+
config ESP_WIFI_REMOTE_EPPP_SERVER_CRT
50+
string "Server certificate"
51+
default "--- Please copy content of the Client certificate ---"
52+
53+
config ESP_WIFI_REMOTE_EPPP_SERVER_KEY
54+
string "Server key"
55+
default "--- Please copy content of the Client key ---"
56+
57+
endif

components/esp_wifi_remote/Kconfig.soc_wifi_caps.in

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,3 +227,11 @@ endif # ESP32C6
227227
if SLAVE_IDF_TARGET_ESP32H2
228228

229229
endif # ESP32H2
230+
231+
if SLAVE_IDF_TARGET_ESP32P4
232+
233+
config SLAVE_SOC_WIFI_LIGHT_SLEEP_CLK_WIDTH
234+
int
235+
default 12
236+
237+
endif # ESP32P4
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/*
2+
* SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
#include "esp_log.h"
7+
#include "esp_wifi.h"
8+
#include "eppp_link.h"
9+
10+
__attribute__((weak)) esp_netif_t *wifi_remote_eppp_init(eppp_type_t role)
11+
{
12+
uint32_t our_ip = role == EPPP_SERVER ? EPPP_DEFAULT_SERVER_IP() : EPPP_DEFAULT_CLIENT_IP();
13+
uint32_t their_ip = role == EPPP_SERVER ? EPPP_DEFAULT_CLIENT_IP() : EPPP_DEFAULT_SERVER_IP();
14+
eppp_config_t config = EPPP_DEFAULT_CONFIG(our_ip, their_ip);
15+
// We currently support only UART transport
16+
config.transport = EPPP_TRANSPORT_UART;
17+
config.uart.tx_io = CONFIG_ESP_WIFI_REMOTE_EPPP_UART_TX_PIN;
18+
config.uart.rx_io = CONFIG_ESP_WIFI_REMOTE_EPPP_UART_RX_PIN;
19+
return eppp_open(role, &config, portMAX_DELAY);
20+
}

0 commit comments

Comments
 (0)