Skip to content
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

Remove Serial.print from the code #7

Merged
merged 2 commits into from
Mar 21, 2024
Merged
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
71 changes: 26 additions & 45 deletions .github/workflows/build_examples_platformio.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,63 +10,51 @@ concurrency:
jobs:
build:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, 'ci skip')"

strategy:
matrix:
example:
[
examples/BlynkClient,
examples/FileDownload,
examples/MqttClient,
examples/WebClient,
tools/test_build,
tools/Diagnostics,
]
modem:
[
modem: [
# LILYGO Boards
TINY_GSM_MODEM_A7608,
TINY_GSM_MODEM_A7670,
TINY_GSM_MODEM_SIM7000,
TINY_GSM_MODEM_SIM7000SSL,
TINY_GSM_MODEM_SIM7020,
TINY_GSM_MODEM_SIM7070,
TINY_GSM_MODEM_SIM7600,
TINY_GSM_MODEM_SIM7672,
# Other boards from original forks
TINY_GSM_MODEM_A6,
TINY_GSM_MODEM_BG96,
TINY_GSM_MODEM_ESP8266,
TINY_GSM_MODEM_M95,
TINY_GSM_MODEM_M590,
TINY_GSM_MODEM_MC60,
TINY_GSM_MODEM_SIM800,
TINY_GSM_MODEM_SIM808,
TINY_GSM_MODEM_SIM5360,
TINY_GSM_MODEM_SIM7600,
TINY_GSM_MODEM_SIM7000,
TINY_GSM_MODEM_SIM7000SSL,
TINY_GSM_MODEM_SIM7070,
TINY_GSM_MODEM_A7670,
TINY_GSM_MODEM_UBLOX,
TINY_GSM_MODEM_SARAR4,
TINY_GSM_MODEM_XBEE,
TINY_GSM_MODEM_SEQUANS_MONARCH,
# added in this fork
TINY_GSM_MODEM_A7608,
TINY_GSM_MODEM_A7670,
TINY_GSM_MODEM_SIM7020,
TINY_GSM_MODEM_SIM7672
# Disabled boards - not supported by Lilygo
# Tests are not passive with these
# TINY_GSM_MODEM_ESP8266,
]
example:
[
examples/BlynkClient/BlynkClient.ino,
examples/FileDownload/FileDownload.ino,
examples/MqttClient/MqttClient.ino,
examples/WebClient/WebClient.ino,
tools/test_build/test_build.ino,
tools/Diagnostics/Diagnostics.ino,
]

steps:
- uses: actions/checkout@v4

- name: Set variables
run: |
if [[ -z "${GITHUB_HEAD_REF}" ]]; then
echo "::debug::Push to commit ${GITHUB_SHA}"
echo "LIBRARY_INSTALL_SOURCE=https://github.com/${GITHUB_REPOSITORY}.git#${GITHUB_SHA}" >> $GITHUB_ENV
else
echo "::debug::Pull Request from the ${GITHUB_HEAD_REF} branch"
echo "LIBRARY_INSTALL_SOURCE=https://github.com/${GITHUB_REPOSITORY}.git#${GITHUB_HEAD_REF}" >> $GITHUB_ENV
fi

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
python-version: "3.x"

# This should be pulled from cache, if there's not a new version
- name: Install PlatformIO
Expand All @@ -86,16 +74,9 @@ jobs:

# Install cores and library dependencies for the Arduino CLI, iff no cache
- name: Install the Arduino libraries
if: steps.cache_pio.outputs.cache-hit != 'true'
run: pio lib --global install 89 415 1202 1286

- name: Run PlatformIO
env:
PLATFORMIO_CI_SRC: ${{ matrix.example }}
TINYGSM_MODEM_TO_USE: ${{ matrix.modem }}
run: |
echo "${{ env.LIBRARY_INSTALL_SOURCE }}"
pio lib --global install ${{ env.LIBRARY_INSTALL_SOURCE }}
sed -i 's/\/\/ #define TINY_GSM_MODEM_SIM800/#define TINY_GSM_MODEM_SIM800/g' ${{ matrix.example }}/*
platformio ci --project-option='build_flags=-D ${{ env.TINYGSM_MODEM_TO_USE }}' --project-option='framework=arduino' --board=esp32dev --board=esp32s3box
pio lib --global uninstall TinyGSM
sed -i 's/#define TINY_GSM_MODEM_SIM800/\/\/ #define TINY_GSM_MODEM_SIM800/g' "${{ matrix.example }}"
platformio ci "${{ matrix.example }}" -l '.' --project-option='build_flags=-D ${{ matrix.modem }}' --project-option='lib_deps=89, 415, 1202, 1286' --project-option='framework=arduino' --board=esp32dev --board=esp32s3box
5 changes: 5 additions & 0 deletions platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ build_flags =
; -D TINY_GSM_MODEM_A7608
-D TINY_GSM_MODEM_A7670
; -D TINY_GSM_MODEM_SIM7672
lib_deps=
89
415
1202
1286

[env:esp32dev]
platform = espressif32
Expand Down
8 changes: 5 additions & 3 deletions src/TinyGsmMqttA76xx.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ class TinyGsmMqttA76xx
thisModem().stream.write(this->cert_pem);
}
if (thisModem().waitResponse() != 1) {
Serial.println("Write ca_cert pem failed!");
ESP_LOGE("A76XX", "Write ca_cert pem failed!");
return false;
}
thisModem().sendAT("+CSSLCFG=\"cacert\",0,\"ca_cert.pem\"");
Expand All @@ -106,7 +106,8 @@ class TinyGsmMqttA76xx
thisModem().stream.write(this->client_cert_pem);
}
if (thisModem().waitResponse() != 1) {
Serial.println("Write cert pem failed!"); return false;
ESP_LOGE("A76XX", "Write cert pem failed!");
return false;
}
thisModem().sendAT("+CSSLCFG=\"clientcert\",0,\"cert.pem\"");
thisModem().waitResponse();
Expand All @@ -118,7 +119,8 @@ class TinyGsmMqttA76xx
thisModem().stream.write(this->client_key_pem);
}
if (thisModem().waitResponse() != 1) {
Serial.println("Write key_cert failed!"); return false;
ESP_LOGE("A76XX", "Write key_cert failed!");
return false;
}
thisModem().sendAT("+CSSLCFG=\"clientkey\",0,\"key_cert.pem\"");
thisModem().waitResponse();
Expand Down
2 changes: 1 addition & 1 deletion tools/Diagnostics/Diagnostics.ino
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ TinyGsm modem(debugger);
TinyGsm modem(SerialAT);
#endif

#ifdef USE_SSL&& defined TINY_GSM_MODEM_HAS_SSL
#ifdef USE_SSL && defined TINY_GSM_MODEM_HAS_SSL
TinyGsmClientSecure client(modem);
const int port = 443;
#else
Expand Down