Skip to content

OBSPro #357

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

Merged
merged 35 commits into from
Sep 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
fbaffeb
Remove remnant from VL53 ToF sensor
j000bs Dec 17, 2023
7f66d11
Remove commented out code in `displays.cpp`
j000bs Dec 17, 2023
db3c3bd
Remove class `DisplayDevice`
j000bs Dec 17, 2023
a74041e
Rename class `SSD1306DisplayDevice` to `DisplayDevice`
j000bs Dec 17, 2023
c159d24
Switch to U8g2 display library
j000bs Dec 17, 2023
ad209d0
Switch to U8g2 display library
j000bs Dec 17, 2023
cf10d5f
Added .vscode to gitignore
FabianSchwartau Feb 7, 2024
d06a236
Set ports and build type in platformio.ini
FabianSchwartau Feb 7, 2024
7fa7d61
Add OBSPro support with button and variant selection
FabianSchwartau Feb 7, 2024
decef39
Switch to fixed u8g2 lib and disable custom build/serial options agai…
FabianSchwartau Feb 8, 2024
baec7e9
Enable display testing only for OBSClassic
FabianSchwartau Feb 8, 2024
7521033
Fix include warning for CircularBuffer.hpp
FabianSchwartau Feb 8, 2024
6cf9d11
Temporarily disable GPS as it is not working yet and delaying the sta…
FabianSchwartau Feb 8, 2024
41ee07a
Flip OBSPro display by default
FabianSchwartau Feb 8, 2024
d8d4fa2
Added a dummy sensor driver for the PGA460
FabianSchwartau Feb 9, 2024
22c16b6
Implemented TCI and SPI interface, both have a working example
FabianSchwartau Feb 14, 2024
2e7db61
PGA460 is working as expected, integration in OBS still missing
FabianSchwartau Feb 19, 2024
0767d36
Remove TCI, we are using SPI now
FabianSchwartau Feb 19, 2024
82a96d8
Implemented alternating polling
FabianSchwartau Feb 21, 2024
3587ffd
Sensors integration works, but is completely untested
FabianSchwartau Feb 21, 2024
f9a694d
Added support for u-blox M10 modules
FabianSchwartau Feb 22, 2024
2ba9e96
Moved power management into an interrupt, works nor everywhere
FabianSchwartau Feb 22, 2024
e713af6
Fixed un-initialized variable causing crashes if not 0 or 1
FabianSchwartau Feb 22, 2024
c12d9cd
Disable dump
FabianSchwartau Feb 23, 2024
c3052b0
Smaller optimizations of pga and gps software
FabianSchwartau Apr 15, 2024
37f75a0
Merge branch 'refs/heads/main' into obspro
amandel May 22, 2024
c3cf661
Move selection of OBS Variant to ini file
amandel May 22, 2024
e9eab2a
Make sure code compiles for `OBSCLASSIC`
amandel May 22, 2024
e966265
CI build for classic and pro variant
amandel Aug 17, 2024
85466de
Make ids unique again
amandel Aug 17, 2024
69bf0b1
No SQ for now
amandel Aug 17, 2024
ee7119f
Next release is 0.21 which includes obs classic and obs pro
amandel Aug 17, 2024
01ec00e
untested - specific firmware update path
amandel Aug 17, 2024
23a2de5
fix - specific firmware update path
amandel Aug 18, 2024
aa4699c
update espressif32 lib
amandel Aug 18, 2024
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
158 changes: 139 additions & 19 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,13 @@ jobs:
run: |
mkdir sonarqube-out
./sonarqube/build-wrapper-linux-x86/build-wrapper-linux-x86-64 --out-dir sonarqube-out \
platformio ci --build-dir="./bin" --keep-build-dir --project-conf=platformio.ini ./src/
platformio ci --environment obspro --environment obs --build-dir ./bin --keep-build-dir --project-conf platformio.ini ./src/

- name: Package firmware
- name: Package firmware OBS classic
run: |
set -eux
mkdir -p obs-classic
cd obs-classic
if [ -f "/github/home/.platformio/packages/framework-arduinoespressif32/tools/sdk/esp32/bin/bootloader_dio_40m.elf" ]; then
cp /github/home/.platformio/packages/framework-arduinoespressif32/tools/sdk/esp32/bin/bootloader_dio_40m.elf 0x01000.elf
elif [ -f "/github/home/.platformio/packages/framework-arduinoespressif32/tools/sdk/bin/bootloader_dio_40m.bin" ]; then
Expand All @@ -112,10 +114,10 @@ jobs:
find /github/home/.platformio/ -name "bootloader*.elf"
exit 1
fi
cp bin/.pio/build/esp32dev/partitions.bin 0x08000.bin
cp ../bin/.pio/build/obs/partitions.bin 0x08000.bin
cp /github/home/.platformio/packages/framework-arduinoespressif32/tools/partitions/boot_app0.bin 0x0e000.bin
cp bin/.pio/build/esp32dev/firmware.bin 0x10000.bin
cp bin/.pio/build/esp32dev/firmware.bin firmware.bin
cp ../bin/.pio/build/obs/firmware.bin 0x10000.bin
cp ../bin/.pio/build/obs/firmware.bin firmware.bin
ESPTOOL=/github/home/.platformio/packages/tool-esptoolpy/esptool.py
chmod +x ${ESPTOOL}
# CMD to create a merged binary (still missing flash.app)
Expand All @@ -138,23 +140,81 @@ jobs:
0x01000 0x01000.bin.org
echo OpenBikeSensor bootloader params
${ESPTOOL} --chip esp32 image_info --version 2 0x01000.bin || echo image_info failed
cp src/fonts/LICENSE.txt LICENSE-OpenSans.txt
cp ../src/fonts/LICENSE.txt LICENSE-OpenSans.txt
wget --no-verbose -O COPYRIGHT-ESP.html https://docs.espressif.com/projects/esp-idf/en/latest/esp32/COPYRIGHT.html
wget --no-verbose -O LICENSE-ARDUINO-ESP32.md https://github.com/espressif/arduino-esp32/raw/master/LICENSE.md
zip --junk-paths obs-${{ env.OBS_VERSION }}-initial-flash.zip \
zip --junk-paths ../obs-${{ env.OBS_VERSION }}-initial-flash.zip \
0x*.bin \
COPYRIGHT-ESP.html \
LICENSE-ARDUINO-ESP32.md \
LICENSE-OpenSans.txt \
LICENSE
zip --junk-paths obs-${{ env.OBS_VERSION }}.zip \
zip --junk-paths ../obs-${{ env.OBS_VERSION }}.zip \
firmware.bin \
COPYRIGHT-ESP.html \
LICENSE-ARDUINO-ESP32.md \
LICENSE-OpenSans.txt \
LICENSE

- name: Package firmware OBS pro
run: |
set -eux
mkdir -p obs-pro
cd obs-pro
if [ -f "/github/home/.platformio/packages/framework-arduinoespressif32/tools/sdk/esp32/bin/bootloader_dio_40m.elf" ]; then
cp /github/home/.platformio/packages/framework-arduinoespressif32/tools/sdk/esp32/bin/bootloader_dio_40m.elf 0x01000.elf
elif [ -f "/github/home/.platformio/packages/framework-arduinoespressif32/tools/sdk/bin/bootloader_dio_40m.bin" ]; then
cp /github/home/.platformio/packages/framework-arduinoespressif32/tools/sdk/bin/bootloader_dio_40m.bin 0x01000.bin
else
echo could not find bootloader_dio_40m.bin, new location?
find /github/home/.platformio/ -name "bootloader*.bin"
find /github/home/.platformio/ -name "bootloader*.elf"
exit 1
fi
cp ../bin/.pio/build/obspro/partitions.bin 0x08000.bin
cp /github/home/.platformio/packages/framework-arduinoespressif32/tools/partitions/boot_app0.bin 0x0e000.bin
cp ../bin/.pio/build/obspro/firmware.bin 0x10000.bin
cp ../bin/.pio/build/obspro/firmware.bin firmware.bin
ESPTOOL=/github/home/.platformio/packages/tool-esptoolpy/esptool.py
chmod +x ${ESPTOOL}
# CMD to create a merged binary (still missing flash.app)
# ${ESPTOOL} --trace --chip esp32 merge_bin --output merged.bin \
# --flash_freq keep --flash_mode dio --flash_size 4MB \
# 0x01000 0x01000.bin \
# 0x08000 0x08000.bin \
# 0x0e000 0x0e000.bin \
# 0x10000 0x10000.bin
${ESPTOOL} --trace --chip esp32 elf2image \
--dont-append-digest \
--flash_freq 40m --flash_mode dio \
0x01000.elf
echo Original bootloader params after elf2image
${ESPTOOL} --chip esp32 image_info --version 2 0x01000.bin || echo image_info for converted bootloader failed
mv 0x01000.bin 0x01000.bin.org
${ESPTOOL} --trace --chip esp32 merge_bin --output 0x01000.bin \
--flash_freq 40m --flash_mode dio --flash_size 4MB \
--target-offset 0x01000 \
0x01000 0x01000.bin.org
echo OpenBikeSensor bootloader params
${ESPTOOL} --chip esp32 image_info --version 2 0x01000.bin || echo image_info failed
cp ../src/fonts/LICENSE.txt LICENSE-OpenSans.txt
wget --no-verbose -O COPYRIGHT-ESP.html https://docs.espressif.com/projects/esp-idf/en/latest/esp32/COPYRIGHT.html
wget --no-verbose -O LICENSE-ARDUINO-ESP32.md https://github.com/espressif/arduino-esp32/raw/master/LICENSE.md
zip --junk-paths ../obspro-${{ env.OBS_VERSION }}-initial-flash.zip \
0x*.bin \
COPYRIGHT-ESP.html \
LICENSE-ARDUINO-ESP32.md \
LICENSE-OpenSans.txt \
LICENSE
zip --junk-paths ../obspro-${{ env.OBS_VERSION }}.zip \
firmware.bin \
COPYRIGHT-ESP.html \
LICENSE-ARDUINO-ESP32.md \
LICENSE-OpenSans.txt \
LICENSE

- name: Analyze with SonarCloud
if: false
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down Expand Up @@ -186,26 +246,50 @@ jobs:
with:
name: obs-${{ env.OBS_VERSION }}
path: |
firmware.bin
COPYRIGHT-ESP.html
LICENSE-ARDUINO-ESP32.md
LICENSE-OpenSans.txt
LICENSE
obs-classic/firmware.bin
obs-classic/COPYRIGHT-ESP.html
obs-classic/LICENSE-ARDUINO-ESP32.md
obs-classic/LICENSE-OpenSans.txt
obs-classic/LICENSE
if-no-files-found: error

- name: Upload Build Asset Initial Flash
uses: actions/upload-artifact@v4
with:
name: obs-${{ env.OBS_VERSION }}-initial-flash
path: |
0x*.bin
COPYRIGHT-ESP.html
LICENSE-ARDUINO-ESP32.md
LICENSE-OpenSans.txt
LICENSE
obs-classic/0x*.bin
obs-classic/COPYRIGHT-ESP.html
obs-classic/LICENSE-ARDUINO-ESP32.md
obs-classic/LICENSE-OpenSans.txt
obs-classic/LICENSE
sonarqube-out/build-wrapper-dump.json
if-no-files-found: error

- name: Upload Build Asset obspro
uses: actions/upload-artifact@v4
with:
name: obspro-${{ env.OBS_VERSION }}
path: |
obs-pro/firmware.bin
obs-pro/COPYRIGHT-ESP.html
obs-pro/LICENSE-ARDUINO-ESP32.md
obs-pro/LICENSE-OpenSans.txt
obs-pro/LICENSE
if-no-files-found: error

- name: Upload Build Asset Initial Flash obspro
uses: actions/upload-artifact@v4
with:
name: obspro-${{ env.OBS_VERSION }}-initial-flash
path: |
obs-pro/0x*.bin
obs-pro/COPYRIGHT-ESP.html
obs-pro/LICENSE-ARDUINO-ESP32.md
obs-pro/LICENSE-OpenSans.txt
obs-pro/LICENSE
if-no-files-found: error

- name: Generate changelog
id: changelog
if: ${{ env.OBS_PREPARE_RELEASE == 'true' }}
Expand Down Expand Up @@ -275,6 +359,42 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./bin/.pio/build/esp32dev/firmware.bin
asset_path: ./bin/.pio/build/obs/firmware.bin
asset_name: firmware.bin
asset_content_type: application/x-esp32

- name: Upload Release Asset obspro
id: upload-obspro-release-asset
if: ${{ env.OBS_PREPARE_RELEASE == 'true' }}
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./obspro-${{ env.OBS_VERSION }}.zip
asset_name: obspro-${{ env.OBS_VERSION }}.zip
asset_content_type: application/zip

- name: Upload Release Asset Initial Flash pro
id: upload-obspro-release-asset-initial-flash
if: ${{ env.OBS_PREPARE_RELEASE == 'true' }}
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./obspro-${{ env.OBS_VERSION }}-initial-flash.zip
asset_name: obspro-${{ env.OBS_VERSION }}-initial-flash.zip
asset_content_type: application/zip

- name: Upload Release Asset app bin pro
id: upload-obspro-release-asset-app-bin
if: ${{ env.OBS_PREPARE_RELEASE == 'true' }}
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./bin/.pio/build/obspro/firmware.bin
asset_name: firmware-obspro.bin
asset_content_type: application/x-esp32
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ docs/.jekyll-metadata
docs/vendor

.DS_Store
.vscode

# for people installing pio venv style
venv
Expand Down
12 changes: 5 additions & 7 deletions custom_config.ini.example
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
; This file should contain your local modifications to the PlatformIO.ini file.

[env:esp32dev]
[env:myObs]
build_flags =
; settings needed by the build
-DHTTPS_REQUEST_MAX_REQUEST_LENGTH=1024
; reduce probability of https://github.com/fhessel/esp32_https_server/pull/123
-DHTTPS_CONNECTION_DATA_CHUNK_SIZE=1024
; custom default configuration
;
${env.build_flags}
; you can specify a custom config json (see docs/software/firmware/obs_cfg.md)
; here which will be used for fresh installs based on this firmware
-DCUSTOM_OBS_DEFAULT_CONFIG='"{ obs: [ { displayConfig: 15, offset: [ 30, 30 ], httpPin: \\"12345678\\", wifiSsid: \\"SID\\", wifiPassword: \\"87654321\\" } ] }"'
Expand All @@ -18,6 +13,9 @@ build_flags =
-DDEVELOP
; http lib loglevel
-DHTTPS_LOGLEVEL=3
; select OBS Variant
-DOBSCLASSIC
; -DOBSPRO


; === upload_port ===
Expand Down
19 changes: 15 additions & 4 deletions platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,8 @@
src_dir = src
extra_configs = custom_config.ini

[env:esp32dev]
platform = espressif32 @ 6.6.0
; 5.4.0
[env]
platform = espressif32 @ 6.8.1
board = esp32dev
framework = arduino
monitor_speed = 115200
Expand All @@ -52,7 +51,9 @@ lib_deps =
; https://arduinojson.org/v6/api/
bblanchon/ArduinoJson @ ^6.21.5
rlogiacco/CircularBuffer @ ^1.4.0
thingpulse/ESP8266 and ESP32 OLED driver for SSD1306 displays @ ^4.5.0
; olikraus/U8g2 @ ^2.35.9
https://codeberg.org/j000bs/U8g2_Arduino.git#jhd-fix
; replaced by U8g2 thingpulse/ESP8266 and ESP32 OLED driver for SSD1306 displays @ ^4.5.0
adafruit/Adafruit BMP280 Library@^2.6.8
pololu/VL53L0X@^1.3.1
; https://github.com/fhessel/esp32_https_server
Expand All @@ -67,3 +68,13 @@ build_flags =
-DHTTPS_CONNECTION_DATA_CHUNK_SIZE=1024
; build number "-dev" will be replaced in github action
-DBUILD_NUMBER=\"-dev\"

[env:obs]
build_flags =
${env.build_flags}
-DOBSCLASSIC

[env:obspro]
build_flags =
${env.build_flags}
-DOBSPRO
Loading