Skip to content

Commit

Permalink
Merge pull request #502 from brentru/migrate-to-bsp-3
Browse files Browse the repository at this point in the history
Migrate from Arduino ESP32 Core 2.x to 3.x, IDF 5.1
  • Loading branch information
brentru authored Nov 21, 2023
2 parents 74aa016 + 62c7d1f commit 1922364
Show file tree
Hide file tree
Showing 64 changed files with 233 additions and 241 deletions.
75 changes: 70 additions & 5 deletions .github/workflows/build-clang-doxy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,20 +36,20 @@ jobs:
echo >>$GITHUB_ENV WS_VERSION=$(git describe --dirty --tags)
- uses: actions/checkout@v2
with:
repository: adafruit/ci-arduino
repository: brentru/ci-arduino
path: ci
- name: Install CI-Arduino
run: bash ci/actions_install.sh
- name: Install extra Arduino libraries
run: |
git clone --quiet https://github.com/milesburton/Arduino-Temperature-Control-Library.git /home/runner/Arduino/libraries/Arduino-Temperature-Control-Library
git clone --quiet https://github.com/PaulStoffregen/OneWire.git /home/runner/Arduino/libraries/OneWire
git clone --quiet https://github.com/pstolarz/OneWireNg.git /home/runner/Arduino/libraries/OneWireNg
git clone --quiet https://github.com/adafruit/Adafruit_HX8357_Library.git /home/runner/Arduino/libraries/Adafruit_HX8357_Library
git clone --quiet https://github.com/adafruit/Adafruit_ILI9341.git /home/runner/Arduino/libraries/Adafruit_ILI9341
git clone --quiet https://github.com/adafruit/Adafruit_STMPE610.git /home/runner/Arduino/libraries/Adafruit_STMPE610
git clone --quiet https://github.com/adafruit/Adafruit-ST7735-Library.git /home/runner/Arduino/libraries/Adafruit-ST7735-Library
git clone --quiet https://github.com/adafruit/Adafruit_TouchScreen.git /home/runner/Arduino/libraries/Adafruit_TouchScreen
git clone --depth 1 --branch v8.2.0 https://github.com/lvgl/lvgl.git /home/runner/Arduino/libraries/lvgl
git clone --depth 1 --branch wippersnapper https://github.com/brentru/lvgl.git /home/runner/Arduino/libraries/lvgl
git clone --depth 1 --branch development https://github.com/brentru/Adafruit_LvGL_Glue.git /home/runner/Arduino/libraries/Adafruit_LittlevGL_Glue_Library
- name: List all files in Adafruit_LittlevGL_Glue_Library folder
run: |
Expand Down Expand Up @@ -98,7 +98,7 @@ jobs:
echo >>$GITHUB_ENV WS_VERSION=$(git describe --dirty --tags)
- uses: actions/checkout@v2
with:
repository: adafruit/ci-arduino
repository: brentru/ci-arduino
path: ci
- name: Checkout Board Definitions
uses: actions/checkout@v2
Expand All @@ -110,12 +110,15 @@ jobs:
- name: Install extra Arduino libraries
run: |
git clone --quiet https://github.com/milesburton/Arduino-Temperature-Control-Library.git /home/runner/Arduino/libraries/Arduino-Temperature-Control-Library
git clone --quiet https://github.com/PaulStoffregen/OneWire.git /home/runner/Arduino/libraries/OneWire
git clone --quiet https://github.com/pstolarz/OneWireNg.git /home/runner/Arduino/libraries/OneWireNg
- name: Install Dependencies
run: |
pip3 install esptool
- name: build ESP32 platforms
run: python3 ci/build_platform.py ${{ matrix.arduino-platform }} --build_timeout 48000
- name: Check artifacts
run: |
ls examples/Wippersnapper_demo/build/*
- name: Rename build artifacts to reflect the platform name
run: |
mv examples/Wippersnapper_demo/build/*/Wippersnapper_demo.ino.bin wippersnapper.${{ matrix.arduino-platform }}.littlefs.${{ env.WS_VERSION }}.bin
Expand Down Expand Up @@ -329,6 +332,68 @@ jobs:
path: |
wippersnapper.${{ matrix.arduino-platform }}.littlefs.${{ env.WS_VERSION }}.zip
build-esp32sx-dev:
name: Build WipperSnapper ESP32-Sx DEV BUILDS
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
arduino-platform: ["feather_esp32s2_dev", "feather_esp32s2_tft_dev",
"feather_esp32s2_reverse_tft_dev", "feather_esp32s3_dev",
"feather_esp32s3_4mbflash_2mbpsram_dev", "feather_esp32s3_tft_dev",
"feather_esp32s3_reverse_tft_dev"]
steps:
- uses: actions/setup-python@v1
with:
python-version: '3.x'
- uses: actions/checkout@v2
- name: Get WipperSnapper version
run: |
git fetch --prune --unshallow --tags
git describe --dirty --tags
echo >>$GITHUB_ENV WS_VERSION=$(git describe --dirty --tags)
- uses: actions/checkout@v2
with:
repository: brentru/ci-arduino
path: ci
- name: Install CI-Arduino
run: bash ci/actions_install.sh
- name: Install extra Arduino libraries
run: |
git clone --quiet https://github.com/milesburton/Arduino-Temperature-Control-Library.git /home/runner/Arduino/libraries/Arduino-Temperature-Control-Library
git clone --quiet https://github.com/pstolarz/OneWireNg.git /home/runner/Arduino/libraries/OneWireNg
git clone --quiet https://github.com/adafruit/Adafruit_HX8357_Library.git /home/runner/Arduino/libraries/Adafruit_HX8357_Library
git clone --quiet https://github.com/adafruit/Adafruit_ILI9341.git /home/runner/Arduino/libraries/Adafruit_ILI9341
git clone --quiet https://github.com/adafruit/Adafruit_STMPE610.git /home/runner/Arduino/libraries/Adafruit_STMPE610
git clone --quiet https://github.com/adafruit/Adafruit-ST7735-Library.git /home/runner/Arduino/libraries/Adafruit-ST7735-Library
git clone --quiet https://github.com/adafruit/Adafruit_TouchScreen.git /home/runner/Arduino/libraries/Adafruit_TouchScreen
git clone --depth 1 --branch wippersnapper https://github.com/brentru/lvgl.git /home/runner/Arduino/libraries/lvgl
git clone --depth 1 --branch development https://github.com/brentru/Adafruit_LvGL_Glue.git /home/runner/Arduino/libraries/Adafruit_LittlevGL_Glue_Library
- name: List all files in Adafruit_LittlevGL_Glue_Library folder
run: |
ls /home/runner/Arduino/libraries/Adafruit_LittlevGL_Glue_Library
- name: Copy lv_conf.h file in Adafruit_LittlevGL_Glue_Library to the arduino library folder
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
- name: list
run: |
ls
ls examples/*/build/
- name: Rename build artifacts to reflect the platform name
run: |
mv examples/*/build/*/wippersnapper_debug.ino.uf2 wippersnapper.${{ matrix.arduino-platform }}.${{ env.WS_VERSION }}.uf2
mv examples/*/build/*/wippersnapper_debug.ino.bin wippersnapper.${{ matrix.arduino-platform }}.${{ env.WS_VERSION }}.bin
- name: upload build artifacts
uses: actions/upload-artifact@v3
with:
name: build-files-dev
path: |
wippersnapper.${{ matrix.arduino-platform }}.${{ env.WS_VERSION }}.uf2
wippersnapper.${{ matrix.arduino-platform }}.${{ env.WS_VERSION }}.bin
clang_and_doxy:
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Pre-compiled binaries and UF2 files for supported hardware are provided on the [

|Platform| MCU(s) |
|--|--|
|[ESP32](https://github.com/espressif/arduino-esp32)| ESP32, ESP32-S2, ESP32-S3, ESP32-C3 |
|[ESP32-x](https://github.com/espressif/arduino-esp32)| ESP32, ESP32-S2, ESP32-S3, ESP32-C3 |
|[ESP8266](https://github.com/esp8266/Arduino)| ESP8266 |
|[RP2040](https://github.com/earlephilhower/arduino-pico)| RP2040 MCU w/WiFi (i.e: Pico W) |
|[ATSAMD](https://github.com/adafruit/ArduinoCore-samd/)| SAMD51 MCU w/separate WiFi Co-Processor (i.e: Adafruit "AirLift")|
Expand Down
Binary file modified examples/Wippersnapper_NoFS/.DS_Store
Binary file not shown.
1 change: 1 addition & 0 deletions examples/Wippersnapper_NoFS/.feather_esp32s2_dev.test.skip
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

1 change: 1 addition & 0 deletions examples/Wippersnapper_NoFS/.feather_esp32s3_dev.test.skip
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

1 change: 1 addition & 0 deletions examples/Wippersnapper_demo/.feather_esp32s2_dev.test.skip
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

1 change: 1 addition & 0 deletions examples/Wippersnapper_demo/.feather_esp32s3_dev.test.skip
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

1 change: 1 addition & 0 deletions examples/wippersnapper_debug/.feather_esp32.test.skip
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

1 change: 1 addition & 0 deletions examples/wippersnapper_debug/.feather_esp32_v2.test.skip
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

1 change: 1 addition & 0 deletions examples/wippersnapper_debug/.feather_esp32s2.test.skip
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

1 change: 1 addition & 0 deletions examples/wippersnapper_debug/.feather_esp32s2_dev.generate
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

1 change: 1 addition & 0 deletions examples/wippersnapper_debug/.feather_esp32s3.test.skip
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

1 change: 1 addition & 0 deletions examples/wippersnapper_debug/.feather_esp32s3_dev.generate
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

1 change: 1 addition & 0 deletions examples/wippersnapper_debug/.feather_esp8266.test.skip
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

1 change: 1 addition & 0 deletions examples/wippersnapper_debug/.feather_s2_tinyusb.test.skip
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

2 changes: 2 additions & 0 deletions examples/wippersnapper_debug/.funhouse.test.skip
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@


1 change: 1 addition & 0 deletions examples/wippersnapper_debug/.magtag.test.skip
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@


1 change: 1 addition & 0 deletions examples/wippersnapper_debug/.metroesp32s2.test.skip
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

1 change: 1 addition & 0 deletions examples/wippersnapper_debug/.mkrwifi1010.test.skip
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

1 change: 1 addition & 0 deletions examples/wippersnapper_debug/.nano_33_iot.test.skip
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

3 changes: 3 additions & 0 deletions examples/wippersnapper_debug/.pyportal_tinyusb.test.skip
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@



1 change: 1 addition & 0 deletions examples/wippersnapper_debug/.qtpy_esp32.test.skip
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

1 change: 1 addition & 0 deletions examples/wippersnapper_debug/.qtpy_esp32c3.test.skip
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

1 change: 1 addition & 0 deletions examples/wippersnapper_debug/.qtpy_esp32s2.test.skip
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

1 change: 1 addition & 0 deletions examples/wippersnapper_debug/.qtpy_esp32s3.test.skip
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

1 change: 1 addition & 0 deletions examples/wippersnapper_debug/.qtpy_esp32s3_n4r2.test.skip
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

24 changes: 24 additions & 0 deletions examples/wippersnapper_debug/wippersnapper_debug.ino
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// Adafruit IO WipperSnapper Beta (DEBUG BUILD ONLY!)
// Brent Rubell for Adafruit Industries, 2021 - 2023

#include "Wippersnapper_Networking.h"
Wippersnapper_WiFi wipper;

// Enable debug output for beta builds
#define WS_DEBUG

void setup() {
// Provisioning must occur prior to serial init.
wipper.provision();

Serial.begin(115200); // wippersnapper serial
Serial1.begin(115200); // ESP-IDF messages serial
Serial1.setDebugOutput(true); // Enable ESP-IDF messages over Serial1
//while (!Serial) delay(10);

wipper.connect();
}

void loop() {
wipper.run();
}
6 changes: 3 additions & 3 deletions library.properties
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name=Adafruit WipperSnapper
version=1.0.0-beta.73
version=1.0.0-alpha.74
author=Adafruit
maintainer=Adafruit <[email protected]>
sentence=Arduino client for Adafruit.io WipperSnapper
paragraph=Arduino client for Adafruit.io WipperSnapper
sentence=Arduino application for Adafruit.io WipperSnapper
paragraph=Arduino application for Adafruit.io WipperSnapper
category=Communication
url=https://github.com/adafruit/Adafruit_IO_Arduino
architectures=*
Expand Down
2 changes: 1 addition & 1 deletion src/Wippersnapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1210,7 +1210,7 @@ bool cbPWMDecodeMsg(pb_istream_t *stream, const pb_field_t *field, void **arg) {

#ifdef USE_DISPLAY
char buffer[100];
snprintf(buffer, 100, "[PWM] Writing %u Hz to pin %s\n.",
snprintf(buffer, 100, "[PWM] Writing %ld Hz to pin %s\n.",
msgPWMWriteFreqRequest.frequency, msgPWMWriteFreqRequest.pin);
WS._ui_helper->add_text_to_terminal(buffer);
#endif
Expand Down
4 changes: 2 additions & 2 deletions src/Wippersnapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* please support Adafruit and open-source hardware by purchasing
* products from Adafruit!
*
* Copyright (c) Brent Rubell 2020-2022 for Adafruit Industries.
* Copyright (c) Brent Rubell 2020-2023 for Adafruit Industries.
*
* BSD license, all text here must be included in any redistribution.
*
Expand Down Expand Up @@ -71,7 +71,7 @@
#endif

#define WS_VERSION \
"1.0.0-beta.73" ///< WipperSnapper app. version (semver-formatted)
"1.0.0-alpha.74" ///< WipperSnapper app. version (semver-formatted)

// Reserved Adafruit IO MQTT topics
#define TOPIC_IO_THROTTLE "/throttle" ///< Adafruit IO Throttle MQTT Topic
Expand Down
55 changes: 30 additions & 25 deletions src/components/i2c/WipperSnapper_I2C.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -816,65 +816,70 @@ void WipperSnapper_Component_I2C::displayDeviceEventMessage(
msgi2cResponse->payload.resp_i2c_device_event.sensor_event[i].type) {
case wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_AMBIENT_TEMPERATURE:
case wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_OBJECT_TEMPERATURE:
snprintf(buffer, 100, "[I2C: %#x] Read: %0.3f *C\n", sensorAddress,
value);
snprintf(buffer, 100, "[I2C: %#x] Read: %0.3f *C\n",
(unsigned int)sensorAddress, value);
break;
case wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_AMBIENT_TEMPERATURE_FAHRENHEIT:
case wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_OBJECT_TEMPERATURE_FAHRENHEIT:
snprintf(buffer, 100, "[I2C: %#x] Read: %0.3f *F\n", sensorAddress,
value);
snprintf(buffer, 100, "[I2C: %#x] Read: %0.3f *F\n",
(unsigned int)sensorAddress, value);
break;
case wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_RELATIVE_HUMIDITY:
snprintf(buffer, 100, "[I2C: %#x] Read: %0.3f %% rh\n", sensorAddress,
value);
snprintf(buffer, 100, "[I2C: %#x] Read: %0.3f %% rh\n",
(unsigned int)sensorAddress, value);
break;
case wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_PRESSURE:
snprintf(buffer, 100, "[I2C: %#x] Read: %0.3f hPA\n", sensorAddress,
value);
snprintf(buffer, 100, "[I2C: %#x] Read: %0.3f hPA\n",
(unsigned int)sensorAddress, value);
break;
case wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_ALTITUDE:
snprintf(buffer, 100, "[I2C: %x] Read: %0.3f m\n", sensorAddress, value);
snprintf(buffer, 100, "[I2C: %x] Read: %0.3f m\n",
(unsigned int)sensorAddress, value);
break;
case wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_LIGHT:
snprintf(buffer, 100, "[I2C: %x] Read: %0.3f lux\n", sensorAddress,
value);
snprintf(buffer, 100, "[I2C: %x] Read: %0.3f lux\n",
(unsigned int)sensorAddress, value);
break;
case wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_PM10_STD:
case wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_PM25_STD:
case wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_PM100_STD:
case wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_CO2:
case wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_ECO2:
snprintf(buffer, 100, "[I2C: %x] Read: %0.3f ppm\n", sensorAddress,
value);
snprintf(buffer, 100, "[I2C: %x] Read: %0.3f ppm\n",
(unsigned int)sensorAddress, value);
break;
case wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_TVOC:
snprintf(buffer, 100, "[I2C: %x] Read: %0.3f ppb\n", sensorAddress,
value);
snprintf(buffer, 100, "[I2C: %x] Read: %0.3f ppb\n",
(unsigned int)sensorAddress, value);
break;
case wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_UNITLESS_PERCENT:
snprintf(buffer, 100, "[I2C: %x] Read: %0.3f%%\n", sensorAddress, value);
snprintf(buffer, 100, "[I2C: %x] Read: %0.3f%%\n",
(unsigned int)sensorAddress, value);
break;
case wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_VOLTAGE:
snprintf(buffer, 100, "[I2C: %x] Read: %0.3f V\n", sensorAddress, value);
snprintf(buffer, 100, "[I2C: %x] Read: %0.3f V\n",
(unsigned int)sensorAddress, value);
break;
case wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_CURRENT:
snprintf(buffer, 100, "[I2C: %x] Read: %0.3f mA\n", sensorAddress, value);
snprintf(buffer, 100, "[I2C: %x] Read: %0.3f mA\n",
(unsigned int)sensorAddress, value);
break;
case wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_RAW:
case wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_PROXIMITY:
snprintf(buffer, 100, "[I2C: %x] Read: %0.3f\n", sensorAddress, value);
snprintf(buffer, 100, "[I2C: %x] Read: %0.3f\n",
(unsigned int)sensorAddress, value);
break;
case wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_GAS_RESISTANCE:
snprintf(buffer, 100, "[I2C: %x] Read: %0.3f Ohms\n", sensorAddress,
value);
snprintf(buffer, 100, "[I2C: %x] Read: %0.3f Ohms\n",
(unsigned int)sensorAddress, value);
break;
case wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_NOX_INDEX:
snprintf(buffer, 100, "[I2C: %x] Read: %0.3f NOX\n", sensorAddress,
value);
snprintf(buffer, 100, "[I2C: %x] Read: %0.3f NOX\n",
(unsigned int)sensorAddress, value);
break;
case wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_VOC_INDEX:
snprintf(buffer, 100, "[I2C: %x] Read: %0.3f VOC\n", sensorAddress,
value);
snprintf(buffer, 100, "[I2C: %x] Read: %0.3f VOC\n",
(unsigned int)sensorAddress, value);
break;
default:
break;
Expand Down
Loading

0 comments on commit 1922364

Please sign in to comment.