Skip to content

Commit

Permalink
Merge pull request #654 from adafruit/qtpy-test-dbm
Browse files Browse the repository at this point in the history
Reduce connection errors on QT Py ESP32-Sx due to 3D Antennas
  • Loading branch information
brentru authored Oct 24, 2024
2 parents 63b812b + 6a2f67a commit 270344d
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 23 deletions.
45 changes: 23 additions & 22 deletions .github/workflows/build-clang-doxy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ jobs:
echo >>$GITHUB_ENV WS_VERSION=$(git describe --dirty --tags)
- uses: actions/checkout@v4
with:
repository: tyeth/ci-arduino
ref: WS_ARDUINO_598-preprocessor-script-for-printing-the-library-versions-to-boot_outtxt
repository: adafruit/ci-arduino
ref: ci-wippersnapper
path: ci
- name: Checkout Board Definitions
uses: actions/checkout@v4
Expand Down Expand Up @@ -73,7 +73,7 @@ jobs:
run: |
pip3 install esptool
- name: Build for ESP32-SX (esptool)
run: python3 ci/build_platform.py ${{ matrix.arduino-platform }} --build_timeout 48000 --include_print_dependencies_header ./src/print_dependencies.h
run: python3 ci/build_platform.py ${{ matrix.arduino-platform }} --build_timeout 48000
- name: list files
run: |
ls -Rla examples/
Expand Down Expand Up @@ -183,8 +183,8 @@ jobs:
echo >>$GITHUB_ENV WS_VERSION=$(git describe --dirty --tags)
- uses: actions/checkout@v4
with:
repository: tyeth/ci-arduino
ref: WS_ARDUINO_598-preprocessor-script-for-printing-the-library-versions-to-boot_outtxt
repository: adafruit/ci-arduino
ref: ci-wippersnapper
path: ci
- name: Install CI-Arduino
run: bash ci/actions_install.sh
Expand Down Expand Up @@ -216,7 +216,7 @@ jobs:
cp /home/runner/Arduino/libraries/Adafruit_LittlevGL_Glue_Library/lv_conf.h /home/runner/Arduino/libraries
- name: Build for ESP32-SX
run: |
python3 ci/build_platform.py ${{ matrix.arduino-platform }} --build_timeout 48000 --include_print_dependencies_header ./src/print_dependencies.h
python3 ci/build_platform.py ${{ matrix.arduino-platform }} --build_timeout 48000
- name: list files (tree)
run: |
tree
Expand Down Expand Up @@ -374,8 +374,8 @@ jobs:
echo >>$GITHUB_ENV WS_VERSION=$(git describe --dirty --tags)
- uses: actions/checkout@v4
with:
repository: tyeth/ci-arduino
ref: WS_ARDUINO_598-preprocessor-script-for-printing-the-library-versions-to-boot_outtxt
repository: adafruit/ci-arduino
ref: ci-wippersnapper
path: ci
- name: Install CI-Arduino
run: bash ci/actions_install.sh
Expand All @@ -395,7 +395,7 @@ jobs:
cp nanopb/pb_common.* nanopb/pb_encode.* nanopb/pb_decode.* src/nanopb
mv nanopb/pb.h src/nanopb/nanopb.pb.h
- name: build SAMD platforms
run: python3 ci/build_platform.py ${{ matrix.arduino-platform }} --build_timeout 48000 --include_print_dependencies_header ./src/print_dependencies.h
run: python3 ci/build_platform.py ${{ matrix.arduino-platform }} --build_timeout 48000
- name: Rename build artifacts to reflect the platform name
run: |
mv examples/*/build/*/Wippersnapper_demo.ino.uf2 wippersnapper.${{ matrix.arduino-platform }}.${{ env.WS_VERSION }}.uf2
Expand Down Expand Up @@ -427,8 +427,8 @@ jobs:
echo >>$GITHUB_ENV WS_VERSION=$(git describe --dirty --tags)
- uses: actions/checkout@v4
with:
repository: tyeth/ci-arduino
ref: WS_ARDUINO_598-preprocessor-script-for-printing-the-library-versions-to-boot_outtxt
repository: adafruit/ci-arduino
ref: ci-wippersnapper
path: ci
- name: Install CI-Arduino
run: bash ci/actions_install.sh
Expand All @@ -447,7 +447,7 @@ jobs:
cp nanopb/pb_common.* nanopb/pb_encode.* nanopb/pb_decode.* src/nanopb
mv nanopb/pb.h src/nanopb/nanopb.pb.h
- name: build RP2040 platforms
run: python3 ci/build_platform.py ${{ matrix.arduino-platform }} --build_timeout 48000 --include_print_dependencies_header ./src/print_dependencies.h
run: python3 ci/build_platform.py ${{ matrix.arduino-platform }} --build_timeout 48000
- name: Rename build artifacts to reflect the platform name
run: |
mv examples/*/build/*/Wippersnapper_demo.ino.uf2 wippersnapper.${{ matrix.arduino-platform }}.${{ env.WS_VERSION }}.uf2
Expand Down Expand Up @@ -478,8 +478,8 @@ jobs:
echo >>$GITHUB_ENV WS_VERSION=$(git describe --dirty --tags)
- uses: actions/checkout@v4
with:
repository: tyeth/ci-arduino
ref: WS_ARDUINO_598-preprocessor-script-for-printing-the-library-versions-to-boot_outtxt
repository: adafruit/ci-arduino
ref: ci-wippersnapper
path: ci
- name: Install CI-Arduino
run: bash ci/actions_install.sh
Expand All @@ -498,7 +498,7 @@ jobs:
cp nanopb/pb_common.* nanopb/pb_encode.* nanopb/pb_decode.* src/nanopb
mv nanopb/pb.h src/nanopb/nanopb.pb.h
- name: build SAMD (no-FS) platforms
run: python3 ci/build_platform.py ${{ matrix.arduino-platform }} --build_timeout 48000 --include_print_dependencies_header ./src/print_dependencies.h
run: python3 ci/build_platform.py ${{ matrix.arduino-platform }} --build_timeout 48000

build-esp8266:
name: 🏗️ESP8266
Expand All @@ -519,8 +519,8 @@ jobs:
echo >>$GITHUB_ENV WS_VERSION=$(git describe --dirty --tags)
- uses: actions/checkout@v4
with:
repository: tyeth/ci-arduino
ref: WS_ARDUINO_598-preprocessor-script-for-printing-the-library-versions-to-boot_outtxt
repository: adafruit/ci-arduino
ref: ci-wippersnapper
path: ci
- name: Install CI-Arduino
run: bash ci/actions_install.sh
Expand All @@ -537,7 +537,7 @@ jobs:
cp nanopb/pb_common.* nanopb/pb_encode.* nanopb/pb_decode.* src/nanopb
mv nanopb/pb.h src/nanopb/nanopb.pb.h
- name: build ESP8266 platforms
run: python3 ci/build_platform.py ${{ matrix.arduino-platform }} --build_timeout 48000 --include_print_dependencies_header ./src/print_dependencies.h
run: python3 ci/build_platform.py ${{ matrix.arduino-platform }} --build_timeout 48000
- name: list build artifacts
run: |
ls
Expand Down Expand Up @@ -586,8 +586,8 @@ jobs:
echo >>$GITHUB_ENV WS_VERSION=$(git describe --dirty --tags)
- uses: actions/checkout@v4
with:
repository: tyeth/ci-arduino
ref: WS_ARDUINO_598-preprocessor-script-for-printing-the-library-versions-to-boot_outtxt
repository: adafruit/ci-arduino
ref: ci-wippersnapper
path: ci
- name: Install CI-Arduino
run: bash ci/actions_install.sh
Expand Down Expand Up @@ -618,7 +618,7 @@ jobs:
run: |
cp /home/runner/Arduino/libraries/Adafruit_LittlevGL_Glue_Library/lv_conf.h /home/runner/Arduino/libraries
- name: Build for ESP32-SX
run: python3 ci/build_platform.py ${{ matrix.arduino-platform }} --build_timeout 48000 --include_print_dependencies_header ./src/print_dependencies.h
run: python3 ci/build_platform.py ${{ matrix.arduino-platform }} --build_timeout 48000
- name: list
run: |
ls
Expand Down Expand Up @@ -662,8 +662,8 @@ jobs:
- uses: actions/checkout@v4
with:
repository: adafruit/ci-arduino
path: ci
ref: ci-wippersnapper
path: ci
- name: Checkout Board Definitions
uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -795,6 +795,7 @@ jobs:
- uses: actions/checkout@v4
with:
repository: adafruit/ci-arduino
ref: ci-wippersnapper
path: ci
- name: pre-install
run: bash ci/actions_install.sh
Expand Down
3 changes: 2 additions & 1 deletion platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ lib_deps =

; Common build environment for ESP32 platform
[common:esp32]
platform = https://github.com/pioarduino/platform-espressif32/releases/download/51.03.05/platform-espressif32.zip
platform = https://github.com/pioarduino/platform-espressif32/releases/download/51.03.07/platform-espressif32.zip
; This is needed for occasional new features and bug fixes
; platform = https://github.com/pioarduino/platform-espressif32#develop
lib_ignore = WiFiNINA, WiFi101, OneWire
Expand Down Expand Up @@ -340,6 +340,7 @@ extra_scripts = pre:rename_usb_config.py
extends = common:esp32
board = adafruit_qtpy_esp32s3_nopsram
build_flags = -DARDUINO_ADAFRUIT_QTPY_ESP32S3_NOPSRAM
board_build.partitions = tinyuf2-partitions-4MB.csv
extra_scripts = pre:rename_usb_config.py

; Adafruit QT Py ESP32-S3 with PSRAM
Expand Down
10 changes: 10 additions & 0 deletions src/network_interfaces/Wippersnapper_ESP32.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,16 @@ class Wippersnapper_ESP32 : public Wippersnapper {
WiFi.disconnect();
delay(100);

// For boards with a "3D Antenna", we need to reduce the TX power
// to prevent flaky operation.
// NOTE: This is a known issue with the QT Py series of boards.
#ifdef ARDUINO_ADAFRUIT_QTPY_ESP32S2 || \
ARDUINO_ADAFRUIT_QTPY_ESP32S3_NOPSRAM || \
ARDUINO_ADAFRUIT_QTPY_ESP32S3_N4R2 || ARDUINO_ADAFRUIT_QTPY_ESP32C3 || \
ARDUINO_ADAFRUIT_QTPY_ESP32_PICO
WiFi.setTxPower(WIFI_POWER_15dBm);
#endif

// Perform a network scan
int n = WiFi.scanNetworks();
if (n == 0) {
Expand Down

0 comments on commit 270344d

Please sign in to comment.