fix(modem): Replace MQTT client with simple ping command

This commit is contained in:
David Cermak
2025-11-24 09:07:19 +01:00
parent 9b2b1f680d
commit 0ccaf2c0bb
6 changed files with 30 additions and 251 deletions

View File

@@ -1,4 +1,4 @@
# SPDX-FileCopyrightText: 2023-2024 Espressif Systems (Shanghai) CO LTD
# SPDX-FileCopyrightText: 2023-2025 Espressif Systems (Shanghai) CO LTD
# SPDX-License-Identifier: Unlicense OR CC0-1.0
from __future__ import print_function, unicode_literals
@@ -6,21 +6,10 @@ from __future__ import print_function, unicode_literals
def test_cmux_connection(dut):
"""
steps:
1. initializes connection with SIM800
2. checks we get an IP
3. checks for the MQTT events
1. checks we're in CMUX mode and get an IP
2. checks for ping command
"""
# Get topic and data from Kconfig
topic = ''
data = ''
try:
topic = dut.app.sdkconfig.get('EXAMPLE_MQTT_TEST_TOPIC')
data = dut.app.sdkconfig.get('EXAMPLE_MQTT_TEST_DATA')
except Exception:
print('ENV_TEST_FAILURE: Cannot find broker url in sdkconfig')
raise
# Check the sequence of connecting, publishing, disconnecting
dut.expect('Modem has correctly entered multiplexed')
# Check for MQTT connection and the data event
dut.expect(f'TOPIC: {topic}')
dut.expect(f'DATA: {data}')
# Check we're in CMUX mode and get an IP
dut.expect('Modem has correctly entered multiplexed command/data mode', timeout=60)
# Check for ping command
dut.expect('Ping command finished with return value: 0', timeout=30)