Skip to content

Remodel API for better OCPP 1.6/2.0.1 and C/C++ interoperability #416

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

Open
wants to merge 50 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
c381f88
simplify Context and Model (WIP)
matth-x Feb 24, 2025
9baf8f0
refactor code structure and API
matth-x Jun 12, 2025
c23787b
add missing functions
matth-x Jun 14, 2025
42d7bc4
bugfixes
matth-x Jun 15, 2025
b073994
bugfixes
matth-x Jun 15, 2025
a5ad5db
bugfixes
matth-x Jun 15, 2025
d44d61f
bugfixes
matth-x Jun 15, 2025
9164b95
bugfixes
matth-x Jun 15, 2025
1da28b3
bugfixes
matth-x Jun 21, 2025
42f7950
bugfixes
matth-x Jun 22, 2025
a710796
bugfixes
matth-x Jun 22, 2025
49c6710
API update
matth-x Jun 23, 2025
626e3d1
bugfixes
matth-x Jun 28, 2025
3d4632a
fix unit tests
matth-x Jul 6, 2025
141161c
bugfix
matth-x Jul 6, 2025
a084dc3
consolidate start and stop of mo_simulator process
matth-x Jul 6, 2025
0afd0f3
update Ocpp16 / Ocpp201 namespace names
matth-x Jul 6, 2025
31985aa
remove superfluous white spaces
matth-x Jul 6, 2025
74c96f3
add common Model class for interoperable modules
matth-x Jul 6, 2025
14e9f80
API cleanup
matth-x Jul 6, 2025
83918e5
add README section
matth-x Jul 6, 2025
6a5b2c8
fix measure_heap script
matth-x Jul 11, 2025
b67946b
fix build pipeline
matth-x Jul 13, 2025
11ab396
fix workflows
matth-x Jul 13, 2025
6db63c1
fix workflows
matth-x Jul 13, 2025
62704d2
fix workflows
matth-x Jul 13, 2025
b238d6b
fix workflows
matth-x Jul 13, 2025
8c9363c
fix workflows
matth-x Jul 13, 2025
60f2d56
fix workflows
matth-x Jul 13, 2025
3dd9471
fix workflows
matth-x Jul 13, 2025
ab7b266
fix workflows
matth-x Jul 13, 2025
44f05c3
fix workflows
matth-x Jul 13, 2025
1c80d13
fix workflows
matth-x Jul 13, 2025
9510041
fix workflows
matth-x Jul 13, 2025
1959de2
fix workflows
matth-x Jul 13, 2025
7a35fea
fix workflows
matth-x Jul 14, 2025
0acd197
update debug output
matth-x Jul 14, 2025
14051a5
fix workflows
matth-x Jul 14, 2025
18e06c4
fix log upload
matth-x Jul 19, 2025
76be884
fix GetLog retry behavior
matth-x Jul 19, 2025
fa36f78
fix upload security log
matth-x Jul 19, 2025
294e5b9
fix BootNotification test cases
matth-x Jul 19, 2025
7aa118f
fix test cases
matth-x Jul 20, 2025
c913e51
update test case build ref
matth-x Jul 20, 2025
46afc93
fix compilation
matth-x Jul 20, 2025
6bc0562
update docs
matth-x Jul 20, 2025
ff4dc9c
bugfixes
matth-x Jul 20, 2025
9672e79
bugfixes
matth-x Jul 20, 2025
d00028b
fix test cases
matth-x Jul 22, 2025
d155bf0
fix test cases
matth-x Jul 26, 2025
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
118 changes: 64 additions & 54 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ permissions:
contents: write

jobs:
build_simulator:
name: Build Simulator
measure_heap:
name: Heap measurements
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: 3.x
- uses: actions/cache@v2
- uses: actions/cache@v4
with:
key: ${{ github.ref }}
path: .cache
Expand All @@ -34,7 +34,7 @@ jobs:
with:
repository: matth-x/MicroOcppSimulator
path: MicroOcppSimulator
ref: 2cb07cdbe53954a694a29336ab31eac2d2b48673
ref: 741733550b801d29261f81c3b7fb74bfc0b6faec
submodules: 'recursive'
- name: Clean MicroOcpp submodule
run: |
Expand All @@ -47,32 +47,8 @@ jobs:
run: cmake -S ./MicroOcppSimulator -B ./MicroOcppSimulator/build -DCMAKE_CXX_FLAGS="-DMO_OVERRIDE_ALLOCATION=1 -DMO_ENABLE_HEAP_PROFILER=1"
- name: Compile
run: cmake --build ./MicroOcppSimulator/build -j 32 --target mo_simulator
- name: Upload Simulator executable
uses: actions/upload-artifact@v4
with:
name: Simulator executable
path: |
MicroOcppSimulator/build/mo_simulator
MicroOcppSimulator/public/bundle.html.gz
if-no-files-found: error
retention-days: 1

measure_heap:
needs: build_simulator
name: Heap measurements
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: 3.x
- name: Install Python dependencies
run: pip install requests paramiko pandas
- name: Get Simulator
uses: actions/download-artifact@v4
with:
name: Simulator executable
path: MicroOcppSimulator
- name: Measure heap and create reports
run: |
mkdir -p docs/assets/tables
Expand All @@ -81,34 +57,36 @@ jobs:
TEST_DRIVER_URL: ${{ secrets.TEST_DRIVER_URL }}
TEST_DRIVER_CONFIG: ${{ secrets.TEST_DRIVER_CONFIG }}
TEST_DRIVER_KEY: ${{ secrets.TEST_DRIVER_KEY }}
TEST_DRIVER_CERT: ${{ secrets.TEST_DRIVER_CERT }}
MO_SIM_CONFIG: ${{ secrets.MO_SIM_CONFIG }}
MO_SIM_OCPP_SERVER: ${{ secrets.MO_SIM_OCPP_SERVER }}
MO_SIM_API_CERT: ${{ secrets.MO_SIM_API_CERT }}
MO_SIM_API_KEY: ${{ secrets.MO_SIM_API_KEY }}
MO_SIM_API_CONFIG: ${{ secrets.MO_SIM_API_CONFIG }}
SSH_LOCAL_PRIV: ${{ secrets.SSH_LOCAL_PRIV }}
SSH_HOST_PUB: ${{ secrets.SSH_HOST_PUB }}
MO_SIM_OCPP_CERT: ${{ secrets.MO_SIM_OCPP_CERT }}
MO_SIM_RMT_CTRL_CONFIG: ${{ secrets.MO_SIM_RMT_CTRL_CONFIG }}
MO_SIM_RMT_CTRL_CERT: ${{ secrets.MO_SIM_RMT_CTRL_CERT }}
- name: Upload reports
uses: actions/upload-artifact@v4
with:
name: Memory usage reports CSV
path: docs/assets/tables
if-no-files-found: error

build_firmware_size:
build_firmware:
name: Build firmware
runs-on: ubuntu-latest
strategy:
matrix:
part: [v16, v201, v16_v201]
steps:
- uses: actions/checkout@v3
- name: Cache pip
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Cache PlatformIO
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: ~/.platformio
key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }}
Expand All @@ -119,35 +97,28 @@ jobs:
python -m pip install --upgrade pip
pip install --upgrade platformio
- name: Run PlatformIO
run: pio ci --lib="." --build-dir="${{ github.workspace }}/../build" --keep-build-dir --project-conf="./tests/benchmarks/firmware_size/platformio.ini" ./tests/benchmarks/firmware_size/main.cpp
- name: Move firmware files # change path to location without parent dir ('..') statement (to make upload-artifact happy)
run: pio ci --lib="." --build-dir="${{ github.workspace }}/../build" --keep-build-dir --project-conf="./tests/benchmarks/firmware_size/platformio.ini" -e ${{ matrix.part }} ./tests/benchmarks/firmware_size/main.cpp
- name: Move firmware file # change path to location without parent dir ('..') statement (to make upload-artifact happy)
run: |
mkdir firmware
mv "${{ github.workspace }}/../build/.pio/build/v16/firmware.elf" firmware/firmware_v16.elf
mv "${{ github.workspace }}/../build/.pio/build/v201/firmware.elf" firmware/firmware_v201.elf
- name: Upload firmware linker files
mv "${{ github.workspace }}/../build/.pio/build/${{ matrix.part }}/firmware.elf" "firmware/firmware_${{ matrix.part }}.elf"
- name: Upload firmware linker file
uses: actions/upload-artifact@v4
with:
name: Firmware linker files
name: Firmware linker file ${{ matrix.part }}
path: firmware
if-no-files-found: error
retention-days: 1

evaluate_firmware:
needs: build_firmware_size
name: Static firmware analysis
build_bloaty:
name: Build Google bloaty
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: 3.x
- uses: actions/cache@v2
- uses: actions/cache@v4
with:
key: ${{ github.ref }}
path: .cache
- name: Install Python dependencies
run: pip install pandas
- name: Get build tools
run: |
sudo apt update
Expand All @@ -165,16 +136,55 @@ jobs:
run: |
cmake -B tools/bloaty/build -G Ninja -S tools/bloaty
cmake --build tools/bloaty/build -j 32
- name: Get firmware linker files
- name: Upload bloaty executable
uses: actions/upload-artifact@v4
with:
name: Google bloaty
path: tools/bloaty/build/bloaty
if-no-files-found: error
retention-days: 1

evaluate_firmware:
needs: [build_firmware, build_bloaty]
name: Static firmware analysis
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v4
with:
key: ${{ github.ref }}
path: .cache
- name: Set up Python
uses: actions/setup-python@v4
- name: Install Python dependencies
run: pip install pandas
- name: Get firmware linker file
uses: actions/download-artifact@v4
with:
name: Firmware linker file v16
path: firmware
- name: Get firmware linker file
uses: actions/download-artifact@v4
with:
name: Firmware linker file v201
path: firmware
- name: Get firmware linker file
uses: actions/download-artifact@v4
with:
name: Firmware linker files
name: Firmware linker file v16_v201
path: firmware
- name: Get bloaty executable
uses: actions/download-artifact@v4
with:
name: Google bloaty
path: tools/bloaty/build
- name: Run bloaty
run: |
mkdir -p docs/assets/tables
chmod +x tools/bloaty/build/bloaty
tools/bloaty/build/bloaty firmware/firmware_v16.elf -d compileunits --csv -n 0 > docs/assets/tables/bloaty_v16.csv
tools/bloaty/build/bloaty firmware/firmware_v201.elf -d compileunits --csv -n 0 > docs/assets/tables/bloaty_v201.csv
tools/bloaty/build/bloaty firmware/firmware_v16_v201.elf -d compileunits --csv -n 0 > docs/assets/tables/bloaty_v16_v201.csv
- name: Evaluate and create reports
run: python tests/benchmarks/scripts/eval_firmware_size.py
- name: Upload reports
Expand All @@ -194,7 +204,7 @@ jobs:
- uses: actions/setup-python@v4
with:
python-version: 3.x
- uses: actions/cache@v2
- uses: actions/cache@v4
with:
key: ${{ github.ref }}
path: .cache
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/pio.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,19 @@ jobs:
strategy:
matrix:
example: [examples/ESP/main.cpp, examples/ESP-TLS/main.cpp]
pio_platform: [nodemcuv2, esp32-development-board]

steps:
- uses: actions/checkout@v2
- name: Cache pip
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Cache PlatformIO
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: ~/.platformio
key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }}
Expand All @@ -42,6 +43,6 @@ jobs:
- name: Install library dependencies
run: pio pkg install
- name: Run PlatformIO
run: pio ci --lib="." --project-conf=platformio.ini ${{ matrix.dashboard-extra }}
run: pio ci --lib="." --project-conf=platformio.ini -e ${{ matrix.pio_platform }} ${{ matrix.dashboard-extra }}
env:
PLATFORMIO_CI_SRC: ${{ matrix.example }}
Loading
Loading