Skip to content

[modem]: Extend tcp-client example #837

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/modem__build-host-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
strategy:
matrix:
idf_ver: ["release-v5.0", "release-v5.1", "release-v5.2", "release-v5.3", "release-v5.4", "latest"]
test: ["target", "target_ota", "target_iperf"]
test: ["target", "target_ota", "target_iperf", "target_urc"]

runs-on: ubuntu-22.04
container: espressif/idf:${{ matrix.idf_ver }}
Expand Down
28 changes: 28 additions & 0 deletions .github/workflows/modem_sim__build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: "modem_sim: build-tests"

on:
push:
branches:
- master
pull_request:
types: [opened, synchronize, reopened, labeled]

jobs:
build_modem_sim:
if: contains(github.event.pull_request.labels.*.name, 'modem_sim') || github.event_name == 'push'
name: Build
strategy:
matrix:
idf_ver: ["release-v5.4"]
runs-on: ubuntu-22.04
container: espressif/idf:${{ matrix.idf_ver }}
steps:
- name: Checkout esp-protocols
uses: actions/checkout@v3
- name: Build ESP-AT with IDF-${{ matrix.idf_ver }}
shell: bash
run: |
cd common_components/modem_sim
./install.sh
source export.sh
idf.py build
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ repos:
- repo: local
hooks:
- id: commit message scopes
name: "commit message must be scoped with: mdns, dns, modem, websocket, asio, mqtt_cxx, console, common, eppp, tls_cxx, mosq, sockutls, lws"
entry: '\A(?!(feat|fix|ci|bump|test|docs|chore)\((mdns|dns|modem|common|console|websocket|asio|mqtt_cxx|examples|eppp|tls_cxx|mosq|sockutls|lws)\)\:)'
name: "commit message must be scoped with: mdns, dns, modem, websocket, asio, mqtt_cxx, console, common, eppp, tls_cxx, mosq, sockutls, lws, modem_sim"
entry: '\A(?!(feat|fix|ci|bump|test|docs|chore)\((mdns|dns|modem|common|console|websocket|asio|mqtt_cxx|examples|eppp|tls_cxx|mosq|sockutls|lws|modem_sim)\)\:)'
language: pygrep
args: [--multiline]
stages: [commit-msg]
11 changes: 11 additions & 0 deletions common_components/modem_sim/export.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash

source $IDF_PATH/export.sh

export AT_CUSTOM_COMPONENTS="`pwd`/pppd_cmd"

cd modem_sim_esp32/esp-at

python -m pip install -r requirements.txt

python build.py reconfigure
59 changes: 59 additions & 0 deletions common_components/modem_sim/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
#!/bin/bash

# Create directory "modem_sim_esp32", go inside it
# Usage: ./install.sh [platform] [module]

SCRIPT_DIR=$(pwd)
mkdir -p modem_sim_esp32
cd modem_sim_esp32

# Shallow clone https://github.com/espressif/esp-at.git
if [ ! -d "esp-at" ]; then
git clone --depth 1 https://github.com/espressif/esp-at.git
else
echo "esp-at directory already exists, skipping clone."
fi

cd esp-at

# Add esp-idf directory which is a symlink to the $IDF_PATH
if [ -z "$IDF_PATH" ]; then
echo "Error: IDF_PATH environment variable is not set"
exit 1
fi

if [ ! -L "esp-idf" ]; then
ln -sf "$IDF_PATH" esp-idf
else
echo "esp-idf symlink already exists, skipping."
fi

# Create "build" directory
mkdir -p build

# Default values for platform and module
platform="PLATFORM_ESP32"
module="WROOM-32"

# Override defaults if parameters are provided
if [ ! -z "$1" ]; then
platform="$1"
fi
if [ ! -z "$2" ]; then
module="$2"
fi

# Create file "build/module_info.json" with content
cat > build/module_info.json << EOF
{
"platform": "$platform",
"module": "$module",
"description": "4MB, Wi-Fi + BLE, OTA, TX:17 RX:16",
"silence": 0
}
EOF

cp "$SCRIPT_DIR/sdkconfig.defaults" "module_config/module_esp32_default/sdkconfig.defaults"

echo "Installation completed successfully!"
echo "Created modem_sim_esp32 directory with esp-at repository and configuration"
14 changes: 14 additions & 0 deletions common_components/modem_sim/pppd_cmd/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@

file(GLOB_RECURSE srcs *.c)

set(includes "include")

# Add more required components you need here, separated by spaces
set(require_components at freertos nvs_flash)

idf_component_register(
SRCS ${srcs}
INCLUDE_DIRS ${includes}
REQUIRES ${require_components})

idf_component_set_property(${COMPONENT_NAME} WHOLE_ARCHIVE TRUE)
Loading
Loading