Merge pull request #912 from cyberman54/development

v3.4.0
This commit is contained in:
Verkehrsrot 2022-11-05 16:27:05 +01:00 committed by GitHub
commit 593ddda080
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 251 additions and 24 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,106 @@ jobs:
env: env:
CI_HALFILE: ${{ matrix.board }} CI_HALFILE: ${{ matrix.board }}
run: pio run -e ci run: pio run -e ci
build-windows-macos:
strategy:
fail-fast: false
matrix:
os: [windows-latest, macos-latest]
include:
- 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: [generic.h, ttgov21new.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.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
build-s3-usb-stick:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
include:
- os: ubuntu-latest
path: ~/.cache/pip
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: [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.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

@ -31,7 +31,7 @@ You can build this project battery powered using ESP32 deep sleep mode and reach
**Supported ESP32 based boards**: **Supported ESP32 based boards**:
*LoRa & SPI*: *With LoRa radio data transfer*:
- **LilyGo: [Paxcounter-Board*](https://www.aliexpress.com/item/32915894264.html?spm=a2g0o.productlist.0.0.3d656325QrcfQc&algo_pvid=4a150199-63e7-4d21-bdb1-b48164537744&algo_exp_id=4a150199-63e7-4d21-bdb1-b48164537744-2&pdp_ext_f=%7B%22sku_id%22%3A%2212000023374441919%22%7D)** - **LilyGo: [Paxcounter-Board*](https://www.aliexpress.com/item/32915894264.html?spm=a2g0o.productlist.0.0.3d656325QrcfQc&algo_pvid=4a150199-63e7-4d21-bdb1-b48164537744&algo_exp_id=4a150199-63e7-4d21-bdb1-b48164537744-2&pdp_ext_f=%7B%22sku_id%22%3A%2212000023374441919%22%7D)**
- TTGO: T1*, T2*, T3*, T-Beam, T-Fox - TTGO: T1*, T2*, T3*, T-Beam, T-Fox
@ -43,10 +43,9 @@ LoLin32lite + [LoraNode32-Lite shield](https://github.com/hallard/LoLin32-Lite-L
- Adafruit ESP32 Feather + LoRa Wing + OLED Wing, #IoT Octopus32 (Octopus + ESP32 Feather) - Adafruit ESP32 Feather + LoRa Wing + OLED Wing, #IoT Octopus32 (Octopus + ESP32 Feather)
- M5Stack: [Basic Core IoT*](https://m5stack.com/collections/m5-core/products/basic-core-iot-development-kit) + [Lora Module RA-01H](https://m5stack.com/collections/m5-module/products/lora-module-868mhz), [Fire IoT*](https://m5stack.com/collections/m5-core/products/fire-iot-development-kit) - M5Stack: [Basic Core IoT*](https://m5stack.com/collections/m5-core/products/basic-core-iot-development-kit) + [Lora Module RA-01H](https://m5stack.com/collections/m5-module/products/lora-module-868mhz), [Fire IoT*](https://m5stack.com/collections/m5-core/products/fire-iot-development-kit)
*) supports microSD-card *Without LoRa*:
*SPI only*:
- LilyGo: [T-Dongle S3*](https://github.com/Xinyuan-LilyGO/T-Dongle-S3)
- Pyom: WiPy - Pyom: WiPy
- WeMos: LoLin32, LoLin32 Lite, WeMos D32, [Wemos32 Oled](https://www.instructables.com/id/ESP32-With-Integrated-OLED-WEMOSLolin-Getting-Star/) - WeMos: LoLin32, LoLin32 Lite, WeMos D32, [Wemos32 Oled](https://www.instructables.com/id/ESP32-With-Integrated-OLED-WEMOSLolin-Getting-Star/)
- Crowdsupply: [TinyPICO](https://www.crowdsupply.com/unexpected-maker/tinypico) - Crowdsupply: [TinyPICO](https://www.crowdsupply.com/unexpected-maker/tinypico)
@ -54,6 +53,8 @@ LoLin32lite + [LoraNode32-Lite shield](https://github.com/hallard/LoLin32-Lite-L
- TTGO: [T-Wristband](https://www.aliexpress.com/item/4000527495064.html) - TTGO: [T-Wristband](https://www.aliexpress.com/item/4000527495064.html)
- Generic ESP32 - Generic ESP32
*) supports microSD/TF-card for local logging of paxcounter data
Depending on board hardware following features are supported: Depending on board hardware following features are supported:
- LoRaWAN communication, supporting various payload formats (see enclosed .js converters) - LoRaWAN communication, supporting various payload formats (see enclosed .js converters)
- MQTT communication via TCP/IP and Ethernet interface (note: payload transmitted over MQTT will be base64 encoded) - MQTT communication via TCP/IP and Ethernet interface (note: payload transmitted over MQTT will be base64 encoded)
@ -95,7 +96,7 @@ Install <A HREF="https://platformio.org/">PlatformIO IDE for embedded developmen
Compile time configuration is spread across several files. Before compiling the code, edit or create the following files: Compile time configuration is spread across several files. Before compiling the code, edit or create the following files:
## platformio.ini ## platformio.ini
Edit `platformio_orig.ini` and select desired hardware target in section boards. To add a new board, create an appropriate hardware abstraction layer file in hal subdirectory, and add a pointer to this file in sections board. Copy or rename to `platformio.ini` in the root directory of the project. Now start Platformio. Note: Platformio is looking for `platformio.ini` in the root directory and won't start if it does not find this file. Edit `platformio_orig.ini` (for ESP32 CPU based boards) *or* `platformio_orig_s3.ini` (for ESP32-S3 CPU based boards) and select desired board in section **board**. To add a new board, create an appropriate hardware abstraction layer file in hal subdirectory, and add a pointer to this file in section **board**. Copy or rename to `platformio.ini` in the root directory of the project. Now start Platformio. Note: Platformio is looking for `platformio.ini` in the root directory and won't start if it does not find this file!
## paxcounter.conf ## paxcounter.conf
Edit `src/paxcounter_orig.conf` and tailor settings in this file according to your needs and use case. Please take care of the duty cycle regulations of the LoRaWAN network you're going to use. Copy or rename to `src/paxcounter.conf`. Edit `src/paxcounter_orig.conf` and tailor settings in this file according to your needs and use case. Please take care of the duty cycle regulations of the LoRaWAN network you're going to use. Copy or rename to `src/paxcounter.conf`.
@ -607,3 +608,4 @@ Thanks to
- [sbamueller](https://github.com/sbamueller) for writing the tutorial in Make Magazine - [sbamueller](https://github.com/sbamueller) for writing the tutorial in Make Magazine
- [Stefan](https://github.com/nerdyscout) for paxcounter opensensebox integration - [Stefan](https://github.com/nerdyscout) for paxcounter opensensebox integration
- [August Quint](https://github.com/AugustQu) for adding SD card data logger and SDS011 support - [August Quint](https://github.com/AugustQu) for adding SD card data logger and SDS011 support
- [t-huyeng](https://github.com/t-huyeng) for adding a CI workflow to this project

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

@ -46,7 +46,7 @@ description = Paxcounter is a device for metering passenger flows in realtime. I
[common] [common]
; for release_version use max. 10 chars total, use any decimal format like "a.b.c" ; for release_version use max. 10 chars total, use any decimal format like "a.b.c"
release_version = 3.3.2 release_version = 3.4.0
; DEBUG LEVEL: For production run set to 0, otherwise device will leak RAM while running! ; 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 ; 0=None, 1=Error, 2=Warn, 3=Info, 4=Debug, 5=Verbose
debug_level = 3 debug_level = 3
@ -57,7 +57,6 @@ lmicconfigfile = lmic_config.h
platform_espressif32 = espressif32@5.2.0 platform_espressif32 = espressif32@5.2.0
monitor_speed = 115200 monitor_speed = 115200
upload_speed = 115200 ; set by build.py and taken from hal file upload_speed = 115200 ; set by build.py and taken from hal file
display_library = ; set by build.py and taken from hal file
lib_deps_lora = lib_deps_lora =
mcci-catena/MCCI LoRaWAN LMIC library @ ^4.1.1 mcci-catena/MCCI LoRaWAN LMIC library @ ^4.1.1
lib_deps_display = lib_deps_display =

71
platformio_orig_s3.ini Normal file
View File

@ -0,0 +1,71 @@
[board]
halfile = ttgotdongles3.h
;halfile = ttgotdongledisplays3.h
;halfile = ttgotdisplays3.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.4.0
; 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 = 3
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,7 +1,6 @@
// clang-format off // clang-format off
// upload_speed 115200 // upload_speed 115200
// board esp32dev // board esp32dev
// display_library lib_deps_oled_display
#ifndef _GENERIC_H #ifndef _GENERIC_H
#define _GENERIC_H #define _GENERIC_H

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,34 @@
// clang-format off
// upload_speed 1500000
// board esp32-s3-devkitc-1
// for pinouts see https://github.com/Xinyuan-LilyGO/T-Dongle-S3
#ifndef _TTGOTDONGLEDISPLAYS3_H
#define _TTGOTDONGLEDISPLAYS3_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, }
#define HAS_DISPLAY 2 // TFT-LCD
#define TFT_TYPE DISPLAY_T_DISPLAY_S3 // may currently not work, we are awaiting a PR for display lib
#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