Compare commits

..

6 Commits

Author SHA1 Message Date
f42c0adfc0 Merge pull request #494 from david-cermak/bump/modem_v1.1
bump(modem): 1.0.5 -> 1.1.0
2024-01-22 17:08:55 +01:00
2782277f3f bump(modem): 1.0.5 -> 1.1.0
1.1.0
Features
- Added support for at_raw() command (ae38110, #471)
- Added iperf test for PPP netifs (976e98d)
- Added test that performs OTA to exercise modem layers (f2223dd)
Bug Fixes
- Fixed OTA test to gracefully fail with no verification (1dc4299)
- Added C-API to configure APN (ce7dadd, #485)
- Fixed AT commands to copy strings to prevent overrides (741d166, #463)
- Fixed incorrect dial command format (0998f3d, #433)
- Fixed documentation and example on creating custom device (577de67, #452)
- Removed CI jobs for IDF v4.2 (d88cd61)
- Fixed OAT test to verify server cert and CN (edc3e72)
- Fixed set_pdp_context() command timeout (1d80cbc, #455)
Updated
- docs(modem): Added description of manual test procedure (68ce794)
2024-01-22 16:33:07 +01:00
3225f40c22 Merge pull request #491 from david-cermak/feat/modem_set_apn
fix(modem): Added C-API to configure APN
2024-01-22 16:05:51 +01:00
68ce794098 docs(modem): Added description of manual test procedure 2024-01-19 11:16:18 +01:00
1dc4299eb0 fix(modem): Fixed OTA test to gracefully fail with no verification 2024-01-17 17:43:47 +01:00
ce7daddc77 fix(modem): Added C-API to configure APN
Closes https://github.com/espressif/esp-protocols/issues/485
2024-01-17 14:30:05 +01:00
8 changed files with 104 additions and 4 deletions

View File

@ -3,6 +3,6 @@ commitizen:
bump_message: 'bump(modem): $current_version -> $new_version'
pre_bump_hooks: python ../../ci/changelog.py esp_modem
tag_format: modem-v$version
version: 1.0.5
version: 1.1.0
version_files:
- idf_component.yml

View File

@ -1,5 +1,28 @@
# Changelog
## [1.1.0](https://github.com/espressif/esp-protocols/commits/modem-v1.1.0)
### Features
- Added support for at_raw() command ([ae38110](https://github.com/espressif/esp-protocols/commit/ae38110), [#471](https://github.com/espressif/esp-protocols/issues/471))
- Added iperf test for PPP netifs ([976e98d](https://github.com/espressif/esp-protocols/commit/976e98d))
- Added test that performs OTA to exercise modem layers ([f2223dd](https://github.com/espressif/esp-protocols/commit/f2223dd))
### Bug Fixes
- Fixed OTA test to gracefully fail with no verification ([1dc4299](https://github.com/espressif/esp-protocols/commit/1dc4299))
- Added C-API to configure APN ([ce7dadd](https://github.com/espressif/esp-protocols/commit/ce7dadd), [#485](https://github.com/espressif/esp-protocols/issues/485))
- Fixed AT commands to copy strings to prevent overrides ([741d166](https://github.com/espressif/esp-protocols/commit/741d166), [#463](https://github.com/espressif/esp-protocols/issues/463))
- Fixed incorrect dial command format ([0998f3d](https://github.com/espressif/esp-protocols/commit/0998f3d), [#433](https://github.com/espressif/esp-protocols/issues/433))
- Fixed documentation and example on creating custom device ([577de67](https://github.com/espressif/esp-protocols/commit/577de67), [#452](https://github.com/espressif/esp-protocols/issues/452))
- Removed CI jobs for IDF v4.2 ([d88cd61](https://github.com/espressif/esp-protocols/commit/d88cd61))
- Fixed OAT test to verify server cert and CN ([edc3e72](https://github.com/espressif/esp-protocols/commit/edc3e72))
- Fixed set_pdp_context() command timeout ([1d80cbc](https://github.com/espressif/esp-protocols/commit/1d80cbc), [#455](https://github.com/espressif/esp-protocols/issues/455))
### Updated
- docs(modem): Added description of manual test procedure ([68ce794](https://github.com/espressif/esp-protocols/commit/68ce794))
## [1.0.5](https://github.com/espressif/esp-protocols/commits/modem-v1.0.5)
### Major changes

View File

@ -1,4 +1,4 @@
version: "1.0.5"
version: "1.1.0"
description: Library for communicating with cellular modems in command and data modes
url: https://github.com/espressif/esp-protocols/tree/master/components/esp_modem
issues: https://github.com/espressif/esp-protocols/issues

View File

@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2021-2024 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@ -119,8 +119,27 @@ esp_err_t esp_modem_set_error_cb(esp_modem_dce_t *dce, esp_modem_terminal_error_
*/
esp_err_t esp_modem_set_mode(esp_modem_dce_t *dce, esp_modem_dce_mode_t mode);
/**
* @brief Convenient function to run arbitrary commands from C-API
*
* @param dce Modem DCE handle
* @param command Command to send
* @param got_line_cb Callback function which is called whenever we receive a line
* @param timeout_ms Command timeout
* @return ESP_OK on success, ESP_FAIL on failure
*/
esp_err_t esp_modem_command(esp_modem_dce_t *dce, const char *command, esp_err_t(*got_line_cb)(uint8_t *data, size_t len), uint32_t timeout_ms);
/**
* @brief Sets the APN and configures it into the modem's PDP context
*
* @param dce Modem DCE handle
* @param apn Access Point Name
* @return ESP_OK on success
*/
esp_err_t esp_modem_set_apn(esp_modem_dce_t *dce, const char *apn);
/**
* @}
*/

View File

@ -448,3 +448,10 @@ extern "C" esp_err_t esp_modem_set_baud(esp_modem_dce_t *dce_wrap, int baud)
{
return command_response_to_esp_err(dce_wrap->dce->set_baud(baud));
}
extern "C" esp_err_t esp_modem_set_apn(esp_modem_dce_t *dce_wrap, const char *apn)
{
auto new_pdp = std::unique_ptr<PdpContext>(new PdpContext(apn));
dce_wrap->dce->get_module()->configure_pdp_context(std::move(new_pdp));
return ESP_OK;
}

View File

@ -0,0 +1,47 @@
# ESP-Modem Testing
This folder contains automated and manual tests for esp-modem component. Beside these tests, some jobs are executed in CI to exercise standard examples (please refer to the CI definition and CI related sdkconfigs in examples).
List of test projects:
* `host_test` -- esp_modem is build on host (linux), modem's terminal in mocked using Loobpack class which creates simple responders to AT and CMUX mode. This test is executed in CI.
* `target` -- test executed on target with no modem device, just a pppd running on the test runner. This test is executed in CI.
* `target_ota` -- Manual test which perform OTA over PPP.
* `target_iperf` -- Manual test to measure data throughput via PPP.
## Manual testing
Prior to every `esp_modem` release, these manual tests must be executed and pass
(IDF-9074 to move the manual tests to CI)
### `target_ota`
Make sure that the UART ISR is not in IRAM, so the error messages are expected in the log, but the ESP32 should recover and continue with downloading the image.
Perform the test for these devices
* SIM7600 (CMUX mode)
* BG96 (CMUX mode)
* SIM7000 (PPP mode)
* A7672 (CMUX mode -- the only device with 2 byte CMUX payload), so the test is expected to fail more often if (`CONFIG_ESP_MODEM_CMUX_DEFRAGMENT_PAYLOAD=y` && `CONFIG_ESP_MODEM_USE_INFLATABLE_BUFFER_IF_NEEDED=n` && dte_buffer < device max payload)
* NetworkDCE -- no modem device, pppd (PPP mode)
Perform the test with these configurations:
* CONFIG_TEST_USE_VFS_TERM (y/n)
* CONFIG_ESP_HTTP_CLIENT_ENABLE_CUSTOM_TRANSPORT (y/n)
* CONFIG_ESP_MODEM_CMUX_DEFRAGMENT_PAYLOAD (y/n)
* CONFIG_ESP_MODEM_USE_INFLATABLE_BUFFER_IF_NEEDED (y/n)
**Criteria for passing the test**
The test should complete the download with maximum 1 retry (50% of OTA failure)
In case of CMUX mode, we're trying to exit CMUX at the end of the test. This step might also fail for some devices, as the CMUX-exit is not supported on certain devices (when the final error message appears that the device failed to exit CMUX, we just verify the new image by reseting the ESP32)
### `target_iperf`
Run these 4 `iperf` configurations (either manually or using `pytest`):
* tcp_tx_throughput
* tcp_rx_throughput
* udp_tx_throughput
* udp_rx_throughput
And verify in all four cases the value is about 0.70 Mbps

View File

@ -35,6 +35,10 @@ bool manual_ota::begin()
esp_transport_handle_t tcp = esp_transport_tcp_init();
ssl_ = esp_transport_batch_tls_init(tcp, max_buffer_size_);
http_.config_.transport = ssl_;
if (http_.config_.cert_pem == nullptr || common_name_ == nullptr) {
ESP_LOGE(TAG, "TLS with no verification is not supported");
return fail();
}
if (!esp_transport_batch_set_ca_cert(ssl_, http_.config_.cert_pem, 0)) {
return fail();
}

View File

@ -40,7 +40,7 @@ public:
/**
* @brief Set common name of the server to verify
*/
const char *common_name_;
const char *common_name_{};
/**
* @brief Wrapper around the http client -- Please set the http config
*/