This is the code repository for the VIA (Variability In Atmosphere) Payload firmware for the AERIS mission. VIA is one of three scientific payloads creating the first-ever trimodal, temporally-linked dataset examining upper atmospheric composition (NOx, O3) before, during, and after solar particle events.
AERIS Payload Architecture:
- VIA (spectrometer) - Takes snapshots, triggers GPIO to coordinate other payloads
- SEEs (particle detector) - Continuous recording, Β±2.5s window on VIA trigger
- AMPPs (plasma detector) - Continuous recording, Β±2.5s window on VIA trigger
Temporal Linking (The Key):
VIA controls timing. When VIA captures a spectrum, it pulses GPIO β SEEs and AMPPs capture synchronized Β±2.5s windows β All three datasets bundled with VIA's timestamp β OBC packages for downlink.
Why This Matters: SEEs and AMPPs don't track absolute time - they only count "1 second, 1 second, 1 second." The Β±2.5s buffer captures what happened BEFORE the VIA trigger (pre-event conditions), DURING (the event itself), and AFTER (post-event response). This creates temporally-linked trimodal measurements before, during, and after solar particle events.
VIA payload uses an Avantes AvaSpec-Mini2048CL spectrometer connected to Teensy 4.1 microcontroller acting as a USB host.
The firmware handles:
- USB communication with the AvaSpec spectrometer using the USBHost_t36 library by Paul Stoffregen
- Measurement data collection (4096 bytes / 2048 pixels)
- SD card logging for data backup
- Command console interface via USB Serial
- GPIO trigger output (future) to synchronize SEEs and AMPPs payloads
SATELLITE GROUND STATION
βββββββββββββββββββββββββββββββββββββββ βββββββββββββββββββββββββββββββββββββββ
β β β β
β [VIA Spectrometer] β β β
β ^ β β β
β β β β β
β USB (cmd+data) β β β
β β β β β
β v | | |
β [Teensy 4.1]βββSPI1βββ>[RFM23]~~|~radio~|~~>[RFM23]βββ>[Receiver Teensy] β
β ^ β β β β
β β β β β β
β microUSB (cmd+data) β β USB β
β β β β β β
β v | | | |
β [Pi Zero] β β v β
β ^ β β [Computer] β
β β β β β β
β SSH β β via_ground_station.py β
β β β β β
βββββββββββββββββββββββββββββββββββββββ βββββββββββββββββββββββββββββββββββββββ
β
[Control Computer]
β
via_interactive.py
Satellite Side:
- Control computer SSH's into Pi Zero
via_interactive.pysends commands to Teensy- Teensy 4.1 runs VIA firmware (spectrometer + radio)
- Commands:
sendtriggers measurement β radio transmission - Data saved locally to
~/Aeris/data/via/
Ground Station Side:
- Receiver Teensy runs
radio_receive_test.ino(from Artemis kit) via_ground_station.pycaptures serial output and saves files- Data saved to
~/Aeris/data/via/(same structure as satellite)
Radio Protocol:
- Header:
VIA:4106:(payload type and size) - Data: 60-byte chunks (RFM23 FIFO limit)
- Footer:
:END - Frequency: 433 MHz, GFSK modulation at 2kbps
AvaSpec Spectrometer (USB)
β
Teensy 4.1 (VIA Payload)
ββ SD Card (local logging)
ββ USB Serial (command console)
ββ SPI1 β RFM23 Radio (optional)
Current Version: V4.0 - Integrated Radio Transmission
| Library | Purpose |
|---|---|
| USBHost_t36 | Paul Stoffregen's USB Host library for Teensy - enables direct USB communication with the AvaSpec spectrometer |
| SdFat | High-performance SD card library for data logging |
| pyserial | Python serial communication for the interactive console |
| pty | Unix pseudo-terminal for virtual serial port simulation |
π See QUICKSTART.md for complete workflow
ssh aeris@192.168.120.22
aerisThat's it! The AERIS console handles everything - pick from the menu:
- 1 - VIA Unit Tests
- 2 - VIA Simulation (no hardware needed)
- 3 - VIA HIL Test (real Teensy)
Or use CLI shortcuts:
aeris via test # Run unit tests
aeris via sim # Run simulation
aeris via sim -v # Simulation with verbose output# Build and upload firmware
cd AvaSpecDriver
pio run --target upload
# Run console
./VIA.sh- Download and install VSCode & GitHub Desktop.
- VSCode: https://code.visualstudio.com/download
- GitHub Desktop: https://desktop.github.com/download/
- Install both the C/C++ and PlatformIO extension in VSCode.
- PlatformIO: https://platformio.org/install/ide?install=vscode
- C/C++: https://code.visualstudio.com/docs/languages/cpp
- Clone the repository from GitHub Desktop by clicking "Add" at the top left, "Clone Repository...", "URL," copying the link below into the prompt, and then clicking Clone.
- Repository URL: https://github.com/hsfl/aeris-via-software.git
- Go to VSCode and initialize the PlatformIO extension.
- In the "QUICK ACCESS" column, click on "Open" and then "Open Project" in the tab that opens. Locate and choose the "AvaSpecDriver" folder within the "aeris-via-software" folder.
- This should have opened the AvaSpecDriver folder as a PlatformIO project with all the dependencies and configurations it needs.
- From the explorer column on the left, navigate the AvaSpecDriver folder to "src", then to "main.cpp".
- On the bottom left are multiple buttons; click the checkmark to build the code, confirming a successful build when [SUCCESS] appears on the terminal that pops up.
- That finishes building the software.
To get relevant data, continue to "Getting Data" section.
- AvaSpec Spectrometer: Connect to Teensy 4.1 via USB host port (spliced cable)
- SD Card: Insert into Teensy 4.1 built-in SD card slot
- USB Serial: Connect micro-USB to computer for command console
- Power: Provide 5V power to Teensy 4.1
The AvaSpec USB cable is spliced and connected to Teensy USB Host pads:
- π₯ Red (5V) β Teensy 5V Host Pad
- π© Green (D+) β Teensy D+ Host Pad
- β¬ White (Dβ) β Teensy Dβ Host Pad
- β¬ Black (GND) β Teensy GND Host Pad
D+/Dβ twisted pair maintained for signal integrity.
The firmware provides an interactive command console:
- User sends commands via USB Serial (e.g.,
measure,auto 60) - System collects full spectrum measurement (2048 pixels)
- Data logged to SD card in two formats:
- Raw hex dump:
/meas_XXXX.txt(~12,355 bytes) - CSV format:
/spectrum_XXXX.csv(Pixel,Intensity)
- Raw hex dump:
- CSV data also output via USB Serial for live capture
- Binary: 4,106 bytes (10-byte header + 4,096 bytes pixel data)
- ASCII hex: ~12,355 bytes on SD card (
/meas_XXXX.txt) - CSV: Pixel,Intensity format on SD card (
/spectrum_XXXX.csv) and USB Serial - Future optimization: Raw binary transmission (67% size reduction)
- main.cpp: Command console and measurement sequencing
- AvaSpec.h/.cpp: USB Host driver for AvaSpec spectrometer (commands 0x05, 0x06, 0x0F, 0x13, 0xC0)
- Logger.h/.cpp: SD card logging utility for measurements and telemetry
- OBCBridge.h/.cpp: Optional UART bridge module (future use)
- USB Host: AvaSpec spectrometer connection (spliced cable)
- Serial (USB): Command console and debug output at 115200 baud
- Serial1 (UART): Optional OBC bridge at 115200 baud (TX=1, RX=0)
- SD Card: Built-in Teensy 4.1 SD interface (BUILTIN_SDCARD)
The tests/ directory contains a complete test suite for development without hardware:
- test_data_generator.py: Generates realistic spectrum data
- test_python_scripts.py: 10+ unit tests for data processing
- virtual_serial_port.py: Simulates Teensy firmware for interactive testing
- run_all_tests.sh: Automated test runner
Run all tests:
cd tests
./run_all_tests.shSee tests/README.md for details.
The test suite uses Python standard library only (no external dependencies required):
| Library | Purpose |
|---|---|
unittest |
Test framework and assertions |
csv |
Reading/writing spectrum CSV files |
struct |
Binary data packing/unpacking |
pty + os |
Virtual serial port creation (Linux/Mac) |
threading |
Concurrent virtual serial port handling |
subprocess |
Running test scripts |
pathlib |
Cross-platform file path handling |
datetime |
Timestamped session folders |
No pip install required - works on any system with Python 3.6+.
Simulate the full system locally:
aeris via sim # Runs virtual serial port + console automaticallyOr manually:
cd tests && python3 virtual_serial_port.py &
./VIA.sh /tmp/ttyVIA0The simulation and hardware-in-loop (HIL) tests use the same interactive console - only the data source differs:
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β scripts/via_interactive.py β
β (parses serial data, progress bars, saves files) β
β β
β Detects: "Starting Measurement", "CSV DATA OUTPUT:", etc. β
β Saves: ~/Aeris/data/via/YYYYMMDD.HHMM/*.csv β
ββββββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββββββββ
β
ββββββββββββββββ΄βββββββββββββββ
β β
βΌ βΌ
/tmp/ttyVIA0 /dev/ttyACM0
(virtual port) (real Teensy)
β β
βΌ βΌ
βββββββββββββββββββββββββββ βββββββββββββββββββββββββββββββββββββββ
β tests/ β β AvaSpecDriver/src/ β
β virtual_serial_port.py β β main.cpp (command console) β
β test_data_generator.py β β AvaSpec.cpp (USB host + output) β
β β β AvaSpec.h (protocol constants) β
β Generates: β β β
β - Gaussian peaks β β Reads from: β
β - Fake hex data β β - Real AvaSpec spectrometer β
β - Simulated responses β β - 4106 bytes per measurement β
βββββββββββββββββββββββββββ βββββββββββββββββββββββββββββββββββββββ
β β
ββββββββββββββββ¬βββββββββββββββ
β
βΌ
SAME OUTPUT FORMAT
ββ VIA> prompt
ββ "Starting Measurement #N"
ββ Hex dump (257 lines, 16 bytes each)
ββ "CSV DATA OUTPUT:" + 2048 rows
ββ "Measurement Complete!"
Key insight: If it works in simulation, it will work on real hardware.
A dedicated Raspberry Pi 400 serves as the remote testing machine for both VIA and SEEs payloads.
ssh aeris@192.168.120.22
aerisThe AERIS console provides:
- 0) Dual Console - VIA+SEES side-by-side in tmux
- 1) Unit Tests - Automated Python test suite
- 2) Simulation - Virtual serial port with fake data
- 3) HIL Test - Real Teensy hardware
- 7) Update Code - Pull latest from git
- 8) Data Viewer - Browse and plot captured data
- 9) HIL Deploy - Flash firmware and run hardware tests
aeris via test # Run unit tests
aeris via sim # Run simulation
aeris via sim -v # Verbose mode
aeris update # Pull latest code
aeris help # Show all commands| Method | Command |
|---|---|
| SSH (same network) | ssh aeris@192.168.120.22 |
| Tailscale (remote) | ssh aeris@<tailscale-ip> |
The AERIS Control Panel includes a Dual Console Mode that runs VIA and SEES side-by-side in tmux, enabling synchronized captures for temporally-linked bimodal data.
| Shortcut | Action |
|---|---|
Ctrl-a m |
Synchronized capture - sends measure to VIA and snap to SEES |
Ctrl-a o |
SEES on (start buffering) |
Ctrl-a f |
SEES off (stop buffering) |
Ctrl-a n |
Switch to next pane |
Ctrl-a q |
Quit and return to menu |
When you press Ctrl-a m, both payloads capture simultaneously:
- VIA: Takes a full spectrum measurement (2048 pixels)
- SEES: Saves a Β±2.5s snap window (captures pre-event and post-event particle data)
Both files are timestamped identically, creating correlated datasets:
The AERIS console includes a built-in data viewer (option 9) for browsing and plotting captured data files.
View individual VIA measurements with CSV preview and ASCII spectrum plot:
View temporally-linked VIA+SEES pairs together, showing both the spectrum and particle data from the same capture moment:
- Install AvaSoft software https://www.avantes.com/products/software/avasoft/
- Connect the VIA USB port directly to the PC
- Start collecting data and zoom in
- V1.0: β Standalone testing - USB to spectrometer, SD card logging
- V2.0: β UART bridge to OBC (deprecated in V3.0)
- V3.0: β Command console mode - Interactive control, dual CSV output
- V4.0: π Full system (AERIS iOBC) - Merge into AERIS FSW, EPS/ADCS integration
- Create Initial Driver
- Validate Teensy and Spectrometer USB Ports can connect
- Attempt Identification Command & Response to validate communication
- Attempt Measurement Commands and read the "Unsolicitated" data messages
- Read all 10 + 4096 bytes of data from a full measurement
- Graph data by sending to computer Serial Port and graphing through MATLAB
- Write data into SD Card storage
- Implement command console interface (V3.0)
- Dual CSV output (Serial + SD)
- Python data capture utilities
- Optimize for binary data transmission (67% size reduction)
- Define Payload-to-Bus Software ICD fields for packetized CSV transmission
- Add command handlers for remote "Start/Stop/Config" through spacecraft command bus
- Integrate RPI connection code on Artemis OBC side
- Interface into flat-sat testing environment
- Full integration with Artemis spacecraft bus software
GitHub: https://github.com/hsfl/aeris-via-software
License: MIT (see LICENSE file)
Three setup scripts in ~/Desktop/Work/Aeris/ configure the Pi 400 testing machine:
Installs system packages, Python environment, PlatformIO, and creates helper scripts.
Installed Packages:
- git, curl, wget, vim, htop, screen, tmux, tree, build-essential
- python3, python3-pip, python3-venv, python3-dev
- pyserial, matplotlib, numpy, scipy, pandas
- platformio, gh (GitHub CLI)
Shell Aliases (added to ~/.bashrc):
| Alias | Description |
|---|---|
aeris |
cd ~/Aeris |
via |
cd ~/Aeris/aeris-via-software |
sees |
cd ~/Aeris/aeris-sees-software |
via-test |
Run VIA unit tests |
via-console |
Launch VIA interactive console |
via-build |
Download VIA firmware from GitHub |
via-flash |
Flash VIA firmware to Teensy |
sees-test |
Run SEES unit tests |
sees-console |
Launch SEES interactive console |
sees-build |
Download SEES firmware from GitHub |
sees-flash |
Flash SEES firmware to Teensy |
aeris-status |
Show system status (Python, PlatformIO, USB, repos) |
ports |
List serial ports (/dev/ttyACM*, /dev/ttyUSB*) |
usb |
List connected USB devices (Teensy, FTDI, CP210, CH340) |
Installs the aeris.up command to ~/.local/bin/ for launching the AERIS Control Panel.
Usage:
aeris.up # Interactive menu
aeris.up via sim # VIA simulation
aeris.up via test # VIA unit tests
aeris.up via # VIA hardware console
aeris.up sees sim # SEES simulation
aeris.up sees test # SEES unit tests
aeris.up sees # SEES hardware console
aeris.up update # Pull latest code from git
aeris.up help # Show all commandsOptions:
-vor--verboseβ Enable verbose mode (show all output)
Interactive Menu Options:
| Key | Action |
|---|---|
| 0 | Dual Console (VIA+SEES in tmux) |
| 1 | VIA Unit Tests |
| 2 | VIA Simulation |
| 3 | VIA HIL Test |
| 4 | SEES Unit Tests |
| 5 | SEES Simulation |
| 6 | SEES HIL Test |
| 7 | Update Code (git pull) |
| 8 | Data Viewer |
| 9 | HIL Deploy (flash firmware) |
| E | Exit |
Clones/updates the AERIS repositories and downloads firmware binaries.
Actions:
- Clones
aeris-via-softwareandaeris-sees-softwarefrom GitHub - Configures git user name and email
- Authenticates GitHub CLI for artifact downloads
- Creates firmware download/flash scripts
- Downloads latest firmware binaries from GitHub Actions
Created Scripts:
| Script | Description |
|---|---|
~/Aeris/via_build.sh |
Download VIA Teensy firmware + native binary |
~/Aeris/via_flash.sh |
Flash VIA firmware to connected Teensy |
~/Aeris/sees_build.sh |
Download SEES Teensy firmware + native binary |
~/Aeris/sees_flash.sh |
Flash SEES firmware to connected Teensy |
Directory Structure Created:
~/Aeris/
βββ aeris-via-software/ # VIA payload repo
βββ aeris-sees-software/ # SEES payload repo
βββ firmware/
β βββ via/firmware.hex # VIA Teensy firmware
β βββ sees/firmware.hex # SEES Teensy firmware
βββ bin/
β βββ via_native # VIA simulation binary
β βββ sees_native # SEES simulation binary
βββ data/
β βββ via/ # VIA measurement data
β βββ sees/ # SEES particle data
βββ logs/
βββ backups/
βββ docs/
AERIS Payload Software Team - Hawaii Space Flight Laboratory
2025










