Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
176 changes: 176 additions & 0 deletions .github/workflows/arstack-studio-linux-appimage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,176 @@
name: ARStack Studio Linux AppImage

on:
pull_request:
paths:
- 'apps/arstack_studio/**'
- '.github/workflows/arstack-studio-linux-appimage.yml'
- 'scripts/install-linux.sh'
workflow_dispatch:
inputs:
release_tag:
description: 'Existing GitHub release tag to build, test and attach Linux AppImage; blank = build artifact only'
required: false
type: string

permissions:
contents: read

jobs:
appimage:
name: Build and test Linux x86_64 package
runs-on: ubuntu-22.04

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Use a runner compatible with the downloaded Qt binaries

The new AppImage workflow runs on Ubuntu 22.04 but installs the official Qt 6.10.3 gcc_64 binaries. Qt's supported-platform documentation states that these binaries are built on Ubuntu 24.04 with glibc 2.39 and require rebuilding from source on older glibc versions; Ubuntu 22.04 provides glibc 2.35. Consequently, the Qt build tools and linked Studio executable cannot run on this runner, preventing both PR artifact creation and release publication before packaging completes. Use Ubuntu 24.04 or build a compatible Qt distribution from source.

Useful? React with 👍 / 👎.

timeout-minutes: 55
permissions:
contents: read
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event_name == 'workflow_dispatch' && inputs.release_tag != '' && inputs.release_tag || github.sha }}
fetch-depth: 0

- name: Confirm release identity before packaging
if: ${{ inputs.release_tag != '' }}
env:
GH_TOKEN: ${{ github.token }}
TAG: ${{ inputs.release_tag }}
run: |
set -euo pipefail
test "$(git rev-parse HEAD)" = "$(git rev-parse "$TAG^{commit}")"
gh release view "$TAG" --json isDraft,isPrerelease -q 'select(.isDraft==false and .isPrerelease==false)' > release-check.json
test -s release-check.json

- name: Install Linux native dependencies
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends cmake ninja-build build-essential \
libgl1-mesa-dev libxkbcommon-x11-0 libxcb-cursor0 libxcb-xinerama0 \
libxcb-xkb1 libxcb-randr0 libxcb-image0 libxcb-keysyms1 libxcb-render-util0 \
libfuse2 unzip xvfb libdbus-1-3

- name: Install Qt 6
uses: jurplel/install-qt-action@v4
with:
version: '6.10.3'
arch: linux_gcc_64
modules: 'qtserialport'
cache: true

- name: Compile native Linux Studio and smoke test
run: |
set -euo pipefail
cmake -S apps/arstack_studio -B build-studio-linux -G Ninja \
-DCMAKE_BUILD_TYPE=Release -DARIEC61850_WARNINGS_AS_ERRORS=ON
cmake --build build-studio-linux --target arstack_studio --parallel 2
test -x build-studio-linux/arstack_studio
QT_QPA_PLATFORM=offscreen xvfb-run -a build-studio-linux/arstack_studio --check-reference-template
QT_QPA_PLATFORM=offscreen xvfb-run -a build-studio-linux/arstack_studio --check-p0-policy

- name: Stage Linux app and matched optional release firmware
env:
GH_TOKEN: ${{ github.token }}
TAG: ${{ inputs.release_tag }}
run: |
set -euo pipefail
mkdir -p AppDir/usr/bin AppDir/usr/share/icons/hicolor/512x512/apps
cp build-studio-linux/arstack_studio AppDir/usr/bin/ARStackStudio
cp assets/studio_icon/android-chrome-512x512.png AppDir/usr/share/icons/hicolor/512x512/apps/arstack-studio.png
cat > arstack-studio.desktop <<'DESKTOP'
[Desktop Entry]
Type=Application
Name=ARStack Studio
Exec=ARStackStudio
Icon=arstack-studio
Categories=Education;Science;Electronics;
Terminal=false
DESKTOP
cp LICENSE NOTICE COPYRIGHT.md THIRD_PARTY_NOTICES.md AppDir/usr/bin/
if [ -n "$TAG" ]; then
mkdir -p release-firmware AppDir/usr/bin/firmware AppDir/usr/bin/tools
gh release download "$TAG" --dir release-firmware --pattern 'firmware-manifest.json' --pattern '*.bin'
python3 - <<'PY'
import hashlib,json,pathlib,shutil
root=pathlib.Path('release-firmware')
manifest=json.loads((root/'firmware-manifest.json').read_text())
binfiles=list(root.glob('*.bin'))
assert len(binfiles)==1 and manifest['chip']=='esp32p4', 'Release firmware ambiguity'
src=binfiles[0]
assert hashlib.sha256(src.read_bytes()).hexdigest()==manifest['sha256'], 'Firmware hash mismatch'
output=pathlib.Path('AppDir/usr/bin/firmware')
shutil.copy2(src,output/manifest['image'])
shutil.copy2(root/'firmware-manifest.json',output/'firmware-manifest.json')
(output/'SHA256SUMS.txt').write_text(f"{manifest['sha256']} {manifest['image']}\n")
PY
curl -fLsS https://github.com/esp-rs/espflash/releases/download/v4.5.0/espflash-x86_64-unknown-linux-gnu.zip -o espflash.zip
echo 'dcd7fd822f247df18966935bbb10c7cb4b700c87172349633e9e323ee2542717 espflash.zip' | sha256sum -c -
unzip -j espflash.zip 'espflash' -d AppDir/usr/bin/tools
chmod +x AppDir/usr/bin/tools/espflash
fi

- name: Bundle Qt and create single-file AppImage
uses: miurahr/install-linuxdeploy-action@v1.8.0
id: linuxdeploy
with:
plugins: qt appimage

- name: Generate AppImage and release checksum
env:
QML_SOURCES_PATHS: ${{ github.workspace }}/apps/arstack_studio/qml
VERSION: ${{ inputs.release_tag || 'preview' }}
run: |
set -euo pipefail
export QMAKE="$(command -v qmake6 || command -v qmake)"
${{ steps.linuxdeploy.outputs.linuxdeploy }} \
--appdir AppDir \
--executable AppDir/usr/bin/ARStackStudio \
--desktop-file arstack-studio.desktop \
--icon-file AppDir/usr/share/icons/hicolor/512x512/apps/arstack-studio.png \
--plugin qt --output appimage
shopt -s nullglob
images=( ./*.AppImage )
test "${#images[@]}" -eq 1
mv "${images[0]}" ARStack-Studio-linux-x86_64.AppImage
chmod +x ARStack-Studio-linux-x86_64.AppImage
APPIMAGE_EXTRACT_AND_RUN=1 QT_QPA_PLATFORM=offscreen \
xvfb-run -a ./ARStack-Studio-linux-x86_64.AppImage --check-reference-template
sha256sum ARStack-Studio-linux-x86_64.AppImage > ARStack-Studio-linux-x86_64.sha256

- name: Upload reviewed Linux artifacts
uses: actions/upload-artifact@v4
with:
name: arstack-studio-linux-x86_64
path: |
ARStack-Studio-linux-x86_64.AppImage
ARStack-Studio-linux-x86_64.sha256
if-no-files-found: error
retention-days: 14

attach-verified-release:
name: Attach tested Linux package to exact release tag
needs: appimage
if: ${{ github.event_name == 'workflow_dispatch' && inputs.release_tag != '' }}
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.release_tag }}
fetch-depth: 0
- name: Download Linux build that passed the AppImage checks
uses: actions/download-artifact@v4
with:
name: arstack-studio-linux-x86_64
- name: Verify tag and release before publishing
env:
GH_TOKEN: ${{ github.token }}
TAG: ${{ inputs.release_tag }}
run: |
set -euo pipefail
test "$(git rev-parse HEAD)" = "$(git rev-parse "$TAG^{commit}")"
gh release view "$TAG" --json isDraft,isPrerelease -q 'select(.isDraft==false and .isPrerelease==false)' > release-check.json
test -s release-check.json
sha256sum -c ARStack-Studio-linux-x86_64.sha256
gh release upload "$TAG" \
ARStack-Studio-linux-x86_64.AppImage \
ARStack-Studio-linux-x86_64.sha256
68 changes: 68 additions & 0 deletions .github/workflows/arstack-winget-manifest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: ARStack Studio WinGet Manifest

on:
pull_request:
paths:
- 'scripts/generate_winget_manifest.py'
- 'docs/INSTALL.md'
- '.github/workflows/arstack-winget-manifest.yml'
workflow_dispatch:
inputs:
package_version:
description: 'Unique WinGet package version, e.g. 0.2.0'
required: true
type: string
release_tag:
description: 'Published and verified GitHub stable release tag'
required: true
type: string
installer_type:
description: 'Match the actual installer technology for that release'
required: true
type: choice
options:
- inno
- nullsoft

permissions:
contents: read

jobs:
validate-generator:
name: Validate WinGet manifest generation tool
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
- name: Check Python generator
run: |
python3 -m py_compile scripts/generate_winget_manifest.py
python3 scripts/generate_winget_manifest.py --help

prepare-manifest:
name: Generate exact verified installer manifests
needs: validate-generator
if: ${{ github.event_name == 'workflow_dispatch' }}
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- name: Generate manifest using published installer SHA-256
env:
PACKAGE_VERSION: ${{ inputs.package_version }}
RELEASE_TAG: ${{ inputs.release_tag }}
INSTALLER_TYPE: ${{ inputs.installer_type }}
run: |
set -euo pipefail
python3 scripts/generate_winget_manifest.py \
--version "$PACKAGE_VERSION" \
--tag "$RELEASE_TAG" \
--installer-type "$INSTALLER_TYPE"
grep -R 'InstallerSha256: [0-9A-F]\{64\}' dist/winget

- uses: actions/upload-artifact@v4
with:
name: arstack-studio-winget-manifests
path: dist/winget/
if-no-files-found: error
retention-days: 30
48 changes: 32 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,30 +1,46 @@
# ARStack61850 — Real-Time IEC 61850 Instrumentation Stack
# ARStack61850 — Open-source IEC 61850 Engineering Lab

ARStack61850 is the real-time, hardware-aware evolution of ARIEC61850.
Explore, simulate and test IEC 61850 in your own engineering lab. ARStack61850 combines a portable C++ protocol engine, desktop tools and real-time ESP32-P4 Sampled Values (SV) generation with PTP clock simulation.

> **ARIEC61850 understands IEC 61850. ARStack61850 measures and executes IEC 61850 in real time.**
**[Download the latest release](https://github.com/masarray/arstack61850/releases/latest)** · **[Open the product website](https://masarray.github.io/arstack61850/)** · **[Installation guide](docs/INSTALL.md)** · **[Source code](https://github.com/masarray/arstack61850)**

The portable C++20 stack remains rooted in the ARIEC61850 behavioral model, but the project north star is now broader: build an open, deterministic IEC 61850 instrumentation platform for hardware-timestamped Sampled Values/GOOSE/PTP injection, analysis, commissioning and real-time closed-loop testing.
### Get started

## Public release — Process Bus Simulator M3.H (2026-10-24)
1. Open **Latest release** and download the **Windows Setup** file; the portable package is also available.
2. Install **ARStack Studio** and follow the built-in first-run flow.
3. For real Ethernet SV/PTP experiments, connect a compatible ESP32-P4 Ethernet board and use the **firmware supplied with that same release**. You can explore the desktop interface before connecting hardware.
4. Use a dedicated lab Ethernet connection for SV and PTP experiments.

**Current public laboratory edition: [M3.H Public Stable](https://github.com/masarray/arstack61850/releases/tag/processbus-sim-m3h-20261024).** This is an open-source engineering simulator, **not** a certified merging unit or UTC time reference. No GPS, Omicron, or protection relay is required for an isolated-lab experiment.
**Windows command-line install** (downloads the current stable installer and verifies its SHA-256):

**[Download Setup EXE](https://github.com/masarray/arstack61850/releases/download/processbus-sim-m3h-20261024/ARStack-ProcessBus-M3H-win-x64-setup.exe)** · **[Portable ZIP](https://github.com/masarray/arstack61850/releases/download/processbus-sim-m3h-20261024/ARStack-ProcessBus-M3H-win-x64-portable.zip)** · **[ESP32-P4 firmware](https://github.com/masarray/arstack61850/releases/download/processbus-sim-m3h-20261024/ARStack-ESP32P4-ProcessBus-M3H-firmware.bin)** · [Release notes and engineer quick start](docs/releases/PROCESS_BUS_SIMULATOR_M3H_PUBLIC_20261024.md)
```powershell
$installer = Join-Path $env:TEMP 'arstack-install.ps1'
Invoke-WebRequest 'https://raw.githubusercontent.com/masarray/arstack61850/main/scripts/install-windows.ps1' -OutFile $installer
& $installer
```

**Linux:** An AppImage packaging workflow is available; the [latest release](https://github.com/masarray/arstack61850/releases/latest) lists a Linux download once its build and checks pass. See [Linux install instructions](docs/INSTALL.md). Windows remains the verified desktop installer for the M3.H release.

### What you can explore

- **Sampled Values:** 4 currents + 4 voltages, simulated waveforms and real-time Ethernet output from supported ESP32-P4 hardware.
- **PTP timing:** an internal simulated grandmaster, time-sync controls and on-wire timing evidence.
- **Engineering tools:** SCL, COMTRADE, MMS, GOOSE and other IEC 61850 foundations in the source tree. Features depend on the chosen application and release.
- **Reproducible experimentation:** open-source code, tests, example configurations and release notes.

No external GPS receiver or protection relay is needed to begin exploring the simulator. Network traffic generation is intended for a separate test bench, not an energized operational substation network.

### Verified M3.H milestone

* **ESP32-P4 Ethernet:** 4I+4V IEC 61850 SV publisher, one ASDU, 64-byte samples, 4,000 frames/s, continuous `smpCnt 0–3999` with explicit START/STOP.
* **IEEE 1588 / IEC/IEEE 61850-9-3-style PTP emulation:** isolated-bench **internal simulated Global GM**, Layer-2 Announce/Sync/Follow_Up at approximately 1 Hz, ESP32-P4 EMAC hardware transmit timestamp, phase servo and MAC egress evidence. `smpSynch AUTO` supports `smpSynch=2` after local measured evidence; not an assertion of GPS/UTC traceability.
* **ARStack Studio on Windows:** 4I+4V waveform/phasor controls, capture/reporting, SCL input within supported profile, supervised firmware flashing, verified COM identity and USB hotplug recovery.
* **Actual independent M3.H capture:** **163,048 SV in 40.763 seconds**, 100% `smpSynch=2`, **zero missing, duplicate, counter-reset or malformed SV**, measured **3999.884 fps**, plus 44 PTP Announce and 43 each Sync/Follow_Up. A STOP truncated the requested 120-second capture; 120-second endurance and physical relay locking were **not** tested.
* **Source pinned:** `a922e9bdba4e57a4e88406eb83344455dd8ff142`; **10/10 CI workflows PASS** for the shipped Studio/firmware pairing. The public tag includes only documentation/packaging deltas from that tested build.
* **Release = main:** [PR #299](https://github.com/masarray/arstack61850/pull/299) merged the exact tested source and the public release-tag ancestry into `main` with **14/14 integration CI PASS**; no SV/PTP source drift, no binary re-upload, no loss of newer main docs. Original source Build ID remains `a922e9bdba4e57a4`. See [source-in-main audit](docs/integration/M3H_SOURCE_STACK_AUDIT_2026-10-24.md).
The [24 October 2026 M3.H release](https://github.com/masarray/arstack61850/releases/tag/processbus-sim-m3h-20261024) recorded 163,048 consecutive SV packets over 40.76 seconds, at 3,999.884 frames/s, with `smpSynch=2` across the captured interval and no missing or malformed SV frames. That result is a measured laboratory milestone, not a claim about later builds or external device acceptance. See the [test record](docs/releases/PROCESS_BUS_SIMULATOR_M3H_PUBLIC_20261024.md).

**Release downloads always resolve through [GitHub's latest stable release](https://github.com/masarray/arstack61850/releases/latest)** rather than a hard-coded version. Release notes identify the firmware/software pairing and validated features for each build.

For electrical safety, transmit PTP and SV only on an isolated lab switch/VLAN: never introduce an unsolicited PTP grandmaster or SV publisher onto an operating substation LAN.
---

### Earlier general-purpose Studio releases
## Developer and technical documentation

[v0.1.1](https://github.com/masarray/arstack61850/releases/tag/v0.1.1) remains an earlier Studio release; [v0.1.0](https://github.com/masarray/arstack61850/releases/tag/v0.1.0) retains historical 4I+4V / 4000 fps **`smpSynch=0`** evidence, 10/10 START/STOP and a 3600-second retained run. These older results are not the M3.H measured PTP/SV evidence.
The portable C++20 stack originated from the ARIEC61850 behavioral model. The engineering north star is deterministic IEC 61850 process-bus instrumentation with bounded runtime behavior, protocol evidence and platform-specific hardware timing.

## Start here

Expand Down
18 changes: 9 additions & 9 deletions apps/arstack_studio/README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# ARStack Studio — 4I + 4V SMV Injector / Generator
# ARStack Studio — Desktop IEC 61850 Lab Tool

ARStack Studio is the **canonical native desktop operator surface** for the first ARStack61850 public Sampled Values release. It is a Qt 6 / C++ / QML application; the ESP32-P4 remains the deterministic real-time publisher.
ARStack Studio is the native desktop interface for IEC 61850 Sampled Values experiments and ESP32-P4 process-bus simulation.

> **Newest public process-bus simulator:** [M3.H Lab Edition · 2026-10-24](https://github.com/masarray/arstack61850/releases/tag/processbus-sim-m3h-20261024) (Public Stable · engineering lab simulator). Earlier standalone Studio release: [v0.1.1](https://github.com/masarray/arstack61850/releases/tag/v0.1.1); historical P0 v0.1.0 is unchanged.
>
> **Source mainline:** Released M3.H firmware/Studio source and GitHub Release tag are both ancestors of `main` through [merged PR #299](https://github.com/masarray/arstack61850/pull/299), with 14/14 candidate CI SUCCESS and original `a922e9bdba4e57a4` hardware Build ID preserved in the published firmware.
>
> Install M3.H Setup **and flash its matched ESP32-P4 firmware** (build `a922e9bdba4e57a4`) to use the new PTP SOURCE continuity and simulated Global GM. The older firmware does not gain those features by updating Windows Studio alone.
>
> [Windows Setup EXE](https://github.com/masarray/arstack61850/releases/download/processbus-sim-m3h-20261024/ARStack-ProcessBus-M3H-win-x64-setup.exe) · [Portable](https://github.com/masarray/arstack61850/releases/download/processbus-sim-m3h-20261024/ARStack-ProcessBus-M3H-win-x64-portable.zip) · [firmware BIN](https://github.com/masarray/arstack61850/releases/download/processbus-sim-m3h-20261024/ARStack-ESP32P4-ProcessBus-M3H-firmware.bin)
**[Get the latest release](https://github.com/masarray/arstack61850/releases/latest)** · **[How to install](../../docs/INSTALL.md)** · **[Product website](https://masarray.github.io/arstack61850/)**

On Windows, choose **Setup EXE** or **Portable ZIP** from the release page. For Linux, use an **AppImage** when it appears among the verified assets. For Ethernet output, connect the ESP32-P4 board and load its firmware from the **same release**.

Start with a 4I+4V example, choose the timing mode, adjust voltage/current signals, and press **Start**. This software is made for engineers, students and lab experimenters; a GPS reference or protection relay is not needed just to try it.

The M3.H release recorded verified 4 kHz SV and local simulated PTP traffic. These measurements belong to that specific release; newer builds have their own release notes and evidence.

## M3.H laboratory SV + PTP mode

Expand Down
Loading
Loading