Skip to content

ecstra/NOUAR

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

nouar_os_logo

NOUAR (Navigation Oriented Unmanned Astral Regulator) is a system for automating ship lighting based on precise astronomical events using only onboard GPS data. The goal is to remove manual intervention and keep lighting behavior consistent across vessels regardless of location.

This repository now includes the core computation layer, an early-stage UI, and a custom OS pipeline for embedded deployment.


Current Status

This is an early-stage implementation.

What exists right now:

  • Solar time calculation (sunrise and sunset)
  • NMEA $GPRMC parser
  • Date and time primitives
  • Accuracy validation against NOAA and USNO datasets
  • Local GUI (Slint-based, partially implemented)
  • Custom Buildroot-based OS for Raspberry Pi 5
  • Docker-based cross-compilation pipeline

What does not exist yet:

  • Scheduler
  • Relay control
  • Full device integration
  • Complete mode system (harbor, sailing, anchor)
  • etc.

Features

GPS Parsing

  • Parses $GPRMC sentences and validates checksum (XOR)
  • Extracts latitude, longitude (decimal degrees), UTC date and time
  • Handles hemisphere signs correctly
  • Rejects invalid, inactive, or malformed sentences

Solar Calculation

  • Computes sunrise and sunset from latitude, longitude, and date
  • Fully UTC-based
  • Handles edge cases like midnight wraparound and orbital drift differences
  • Validated against NOAA and USNO datasets

Time and Date Core

  • Dmy (date): strict parsing (dd-mm-yyyy or dd/mm/yyyy), leap year aware, strongly validated with typed errors
  • Hms (time): supports 24h and 12h formats, conversion from fractional hours, correct rounding, and overflow handling across seconds, minutes, and hours

GUI (Work in Progress)

  • Built using Slint (direct DRM rendering, no compositor required)

  • Local, offline-first interface

  • Current state:

    • 1 of 2 primary screens implemented
    • Navigation screen available
  • Includes:

    • Central UI entry via Slint runtime
    • Componentized inputs
    • Global theming system

Embedded OS

  • Custom OS built using Buildroot for Raspberry Pi 5

  • Cross-compiled via Docker for reproducible builds

  • Includes:

    • Root filesystem overlays
    • Custom boot splash
    • Preconfigured runtime environment for NOUAR
  • GPU stack enabled:

    • KMS/DRM
    • Mesa
    • vc4
    • seatd
  • Font configuration fixed for Slint/Skia (Space Grotesk included)


Accuracy

Solar calculations are tested against real-world datasets.

NOAA

  • Average absolute error: ~26s
  • Accuracy within ±75s: 100%

USNO

  • Accuracy within ±35s: 100%

Notes:

  • NOAA data is local-time based and converted to UTC, which introduces ~50–60s drift near day boundaries due to orbital progression.
  • USNO data is strictly UTC-aligned, so comparison is tighter.

Example

use lib_gps::parse_gprmc;
use lib_solar_calculator::calculate_solar_time;
use common::{dms::Dms, coord::Coord};

let sentence = "$GPRMC,...*46";
let nmea = parse_gprmc(sentence)?;

println!("{}", nmea);
// Lat: xx.xxxxxx, Lon: xx.xxxxxx, Date: dd-mm-yyyy, Time: HH:MM:SS

let sunrise = calculate_solar_time(
    Coord { ... },
    Dms { ... },
    true // false -> sunset
);

println!("{}", sunrise);
// HH:MM:SS

Running Tests

cargo test --workspace

Covers:

  • Date parsing
  • Time parsing and conversion
  • GPS parsing (valid and invalid cases)
  • Solar calculation against external datasets

Design Notes

  • GPS is the only time source
  • Everything runs in UTC to avoid timezone drift
  • Parsing is strict, not permissive
  • Errors are explicit and typed
  • UI is local-only and does not depend on network or external services
  • System is designed to run on a minimal custom OS, not a general-purpose distro

Roadmap

Planned next steps:

  • Complete remaining UI screens
  • Scheduler engine (event-driven)
  • Hardware abstraction layer for relays
  • Mode system (GPS, Manual, Switch)
  • Grouping and bulk operations
  • Full integration with embedded runtime

Stack

  • Rust (workspace-based)
  • Slint (UI, DRM rendering)
  • Buildroot (custom OS)
  • Docker (cross-compilation pipeline)
  • Raspberry Pi 5 target

About

Embedded OS For NOUAR, an automation project.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors