Merge pull request #909 from t-huyeng/build-workflow

Build workflow for S3-usb-stick boards
This commit is contained in:
Verkehrsrot 2022-11-04 17:47:32 +01:00 committed by GitHub
commit 41cf44de14
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 183 additions and 16 deletions

View File

@ -14,17 +14,10 @@ jobs:
fail-fast: false fail-fast: false
matrix: matrix:
os: [ubuntu-latest] os: [ubuntu-latest]
# os: [ubuntu-latest, windows-latest, macos-latest]
include: include:
- os: ubuntu-latest - os: ubuntu-latest
path: ~/.cache/pip path: ~/.cache/pip
platformio-path: ~/.platformio platformio-path: ~/.platformio
# - os: macos-latest
# path: ~/Library/Caches/pip
# platformio-path: ~/Library/Caches/platformio
# - os: windows-latest
# path: ~\AppData\Local\pip\Cache
# platformio-path: ~\AppData\Local\platformio\Cache
board: board:
[ [
generic.h, generic.h,
@ -94,3 +87,50 @@ jobs:
env: env:
CI_HALFILE: ${{ matrix.board }} CI_HALFILE: ${{ matrix.board }}
run: pio run -e ci run: pio run -e ci
build-s3-usb-stick:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
include:
- os: ubuntu-latest
path: ~/.cache/pip
platformio-path: ~/.platformio
board: [ttgotdongles3.h, ttgotdongledisplays3.h]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Cache pip
uses: actions/cache@v3
with:
path: ${{ matrix.path }}
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Cache PlatformIO
uses: actions/cache@v3
with:
path: ${{ matrix.platformio-path }}
key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }}
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.9.13"
- name: Install PlatformIO
run: |
python -m pip install --upgrade pip
pip install --upgrade platformio
- name: Copy of necessary files
run: |
cp platformio_orig_s3-usb-stick.ini platformio.ini
cp src/loraconf_sample.h src/loraconf.h
cp src/ota_sample.conf src/ota.conf
cp src/paxcounter_orig.conf src/paxcounter.conf
- name: Clean
run: pio run -t clean -e ci
- name: Run PlatformIO CI for ${{ matrix.board }}
env:
CI_HALFILE: ${{ matrix.board }}
run: pio run -e ci

View File

@ -86,6 +86,10 @@ extern BB_SPI_LCD *dp;
#define MY_DISPLAY_HEIGHT 64 // Height in pixels of OLED-display, must be 64X #define MY_DISPLAY_HEIGHT 64 // Height in pixels of OLED-display, must be 64X
#endif #endif
#ifndef MY_DISPLAY_FIRSTLINE
#define MY_DISPLAY_FIRSTLINE 0
#endif
// settings for qr code generator // settings for qr code generator
#define QR_VERSION 3 // 29 x 29px #define QR_VERSION 3 // 29 x 29px

View File

@ -4,6 +4,15 @@
#include <Arduino.h> #include <Arduino.h>
#include <Wire.h> #include <Wire.h>
#include <BitBang_I2C.h> #include <BitBang_I2C.h>
#include <Wire.h>
#ifndef MY_DISPLAY_SDA
#define MY_DISPLAY_SDA SDA
#endif
#ifndef MY_DISPLAY_SCL
#define MY_DISPLAY_SCL SCL
#endif
#define SSD1306_PRIMARY_ADDRESS (0x3D) #define SSD1306_PRIMARY_ADDRESS (0x3D)
#define SSD1306_SECONDARY_ADDRESS (0x3C) #define SSD1306_SECONDARY_ADDRESS (0x3C)
@ -14,14 +23,6 @@
#define MCP_24AA02E64_PRIMARY_ADDRESS (0x50) #define MCP_24AA02E64_PRIMARY_ADDRESS (0x50)
#define QUECTEL_GPS_PRIMARY_ADDRESS (0x10) #define QUECTEL_GPS_PRIMARY_ADDRESS (0x10)
#ifndef MY_DISPLAY_SDA
#define MY_DISPLAY_SDA SDA
#endif
#ifndef MY_DISPLAY_SCL
#define MY_DISPLAY_SCL SCL
#endif
extern SemaphoreHandle_t I2Caccess; extern SemaphoreHandle_t I2Caccess;
void i2c_init(void); void i2c_init(void);

View File

@ -0,0 +1,70 @@
[board]
halfile = ttgotdongles3.h
;halfile = ttgotdongledisplays3.h
[platformio]
; upload firmware to board with usb cable
default_envs = usb
description = Paxcounter is a device for metering passenger flows in realtime. It counts how many mobile devices are around.
[common]
; for release_version use max. 10 chars total, use any decimal format like "a.b.c"
release_version = 3.3.2
; DEBUG LEVEL: For production run set to 0, otherwise device will leak RAM while running!
; 0=None, 1=Error, 2=Warn, 3=Info, 4=Debug, 5=Verbose
debug_level = 5
extra_scripts = pre:build.py
otakeyfile = ota.conf
lorakeyfile = loraconf.h
lmicconfigfile = lmic_config.h
platform_espressif32 = espressif32@5.2.0
monitor_speed = 115200
upload_speed = 115200 ; set by build.py and taken from hal file
lib_deps_all =
bitbank2/BitBang_I2C@^2.2.1
https://github.com/bitbank2/bb_spi_lcd.git
fastled/FastLED @ ^3.5.0
;greyrook/libpax @ ^1.0.1
https://github.com/cyberman54/libpax.git
https://github.com/SukkoPera/Arduino-Rokkit-Hash.git
bblanchon/ArduinoJson @ ^6
spacehuhn/SimpleButton
256dpi/MQTT @ ^2.5.0
ricmoo/QRCode @ ^0.0.1
build_flags_basic =
-include "src/paxcounter.conf"
'-DCORE_DEBUG_LEVEL=${common.debug_level}'
'-DLOG_LOCAL_LEVEL=${common.debug_level}'
'-DPROGVERSION="${common.release_version}"'
'-D LIBPAX_WIFI'
'-D LIBPAX_BLE'
'-D LIBPAX_ARDUINO'
build_flags_all =
${common.build_flags_basic}
-mfix-esp32-psram-cache-issue
[env]
framework = arduino
board = esp32-s3-devkitc-1
board_build.partitions = min_spiffs.csv
build_type = release
upload_speed = ${common.upload_speed}
;upload_port = COM6
platform = ${common.platform_espressif32}
lib_deps = ${common.lib_deps_all}
build_flags =
-include "src/hal/${board.halfile}"
${common.build_flags_all}
upload_protocol = ${common.upload_protocol}
extra_scripts = ${common.extra_scripts}
monitor_speed = ${common.monitor_speed}
monitor_filters = time, esp32_exception_decoder, default
[env:usb]
upload_protocol = esptool
[env:ci]
build_flags =
-include "src/hal/${sysenv.CI_HALFILE}" ; set by CI
${common.build_flags_all}
upload_protocol = esptool

View File

@ -1,6 +1,6 @@
// clang-format off // clang-format off
// upload_speed 1500000 // upload_speed 1500000
// board ESP32-S3-DevKitC-1 // board esp32-s3-devkitc-1
#ifndef _TTGOTDISPLAYS3_H #ifndef _TTGOTDISPLAYS3_H
#define _TTGOTDISPLAYS3_H #define _TTGOTDISPLAYS3_H

View File

@ -0,0 +1,31 @@
// clang-format off
// upload_speed 1500000
// board esp32-s3-devkitc-1
// see https://github.com/Xinyuan-LilyGO/T-Dongle-S3
#ifndef _TTGOTDONGLES3_H
#define _TTGOTDONGLES3_H
#include <stdint.h>
#define HAS_LED NOT_A_PIN
#define HAS_BUTTON 0
#define HAS_SDCARD 2 // this board has a SD MMC card-reader/writer
#define SDCARD_SLOTWIDTH 4 // 4-line interface
#define HAS_DISPLAY 2 // TFT-LCD
#define TFT_TYPE DISPLAY_T_DISPLAY_S3
#define MY_DISPLAY_FLIP 1 // use if display is rotated
#define MY_DISPLAY_WIDTH 80
#define MY_DISPLAY_HEIGHT 160
#define TFT_CS_PIN 4
#define TFT_SDA_PIN 3
#define TFT_SCL_PIN 5
#define TFT_DC_PIN 2
#define TFT_RES_PIN 1
#define TFT_LEDA_PIN 38
#endif

21
src/hal/ttgotdongles3.h Normal file
View File

@ -0,0 +1,21 @@
// clang-format off
// upload_speed 1500000
// board esp32-s3-devkitc-1
// for pinouts see https://github.com/Xinyuan-LilyGO/T-Dongle-S3
#ifndef _TTGOTDONGLES3_H
#define _TTGOTDONGLES3_H
#include <stdint.h>
#define HAS_LED NOT_A_PIN
#define RGB_LED_COUNT 1
#define HAS_RGB_LED FastLED.addLeds<APA102, 40, 39, BGR>(leds, RGB_LED_COUNT)
#define FASTLED_INTERNAL
#define HAS_BUTTON 0 // dongle button is on GPIO0
#define HAS_SDCARD 2 // dongle has a SD MMC card-reader/writer
#define SDCARD_SLOTWIDTH 4 // dongle has 4 line interface
#define SDCARD_SLOTCONFIG { .clk = GPIO_NUM_12, .cmd = GPIO_NUM_16, .d0 = GPIO_NUM_14, .d1 = GPIO_NUM_17, .d2 = GPIO_NUM_21, .d3 = GPIO_NUM_18, .cd = SDMMC_SLOT_NO_CD, .wp = SDMMC_SLOT_NO_WP, .width = 4, .flags = 0, }
#endif