From 26e2beb7c91c65b20e8befeaf1abb98505d5b3a7 Mon Sep 17 00:00:00 2001 From: David Cermak Date: Fri, 6 Dec 2024 10:56:06 +0100 Subject: [PATCH] fix(modem): Use the same public broker for examples --- .../esp_modem/examples/pppos_client/main/pppos_client_main.c | 4 ++++ .../esp_modem/examples/pppos_client/pytest_pppos_client.py | 2 +- .../examples/simple_cmux_client/sdkconfig.ci.sim800_cmux | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/components/esp_modem/examples/pppos_client/main/pppos_client_main.c b/components/esp_modem/examples/pppos_client/main/pppos_client_main.c index 7c0212eefb..68b4d9e9aa 100644 --- a/components/esp_modem/examples/pppos_client/main/pppos_client_main.c +++ b/components/esp_modem/examples/pppos_client/main/pppos_client_main.c @@ -55,6 +55,7 @@ static void usb_terminal_error_handler(esp_modem_terminal_error_t err) } #define CHECK_USB_DISCONNECTION(event_group) \ if ((xEventGroupGetBits(event_group) & USB_DISCONNECTED_BIT) == USB_DISCONNECTED_BIT) { \ + ESP_LOGE(TAG, "USB_DISCONNECTED_BIT destroying modem dce"); \ esp_modem_destroy(dce); \ continue; \ } @@ -264,6 +265,8 @@ void app_main(void) } } + xEventGroupClearBits(event_group, CONNECT_BIT | GOT_DATA_BIT | USB_DISCONNECTED_BIT); + /* Run the modem demo app */ #if CONFIG_EXAMPLE_NEED_SIM_PIN == 1 // check if PIN needed @@ -319,6 +322,7 @@ void app_main(void) ESP_LOGI(TAG, "Waiting for IP address"); xEventGroupWaitBits(event_group, CONNECT_BIT | USB_DISCONNECTED_BIT, pdFALSE, pdFALSE, portMAX_DELAY); CHECK_USB_DISCONNECTION(event_group); + ESP_LOGW(TAG, "Waiting for IP address DONE!"); /* Config MQTT */ #if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 0, 0) diff --git a/components/esp_modem/examples/pppos_client/pytest_pppos_client.py b/components/esp_modem/examples/pppos_client/pytest_pppos_client.py index 2ffb42cabc..6c823c5aa9 100644 --- a/components/esp_modem/examples/pppos_client/pytest_pppos_client.py +++ b/components/esp_modem/examples/pppos_client/pytest_pppos_client.py @@ -12,7 +12,7 @@ def test_pppos_connect(dut): 4. checks that the client cleanly disconnects """ # Check the sequence of connecting, publishing, disconnecting - dut.expect('Modem Connect to PPP Server') + dut.expect('Modem Connect to PPP Server', timeout=90) # Check for MQTT connection and the data event dut.expect('MQTT_EVENT_CONNECTED') dut.expect('MQTT_EVENT_DATA') diff --git a/components/esp_modem/examples/simple_cmux_client/sdkconfig.ci.sim800_cmux b/components/esp_modem/examples/simple_cmux_client/sdkconfig.ci.sim800_cmux index 6bf623113c..6a22a89f12 100644 --- a/components/esp_modem/examples/simple_cmux_client/sdkconfig.ci.sim800_cmux +++ b/components/esp_modem/examples/simple_cmux_client/sdkconfig.ci.sim800_cmux @@ -16,3 +16,4 @@ CONFIG_COMPILER_CXX_EXCEPTIONS=y CONFIG_ESP_MAIN_TASK_STACK_SIZE=8192 CONFIG_EXAMPLE_CLOSE_CMUX_AT_END=y CONFIG_EXAMPLE_MQTT_TEST_TOPIC="/ci/esp-modem/pppos-client" +CONFIG_BROKER_URI="mqtt://mqtt.eclipseprojects.io"