Skip to content

Commit 4e54345

Browse files
authored
Merge pull request #1 from david-cermak/feat/wifi_remote
Moved esp-wifi-remote from esp-protocols (IDFGH-13728)
2 parents 33da11d + ce18349 commit 4e54345

File tree

75 files changed

+10482
-1
lines changed

Some content is hidden

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

75 files changed

+10482
-1
lines changed

.github/workflows/build.yml

Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
name: "esp_wifi_remote: build-tests"
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
types: [opened, synchronize, reopened, labeled]
9+
10+
jobs:
11+
wifi_remote_api_compat:
12+
name: Check API compatibility of WiFi Remote
13+
strategy:
14+
matrix:
15+
idf_ver: ["latest", "release-v5.3"]
16+
runs-on: ubuntu-20.04
17+
container: espressif/idf:${{ matrix.idf_ver }}
18+
steps:
19+
- name: Checkout code
20+
uses: actions/checkout@v3
21+
- name: Check that headers are the same as generated
22+
shell: bash
23+
run: |
24+
. ${IDF_PATH}/export.sh
25+
pip install idf-component-manager idf-build-apps --upgrade
26+
cp -r ./components/esp_wifi_remote ./components/esp_wifi_remote_base
27+
cd ./components/esp_wifi_remote/scripts
28+
python generate_and_check.py --base-dir ../../esp_wifi_remote_base
29+
30+
build_wifi_remote:
31+
name: Build WiFi Remote Test
32+
strategy:
33+
matrix:
34+
idf_ver: ["latest", "release-v5.3"]
35+
test: [ { app: smoke_test, path: "test/smoke_test" }]
36+
runs-on: ubuntu-20.04
37+
container: espressif/idf:${{ matrix.idf_ver }}
38+
steps:
39+
- name: Checkout code
40+
uses: actions/checkout@v3
41+
- name: Checkout protocols
42+
uses: actions/checkout@v3
43+
with:
44+
repository: espressif/esp-protocols
45+
ref: wifi_remote-v0.4.0
46+
sparse-checkout: |
47+
ci/build_apps.py
48+
ci/ignore_build_warnings.txt
49+
sparse-checkout-cone-mode: false
50+
path: protocols
51+
- name: ccache
52+
uses: hendrikmuhs/[email protected]
53+
with:
54+
key: ${{ matrix.idf_ver }}
55+
- name: Build ${{ matrix.test.app }} with IDF-${{ matrix.idf_ver }}
56+
shell: bash
57+
run: |
58+
. ${IDF_PATH}/export.sh
59+
pip install idf-component-manager idf-build-apps --upgrade
60+
python ./components/esp_wifi_remote/scripts/generate_slave_configs.py ./components/esp_wifi_remote/${{matrix.test.path}}
61+
python $GITHUB_WORKSPACE/protocols/ci/build_apps.py ./components/esp_wifi_remote/${{matrix.test.path}} -vv --preserve-all
62+
63+
build_wifi_remote_example:
64+
name: Build WiFi Remote Example
65+
strategy:
66+
matrix:
67+
idf_ver: ["latest"]
68+
example: [ { app: host, path: "examples/mqtt" }, { app: slave, path: "examples/server" }]
69+
include:
70+
- idf_ver: "latest"
71+
example: { app: slave, path: "examples/server" }
72+
warning: "Warning: The smallest app partition is nearly full"
73+
74+
runs-on: ubuntu-20.04
75+
container: espressif/idf:${{ matrix.idf_ver }}
76+
steps:
77+
- name: Checkout code
78+
uses: actions/checkout@v3
79+
- name: Checkout protocols
80+
uses: actions/checkout@v3
81+
with:
82+
repository: espressif/esp-protocols
83+
ref: wifi_remote-v0.4.0
84+
sparse-checkout: |
85+
ci/build_apps.py
86+
ci/ignore_build_warnings.txt
87+
sparse-checkout-cone-mode: false
88+
path: protocols
89+
- name: Build ${{ matrix.example.app }} with IDF-${{ matrix.idf_ver }}
90+
env:
91+
EXPECTED_WARNING: ${{ matrix.warning }}
92+
shell: bash
93+
run: |
94+
. ${IDF_PATH}/export.sh
95+
pip install idf-component-manager idf-build-apps --upgrade
96+
python $GITHUB_WORKSPACE/protocols/ci/build_apps.py ./components/esp_wifi_remote/${{matrix.example.path}} -vv --preserve-all
97+
98+
build_idf_examples_with_wifi_remote:
99+
name: Build IDF examples with WiFi Remote
100+
strategy:
101+
matrix:
102+
idf_ver: ["latest", "release-v5.3"]
103+
idf_target: ["esp32p4", "esp32h2", "esp32s3"]
104+
test: [ { app: idf_mqtt_example, path: "examples/protocols/mqtt/tcp" }]
105+
runs-on: ubuntu-20.04
106+
container: espressif/idf:${{ matrix.idf_ver }}
107+
steps:
108+
- name: Checkout code
109+
uses: actions/checkout@v3
110+
- name: ccache
111+
uses: hendrikmuhs/[email protected]
112+
with:
113+
key: ${{ matrix.idf_ver }}
114+
- name: Build ${{ matrix.test.app }} with IDF-${{ matrix.idf_ver }} for ${{ matrix.idf_target }}
115+
shell: bash
116+
run: |
117+
. ${IDF_PATH}/export.sh
118+
pip install idf-component-manager idf-build-apps --upgrade
119+
export OVERRIDE_PATH=`pwd`/components/esp_wifi_remote
120+
echo ${OVERRIDE_PATH}
121+
sed -i '/espressif\/esp_wifi_remote:/a \ \ \ \ override_path: "${OVERRIDE_PATH}"' ${IDF_PATH}/${{matrix.test.path}}/main/idf_component.yml
122+
cat ${IDF_PATH}/${{matrix.test.path}}/main/idf_component.yml
123+
export PEDANTIC_FLAGS="-DIDF_CI_BUILD -Werror -Werror=deprecated-declarations -Werror=unused-variable -Werror=unused-but-set-variable -Werror=unused-function"
124+
export EXTRA_CFLAGS="${PEDANTIC_FLAGS} -Wstrict-prototypes"
125+
export EXTRA_CXXFLAGS="${PEDANTIC_FLAGS}"
126+
cd ${IDF_PATH}/${{matrix.test.path}}
127+
idf-build-apps find --config sdkconfig.ci* -vv --target ${{ matrix.idf_target }}
128+
idf-build-apps build --config sdkconfig.ci* -vv --target ${{ matrix.idf_target }}

.github/workflows/upload_component.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ jobs:
1414
- name: Upload esp_wifi_remote to IDF Component Registry
1515
uses: espressif/upload-components-ci-action@v1
1616
with:
17-
name: esp_wifi_remote
17+
directories: >
18+
components/console_cmd_wifi;
1819
namespace: "espressif"
1920
api_token: ${{ secrets.IDF_COMPONENT_API_TOKEN }}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
commitizen:
3+
bump_message: 'bump(wifi_remote): $current_version -> $new_version'
4+
pre_bump_hooks: python ../../ci/changelog.py esp_wifi_remote
5+
tag_format: wifi_remote-v$version
6+
version: 0.4.0
7+
version_files:
8+
- idf_component.yml
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# Changelog
2+
3+
## [0.4.0](https://github.com/espressif/esp-protocols/commits/wifi_remote-v0.4.0)
4+
5+
### Features
6+
7+
- Make esp_hosted default RPC library ([1b62adbd](https://github.com/espressif/esp-protocols/commit/1b62adbd))
8+
- Add build test for current IDF examples ([50c113e4](https://github.com/espressif/esp-protocols/commit/50c113e4))
9+
- Support for IDF v5.3 in a separate directory ([bde97203](https://github.com/espressif/esp-protocols/commit/bde97203))
10+
- Support for IDF v5.4 via a separate dir ([e9ac41e1](https://github.com/espressif/esp-protocols/commit/e9ac41e1))
11+
- Add slave selection and peview targets ([345c4577](https://github.com/espressif/esp-protocols/commit/345c4577))
12+
13+
### Bug Fixes
14+
15+
- Fix CMake to use inherent IDF build vars ([c454ec09](https://github.com/espressif/esp-protocols/commit/c454ec09))
16+
- Update per v5.4 espressif/esp-idf@97e42349 ([ff5dac70](https://github.com/espressif/esp-protocols/commit/ff5dac70))
17+
- Fix CI builds to generate configs per slave selection ([8795d164](https://github.com/espressif/esp-protocols/commit/8795d164))
18+
- Depend on esp_hosted only on targets with no WiFi ([7ca5ed1d](https://github.com/espressif/esp-protocols/commit/7ca5ed1d))
19+
- Update per espressif/esp-idf@27f61966 ([2e53b81f](https://github.com/espressif/esp-protocols/commit/2e53b81f))
20+
- Fix checking API compat against reference dir ([1a57a878](https://github.com/espressif/esp-protocols/commit/1a57a878))
21+
22+
## [0.3.0](https://github.com/espressif/esp-protocols/commits/wifi_remote-v0.3.0)
23+
24+
### Features
25+
26+
- add esp_wifi_internal_tx_by_ref ([ba35d14e](https://github.com/espressif/esp-protocols/commit/ba35d14e))
27+
- Make wifi_remote depend on esp_hosted ([ac9972aa](https://github.com/espressif/esp-protocols/commit/ac9972aa))
28+
29+
## [0.2.3](https://github.com/espressif/esp-protocols/commits/wifi_remote-v0.2.3)
30+
31+
### Bug Fixes
32+
33+
- Fix server event/command race condtion using eventfd ([732b1d5](https://github.com/espressif/esp-protocols/commit/732b1d5))
34+
- Lock server before marshalling events ([9e13870](https://github.com/espressif/esp-protocols/commit/9e13870))
35+
36+
## [0.2.2](https://github.com/espressif/esp-protocols/commits/wifi_remote-v0.2.2)
37+
38+
### Bug Fixes
39+
40+
- Added more netif options for eppp connection ([24ce867](https://github.com/espressif/esp-protocols/commit/24ce867))
41+
- Do not restrict EPPP config to RSA keys only ([f05c765](https://github.com/espressif/esp-protocols/commit/f05c765), [#570](https://github.com/espressif/esp-protocols/issues/570))
42+
43+
## [0.2.1](https://github.com/espressif/esp-protocols/commits/wifi_remote-v0.2.1)
44+
45+
### Bug Fixes
46+
47+
- Added misc wifi API in eppp impl ([93256d1](https://github.com/espressif/esp-protocols/commit/93256d1))
48+
- Updated eppp dependency not to use fixed version ([3a48c06](https://github.com/espressif/esp-protocols/commit/3a48c06))
49+
50+
## [0.2.0](https://github.com/espressif/esp-protocols/commits/wifi_remote-v0.2.0)
51+
52+
### Features
53+
54+
- Add support for simple eppp based RPC ([fd168d8](https://github.com/espressif/esp-protocols/commit/fd168d8))
55+
56+
### Bug Fixes
57+
58+
- Make services restartable, code cleanup ([6c82ce2](https://github.com/espressif/esp-protocols/commit/6c82ce2))
59+
- Add examples to CI ([d2b7c55](https://github.com/espressif/esp-protocols/commit/d2b7c55))
60+
61+
## [0.1.12](https://github.com/espressif/esp-protocols/commits/wifi_remote-v0.1.12)
62+
63+
### Features
64+
65+
- Added generation step for wifi_remote based on IDF ([dfb00358](https://github.com/espressif/esp-protocols/commit/dfb00358))
66+
- Move to esp-protocols ([edc3c2d](https://github.com/espressif/esp-protocols/commit/edc3c2d))
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
set(IDF_VER_DIR "idf_v${IDF_VERSION_MAJOR}.${IDF_VERSION_MINOR}")
2+
3+
if(NOT CONFIG_ESP_WIFI_ENABLED)
4+
set(src_wifi_is_remote esp_wifi_remote.c ${IDF_VER_DIR}/esp_wifi_with_remote.c esp_wifi_remote_net.c)
5+
endif()
6+
7+
if(CONFIG_ESP_WIFI_REMOTE_LIBRARY_EPPP)
8+
set(src_wifi_remote_eppp eppp/wifi_remote_rpc_client.cpp eppp/wifi_remote_rpc_server.cpp eppp/eppp_init.c)
9+
else()
10+
set(src_wifi_remote_weak ${IDF_VER_DIR}/esp_wifi_remote_weak.c)
11+
endif()
12+
13+
idf_component_register(INCLUDE_DIRS include ${IDF_VER_DIR}/include
14+
SRCS ${src_wifi_remote_weak}
15+
${src_wifi_remote_eppp}
16+
${src_wifi_is_remote}
17+
PRIV_INCLUDE_DIRS eppp
18+
REQUIRES esp_event esp_netif
19+
PRIV_REQUIRES esp_wifi esp-tls vfs)
20+
21+
idf_component_get_property(wifi esp_wifi COMPONENT_LIB)
22+
target_link_libraries(${wifi} PUBLIC ${COMPONENT_LIB})

components/esp_wifi_remote/Kconfig

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
menu "Wi-Fi Remote"
2+
config ESP_WIFI_REMOTE_ENABLED
3+
bool
4+
default y
5+
6+
orsource "./idf_v$ESP_IDF_VERSION/Kconfig.slave_select.in"
7+
orsource "./idf_v$ESP_IDF_VERSION/Kconfig.soc_wifi_caps.in"
8+
orsource "./Kconfig.rpc.in"
9+
10+
menu "Wi-Fi configuration"
11+
orsource "./idf_v$ESP_IDF_VERSION/Kconfig.wifi.in"
12+
endmenu
13+
14+
endmenu # Wi-Fi Remote
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
choice ESP_WIFI_REMOTE_LIBRARY
2+
prompt "Choose WiFi-remote implementation"
3+
default ESP_WIFI_REMOTE_LIBRARY_HOSTED
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_NETIF_PRIORITY
34+
int "Routing priority of eppp netif"
35+
default 100
36+
range 0 256
37+
help
38+
Set the priority of the wifi-remote netif.
39+
The bigger the number the higher the priority.
40+
The interface which is up and with the highest priority will act as a default GW.
41+
42+
config ESP_WIFI_REMOTE_EPPP_NETIF_DESCRIPTION
43+
string "eppp network interface description"
44+
default "example_netif_sta"
45+
help
46+
Textual description of the wifi remote network interface.
47+
By default it is set to "example_netif_sta" to be used in IDF protocol example
48+
as default wifi station substitution.
49+
50+
config ESP_WIFI_REMOTE_EPPP_SERVER_CA
51+
string "Servers CA certificate"
52+
default "--- Please copy content of the CA certificate ---"
53+
54+
config ESP_WIFI_REMOTE_EPPP_CLIENT_CRT
55+
string "Client certificate"
56+
default "--- Please copy content of the Client certificate ---"
57+
58+
config ESP_WIFI_REMOTE_EPPP_CLIENT_KEY
59+
string "Client key"
60+
default "--- Please copy content of the Client key ---"
61+
62+
config ESP_WIFI_REMOTE_EPPP_CLIENT_CA
63+
string "Clients CA certificate"
64+
default "--- Please copy content of the CA certificate ---"
65+
66+
config ESP_WIFI_REMOTE_EPPP_SERVER_CRT
67+
string "Server certificate"
68+
default "--- Please copy content of the Client certificate ---"
69+
70+
config ESP_WIFI_REMOTE_EPPP_SERVER_KEY
71+
string "Server key"
72+
default "--- Please copy content of the Client key ---"
73+
74+
endif

0 commit comments

Comments
 (0)