Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
51d83df
Very hacky updates to allow building on native (Linux) systems
jeremypoulter Dec 29, 2025
a3e4bfb
Abstract the certificate verification/reading
jeremypoulter Jan 11, 2026
499861a
Remove the native_shims and add to EpoxyDuino
jeremypoulter Jan 11, 2026
e0c6e91
Ensure libraries/feature flags match between ESP32 and native build
jeremypoulter Jan 11, 2026
467db4d
More tidy up
jeremypoulter Jan 13, 2026
52d5077
Add native build to build workflow
jeremypoulter Jan 13, 2026
1a7250c
Fixed switching into AP and factory resetting
jeremypoulter Jan 13, 2026
ae4c534
Removed patch script, no longer needed
jeremypoulter Jan 13, 2026
e984c8a
Allow the config to be set on the command line and allow the web serv…
jeremypoulter Jan 18, 2026
f665548
The RAPI connection connects to a PTY to allow connecting to real ser…
jeremypoulter Jan 19, 2026
c397d9e
Review fixes
jeremypoulter Jan 23, 2026
5f58af1
Warning fixes
jeremypoulter Jan 23, 2026
3a9285f
Review fix
jeremypoulter Jan 23, 2026
abf4b2d
Removed uneeded functions, resolves review comment
jeremypoulter Jan 23, 2026
44438d1
Added option to disable the heartbeat
jeremypoulter Jan 24, 2026
1903f21
Merge branch 'master' into native_build
jeremypoulter Jan 24, 2026
a3d8813
Merge branch 'master' of github.com:OpenEVSE/ESP32_WiFi_V4.x into nat…
jeremypoulter Mar 2, 2026
1b08595
Fixes for latest EpoxyDuino update
jeremypoulter Mar 2, 2026
834f2d2
Build a docker image of the OpenEVSE WiFi firmware for standalon GUI …
jeremypoulter Mar 2, 2026
17b848f
Install native dependancies
jeremypoulter Mar 2, 2026
a953ecf
Updates
jeremypoulter Mar 2, 2026
bc4e4d8
Fix to 24.04 to make sure the build and the docker image are always t…
jeremypoulter Mar 2, 2026
9bd25e7
Push for PRs temp
jeremypoulter Mar 2, 2026
d93b137
Merge branch 'master' of github.com:OpenEVSE/ESP32_WiFi_V4.x into nat…
jeremypoulter Mar 2, 2026
b2d555d
Always push
jeremypoulter Mar 2, 2026
8dbf93a
Not going to be able to push PRs
jeremypoulter Mar 2, 2026
db07025
Fix
jeremypoulter Mar 2, 2026
ce03c4d
Try uploading to my repo for testing
jeremypoulter Mar 2, 2026
2d97926
Truing build on push to the dev branch
jeremypoulter Mar 2, 2026
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
7 changes: 7 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ jobs:
# - elecrow_esp32_hmi_dev
- openevse_wifi_tft_v1
- openevse_wifi_tft_v1_dev
- native

steps:
- uses: ammaraskar/gcc-problem-matcher@master
Expand Down Expand Up @@ -84,6 +85,12 @@ jobs:
python -m pip install --upgrade pip
pip install --upgrade platformio

- name: Install Avahi development libraries
if: matrix.env == 'native'
run: |
sudo apt-get update
sudo apt-get install -y libavahi-client-dev libavahi-common-dev

- name: Run PlatformIO
run: pio run -e ${{ matrix.env }}

Expand Down
124 changes: 124 additions & 0 deletions .github/workflows/native_docker.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json

name: Native Docker Image

on:
push:
branches:
- master
- native_build
tags:
- 'v*'
pull_request:
workflow_dispatch:

permissions:
contents: read
packages: write
id-token: write
attestations: write

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository_owner }}/openevse-wifi-native
UBUNTU_VERSION: 24.04

jobs:
package-native:
runs-on: ubuntu-24.04

steps:
- name: Checkout
uses: actions/checkout@v6

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: '3.x'

- name: Install PlatformIO
run: |
python -m pip install --upgrade pip
pip install --upgrade platformio
sudo apt-get update
sudo apt-get install -y libavahi-client-dev libavahi-common-dev

- name: Build native image
run: pio run -e native

- name: Resolve native executable path
id: native-binary
run: |
set -e
if [ -x .pio/build/native/program ]; then
BINARY_PATH=.pio/build/native/program
else
BINARY_PATH="$(find .pio/build/native -maxdepth 1 -type f -executable | head -n 1)"
fi

if [ -z "$BINARY_PATH" ]; then
echo "No native executable found in .pio/build/native"
ls -la .pio/build/native || true
exit 1
fi

echo "Resolved native executable: $BINARY_PATH"
echo "path=$BINARY_PATH" >> "$GITHUB_OUTPUT"

- name: Generate Docker metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
# Tag with 'latest' on main branch
type=raw,value=latest,enable={{is_default_branch}}
# Tag with 'develop' on develop branch
type=raw,value=develop,enable=${{ github.ref == 'refs/heads/native_build' }}
# Tag with version on tags (e.g., v1.0.0 -> 1.0.0)
type=semver,pattern={{version}}
# Tag with major.minor on tags (e.g., v1.0.0 -> 1.0)
type=semver,pattern={{major}}.{{minor}}
# Tag with major on tags (e.g., v1.0.0 -> 1)
type=semver,pattern={{major}}
# Tag with SHA for pull requests
type=sha,enable=${{ github.event_name == 'pull_request' }}
labels: |
org.opencontainers.image.title=OpenEVSE WiFi Firmware
org.opencontainers.image.description=Native Linux build of the OpenEVSE WiFi firmware for testing and development purposes
org.opencontainers.image.vendor=OpenEVSE
org.opencontainers.image.licenses=GPL-3.0

- name: Login to GHCR
#if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and publish native Docker image
id: build
uses: docker/build-push-action@v6
with:
context: .
file: docker/native/Dockerfile
build-args: |
UBUNTU_VERSION=${{ env.UBUNTU_VERSION }}
NATIVE_BINARY=${{ steps.native-binary.outputs.path }}
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max

- name: Generate artifact attestation
if: github.event_name != 'pull_request'
uses: actions/attest-build-provenance@v4
with:
subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
subject-digest: ${{ steps.build.outputs.digest }}
push-to-registry: true
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,14 @@ lib/jeremypoulter/ESPAL
lib/jeremypoulter/Micro Debug
lib/jeremypoulter/StreamSpy
lib/jeremypoulter/MicroTasks
lib/EpoxyDuino

*.bin
divert_sim/epoxyfsdata
divert_sim/epoxyeepromdata

*.pem
*.pem

epoxyfsdata
epoxyeepromdata
22 changes: 22 additions & 0 deletions docker/native/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
ARG UBUNTU_VERSION=25.10
FROM ubuntu:${UBUNTU_VERSION}

ARG NATIVE_BINARY=.pio/build/native/program

RUN apt-get update \
&& apt-get install -y --no-install-recommends socat ca-certificates libavahi-client3 \
&& rm -rf /var/lib/apt/lists/*

WORKDIR /app

COPY ${NATIVE_BINARY} /usr/local/bin/openevse
COPY docker/native/entrypoint.sh /entrypoint.sh

RUN chmod +x /usr/local/bin/openevse /entrypoint.sh

ENV RAPI_PTY_PATH=/tmp/rapi_pty
ENV EMULATOR_HOST=localhost
ENV EMULATOR_PORT=8023

ENTRYPOINT ["/entrypoint.sh"]
CMD []
49 changes: 49 additions & 0 deletions docker/native/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
#!/usr/bin/env sh
set -eu

RAPI_PTY_PATH="${RAPI_PTY_PATH:-/tmp/rapi_pty}"
EMULATOR_HOST="${EMULATOR_HOST:-localhost}"
EMULATOR_PORT="${EMULATOR_PORT:-8023}"

cleanup() {
for pid in "${NATIVE_PID:-}" "${SOCAT_PID:-}"; do
if [ -n "$pid" ] && kill -0 "$pid" 2>/dev/null; then
kill "$pid" 2>/dev/null || true
fi
done
for pid in "${NATIVE_PID:-}" "${SOCAT_PID:-}"; do
if [ -n "$pid" ]; then
wait "$pid" 2>/dev/null || true
fi
done
}

trap cleanup INT TERM EXIT

echo "Starting serial bridge: ${EMULATOR_HOST}:${EMULATOR_PORT} -> ${RAPI_PTY_PATH}"
socat -d -d \
PTY,link="${RAPI_PTY_PATH}",raw,echo=0,waitslave \
TCP:"${EMULATOR_HOST}:${EMULATOR_PORT}" &
SOCAT_PID=$!

# Wait for socat to create the PTY and connect
echo "Waiting for PTY device ${RAPI_PTY_PATH}..."
timeout=30
while [ ! -e "${RAPI_PTY_PATH}" ]; do
if ! kill -0 "$SOCAT_PID" 2>/dev/null; then
echo "ERROR: socat exited before creating PTY"
exit 1
fi
timeout=$((timeout - 1))
if [ "$timeout" -le 0 ]; then
echo "ERROR: timed out waiting for PTY device"
exit 1
fi
sleep 1
done
echo "PTY device ready: ${RAPI_PTY_PATH}"

/usr/local/bin/openevse --rapi-serial "${RAPI_PTY_PATH}" "$@" &
NATIVE_PID=$!

wait "$NATIVE_PID"
Loading
Loading