Skip to content

Commit 9cd487d

Browse files
committed
fix(at): Add target test for wrmt-over-at
Reusing modem_sim as slave for wrmt-at Adding manual host test with custom impl based on AT
1 parent f57587a commit 9cd487d

File tree

3 files changed

+119
-0
lines changed

3 files changed

+119
-0
lines changed

.github/workflows/build_at.yml

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,3 +49,109 @@ 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+
shopt -s extglob # enable extended globs for selective cleanup
83+
rm -rf build/!(*.bin|*.elf|*.map|bootloader|partition_table|customized_partitions|flasher_args.json|download.config|factory)
84+
if [ -d build/bootloader ]; then rm -rf build/bootloader/!(*.bin); fi
85+
if [ -d build/partition_table ]; then rm -rf build/partition_table/!(*.bin); fi
86+
shopt -u extglob
87+
zip -qur artifacts.zip build
88+
ls -la
89+
mv artifacts.zip ${GITHUB_WORKSPACE}/
90+
- uses: actions/upload-artifact@v4
91+
with:
92+
name: wrmt_over_at_slave
93+
path: artifacts.zip
94+
if-no-files-found: error
95+
96+
build_wrmt_over_at_host:
97+
name: Build WRMT-AT Host
98+
strategy:
99+
matrix:
100+
idf_ver: ["latest"]
101+
runs-on: ubuntu-latest
102+
container: espressif/idf:${{ matrix.idf_ver }}
103+
steps:
104+
- name: Checkout code
105+
uses: actions/checkout@v3
106+
- name: Build with IDF-${{ matrix.idf_ver }}
107+
shell: bash
108+
run: |
109+
${IDF_PATH}/install.sh --enable-ci
110+
. ${IDF_PATH}/export.sh
111+
cd ./components/esp_wifi_remote/examples/mqtt
112+
idf.py add-dependency wifi_remote_over_at
113+
idf.py build -D SDKCONFIG_DEFAULTS=custom.sdkconfig.at
114+
shopt -s extglob # enable extended globs for selective cleanup
115+
rm -rf build/!(*.bin|*.elf|*.map|bootloader|config|partition_table|customized_partitions|flasher_args.json|download.config|factory)
116+
if [ -d build/bootloader ]; then rm -rf build/bootloader/!(*.bin); fi
117+
if [ -d build/partition_table ]; then rm -rf build/partition_table/!(*.bin); fi
118+
zip -qur artifacts.zip build
119+
- uses: actions/upload-artifact@v4
120+
with:
121+
name: wrmt_over_at_host
122+
path: ./components/esp_wifi_remote/examples/mqtt/artifacts.zip
123+
if-no-files-found: error
124+
125+
run_example:
126+
# Skip running on forks since it won't have access to secrets
127+
if: github.repository == 'espressif/esp-wifi-remote'
128+
name: AT target test
129+
needs:
130+
- build_wrmt_over_at_slave
131+
- build_wrmt_over_at_host
132+
strategy:
133+
matrix:
134+
idf_ver: ["latest"]
135+
runs-on: [self-hosted, wifi-remote]
136+
container:
137+
image: python:3.11-bookworm
138+
options: --privileged # Privileged mode has access to serial ports
139+
env:
140+
TEST_DIR: components/esp_wifi_remote/examples
141+
steps:
142+
- uses: actions/checkout@v4
143+
- uses: actions/download-artifact@v4
144+
with:
145+
name: wrmt_over_at_host
146+
path: ${{ env.TEST_DIR }}/mqtt/
147+
- uses: actions/download-artifact@v4
148+
with:
149+
name: wrmt_over_at_slave
150+
path: ${{ env.TEST_DIR }}/server/
151+
- name: Run Test
152+
working-directory: ${{ env.TEST_DIR }}
153+
run: |
154+
python -m pip install pytest-embedded-serial-esp pytest-embedded-idf pytest-rerunfailures pytest-timeout pytest-ignore-test-results
155+
unzip server/artifacts.zip -d server/
156+
unzip mqtt/artifacts.zip -d mqtt/
157+
python -m pytest --log-cli-level DEBUG --target esp32c6,esp32p4
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# This file was generated using idf.py save-defconfig. It can be edited manually.
2+
# Espressif IoT Development Framework (ESP-IDF) 5.4.1 Project Minimal Configuration
3+
#
4+
CONFIG_IDF_TARGET="esp32p4"
5+
CONFIG_ESP_WIFI_REMOTE_LIBRARY_CUSTOM=y
6+
CONFIG_ESP_WIFI_SSID="local_mosquitto"
7+
CONFIG_ESP_WIFI_PASSWORD="local_mosquitto_password"
8+
CONFIG_WIFI_RMT_AT_UART_TX_PIN=47
9+
CONFIG_WIFI_RMT_AT_UART_RX_PIN=48
10+
CONFIG_ESP32P4_SELECTS_REV_LESS_V3=y
11+
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)

0 commit comments

Comments
 (0)