Skip to content

Commit ffe1a3f

Browse files
authored
Merge pull request #96 from david-cermak/feat/at_target_test
[wrmt-over-at]: Add target tests
2 parents f57587a + 090531d commit ffe1a3f

File tree

8 files changed

+148
-2
lines changed

8 files changed

+148
-2
lines changed

.github/workflows/build_at.yml

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,3 +49,102 @@ jobs:
4949
grep esp_wifi_remote_init ${dir}sample.map | grep libwifi_remote_over_at.a || exit 1
5050
echo -e "esp_wifi_remote_init linked from libwifi_remote_over_at"
5151
done
52+
53+
54+
build_wrmt_over_at_slave:
55+
if: contains(github.event.pull_request.labels.*.name, 'at') || github.event_name == 'push'
56+
name: Build WRMT-AT Slave
57+
runs-on: ubuntu-latest
58+
steps:
59+
- name: Checkout code
60+
uses: actions/checkout@v3
61+
- name: Checkout esp-protocols
62+
uses: actions/checkout@v3
63+
with:
64+
repository: espressif/esp-protocols
65+
ref: mqtt_cxx-v0.5.0
66+
path: protocols
67+
- name: Checkout idf
68+
uses: actions/checkout@v3
69+
with:
70+
repository: espressif/esp-idf
71+
ref: 8ad0d3d8f2faab752635bee36070313c47c07a13
72+
path: idf
73+
- name: Build modem_sim from esp-protocols
74+
shell: bash
75+
run: |
76+
export IDF_PATH=$GITHUB_WORKSPACE/idf
77+
${IDF_PATH}/install.sh
78+
cd $GITHUB_WORKSPACE/protocols/common_components/modem_sim
79+
./install.sh PLATFORM_ESP32C6 ESP32C6-4MB 22 23
80+
source export.sh
81+
idf.py build
82+
${GITHUB_WORKSPACE}/ci/clean_build_artifacts.sh build
83+
zip -qur artifacts.zip build
84+
mv artifacts.zip ${GITHUB_WORKSPACE}/
85+
- uses: actions/upload-artifact@v4
86+
with:
87+
name: wrmt_over_at_slave
88+
path: artifacts.zip
89+
if-no-files-found: error
90+
91+
build_wrmt_over_at_host:
92+
name: Build WRMT-AT Host
93+
strategy:
94+
matrix:
95+
idf_ver: ["latest"]
96+
runs-on: ubuntu-latest
97+
container: espressif/idf:${{ matrix.idf_ver }}
98+
steps:
99+
- name: Checkout code
100+
uses: actions/checkout@v3
101+
- name: Build with IDF-${{ matrix.idf_ver }}
102+
shell: bash
103+
run: |
104+
${IDF_PATH}/install.sh --enable-ci
105+
. ${IDF_PATH}/export.sh
106+
cd ./components/esp_wifi_remote/examples/mqtt
107+
# Add wifi_remote_over_at dependency to idf_component.yml (manually with override_path)
108+
echo -e " wifi_remote_over_at:\n version: '*'\n override_path: ../../../../wifi_remote_over_at" >> main/idf_component.yml
109+
idf.py build -D SDKCONFIG_DEFAULTS=custom.sdkconfig.at
110+
${GITHUB_WORKSPACE}/ci/clean_build_artifacts.sh build
111+
zip -qur artifacts.zip build
112+
- uses: actions/upload-artifact@v4
113+
with:
114+
name: wrmt_over_at_host
115+
path: ./components/esp_wifi_remote/examples/mqtt/artifacts.zip
116+
if-no-files-found: error
117+
118+
run_example:
119+
# Skip running on forks since it won't have access to secrets
120+
if: github.repository == 'espressif/esp-wifi-remote'
121+
name: AT target test
122+
needs:
123+
- build_wrmt_over_at_slave
124+
- build_wrmt_over_at_host
125+
strategy:
126+
matrix:
127+
idf_ver: ["latest"]
128+
runs-on: [self-hosted, wifi-remote]
129+
container:
130+
image: python:3.11-bookworm
131+
options: --privileged # Privileged mode has access to serial ports
132+
env:
133+
TEST_DIR: components/esp_wifi_remote/examples
134+
steps:
135+
- uses: actions/checkout@v4
136+
- uses: actions/download-artifact@v4
137+
with:
138+
name: wrmt_over_at_host
139+
path: ${{ env.TEST_DIR }}/mqtt/
140+
- uses: actions/download-artifact@v4
141+
with:
142+
name: wrmt_over_at_slave
143+
path: ${{ env.TEST_DIR }}/server/
144+
- name: Run Test
145+
working-directory: ${{ env.TEST_DIR }}
146+
run: |
147+
python -m pip install pytest-embedded-serial-esp pytest-embedded-idf pytest-rerunfailures pytest-timeout pytest-ignore-test-results
148+
unzip server/artifacts.zip -d server/
149+
unzip mqtt/artifacts.zip -d mqtt/
150+
python -m pytest --log-cli-level DEBUG --target esp32c6,esp32p4

ci/clean_build_artifacts.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/bash
2+
3+
shopt -s extglob # enable extended globs for selective cleanup
4+
BUILD_DIR=$1
5+
rm -rf $BUILD_DIR/!(*.bin|*.elf|*.map|bootloader|config|partition_table|customized_partitions|flasher_args.json|download.config|factory)
6+
if [ -d $BUILD_DIR/bootloader ]; then rm -rf $BUILD_DIR/bootloader/!(*.bin); fi
7+
if [ -d $BUILD_DIR/partition_table ]; then rm -rf $BUILD_DIR/partition_table/!(*.bin); fi
8+
shopt -u extglob # disable extended globs
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
CONFIG_IDF_TARGET="esp32p4"
2+
CONFIG_ESP_WIFI_REMOTE_LIBRARY_CUSTOM=y
3+
CONFIG_ESP_WIFI_SSID="local_mosquitto"
4+
CONFIG_ESP_WIFI_PASSWORD="local_mosquitto_password"
5+
CONFIG_WIFI_RMT_AT_UART_TX_PIN=47
6+
CONFIG_WIFI_RMT_AT_UART_RX_PIN=48
7+
CONFIG_ESP32P4_SELECTS_REV_LESS_V3=y
8+
CONFIG_BROKER_URL="mqtt://192.168.4.1"

components/esp_wifi_remote/examples/pytest_eppp.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ def test_wifi_remote_eppp(dut: Tuple[IdfDut, IdfDut]) -> None:
2121
# Check for wifi station connected event (different for hosted and eppp)
2222
if dut[1].app.sdkconfig.get('ESP_WIFI_REMOTE_LIBRARY_HOSTED') is True:
2323
server.expect('slave_rpc: Sta mode connected', timeout=100)
24+
elif dut[1].app.sdkconfig.get('ESP_WIFI_REMOTE_LIBRARY_CUSTOM') is True:
25+
server.expect('Got IPv4 event: Interface', timeout=100)
2426
else:
2527
server.expect('rpc_server: Received WIFI event 4', timeout=100)
2628
client.expect('MQTT_EVENT_CONNECTED', timeout=100)

components/wifi_remote_over_at/.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(at): $current_version -> $new_version'
44
pre_bump_hooks: python ../../ci/changelog.py wifi_remote_over_at
55
tag_format: wifi_rmt_at-v$version
6-
version: 0.1.0
6+
version: 0.2.0
77
version_files:
88
- idf_component.yml

components/wifi_remote_over_at/CHANGELOG.md

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

3+
## [0.2.0](https://github.com/espressif/esp-wifi-remote/commits/wifi_rmt_at-v0.2.0)
4+
5+
### Features
6+
7+
- Add target test for wrmt-over-at ([44b9830](https://github.com/espressif/esp-wifi-remote/commit/44b9830))
8+
39
## [0.1.0](https://github.com/espressif/esp-wifi-remote/commits/wifi_rmt_at-v0.1.0)
410

511
### Features

components/wifi_remote_over_at/README.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,26 @@
55
This component has no public API, it only provides definitions of `esp_wifi_remote` functions.
66

77
It uses `esp_modem` as a host implementation, and `esp-at` at the communication coprocessor side.
8+
9+
## Build the host side
10+
11+
`esp_wifi_remote` does not provide a backend selection for `wifi_remote_over_at` directly. You need to choose "custom implementation" and add this component to the project dependencies.
12+
- set `CONFIG_ESP_WIFI_REMOTE_LIBRARY_CUSTOM=y`
13+
- run `idf.py add-dependency wifi_remote_over_at`
14+
15+
## Build the slave side
16+
17+
The slave side uses `modem_sim` component from https://github.com/espressif/esp-protocols repository.
18+
To build it, download:
19+
- ESP-IDF v5.4@8ad0d3d8
20+
- esp-protocols mqtt_cxx-v0.5.0
21+
22+
### Configure ESP-AT
23+
- `cd common_components/modem_sim`
24+
- `./install.sh [platform] [module] [tx-pin] [rx-pin]`
25+
- for example `./install.sh PLATFORM_ESP32C6 ESP32C6-4MB 22 23` for esp32c6 on the P4-C6 board
26+
- `source export.sh`
27+
28+
### Build, flash, monitor
29+
30+
- `idf.py build flash monitor`

components/wifi_remote_over_at/idf_component.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version: 0.1.0
1+
version: 0.2.0
22
url: https://github.com/espressif/esp-wifi-remote/tree/master/components/wifi_remote_over_at
33
description: AT based implementation of wifi_remote APIs
44
license: Apache-2.0

0 commit comments

Comments
 (0)