AstroSentinel is an Android application that allows users to browse satellites, view them on a 3D map, and interact with an AI chatbot specialized in satellites and space.
The project combines Kotlin (Jetpack Compose) for the mobile app, FastAPI + Python for backend proxy, Ollama for local LLM model, and Cesium + satellite.js for satellite orbit visualization.
-
Satellite List
Displays satellites fetched from CelesTrak.
Each item shows its name, type, and approximate next pass time above the observer’s location (requires location permission; defaults to Warsaw if denied). -
Satellite Details
Displays parsed TLE data (Two-Line Element Set) including orbital parameters (e.g., inclination, eccentricity, mean motion).
Derived metrics such as orbital period are calculated directly in the app. -
3D Map
Interactive globe powered by Cesium.js and satellite.js, showing satellite orbits in real-time.
Clicking a satellite displays its name. -
Space Chat (AI)
A chatbot that answers questions about satellites and orbital mechanics.
Uses Ollama (local LLM server) with the mistral:latest model.
The Android app talks to a small Python proxy (FastAPI), which converts JSON messages into prompts for Ollama.
-
Frontend (Android App):
- Kotlin + Jetpack Compose
- UI Screens: SatelliteListScreen, SatelliteDetailsScreen, MapAllScreen, AskAIScreen
- Location via FusedLocationProvider API
-
Backend (Python Proxy):
- FastAPI REST server
/tle- proxy for CelesTrak (downloads TLE data)/chat- proxy for Ollama (converts JSON -> prompt -> JSON response)
-
Visualization:
- Cesium.js (3D Earth)
- satellite.js (satellite propagation from TLE)
- Cesium Ion (requires free API token)
The next visible pass time is estimated inside the class:
com.example.astrosentinel.util.PassPredictor
It works by:
-
Extracting mean motion from TLE (revolutions per day).
Formula:
(1440 = minutes per day) -
Calculating satellite’s epoch phase based on TLE epoch + longitude offset.
-
Comparing it with the current system time (Instant.now()) to find the next crossing.
This is a simplified predictor – not exact like SGP4, but sufficient for approximate "when will the satellite pass near me" info.
Sources:
- NASA/NORAD TLE format
- satellite.js – reference implementation for orbit propagation
- My own calculation based on mean motion and modular arithmetic on orbital phases
- Python 3.11+
- Android Studio Hedgehog (2023.1.1) or newer
- Ollama installed locally
git clone https://github.com/wiktoriachojnacka/AstroSentinel.git
cd AstroSentinelCreate a virtual environment and install dependencies:
py -3.11 -m venv .venv
.venv\Scripts\activate # Windows
# source .venv/bin/activate # Linux/Mac
pip install -r requirements.txtRun the proxy server:
py -3.11 -m uvicorn main:app --host 127.0.0.1 --port 87881.Install Ollama : https://ollama.com/ 2.Pull and run the model:
ollama pull mistral:latest
ollama run mistral- Open the project in Android Studio
- Run on emulator (Pixel 7 API 34)
- Ensure backend is running (http://127.0.0.1:8788)
Register at cesium.com, generate a free token, and paste it in: app/src/main/assets/cesium/index.html
Cesium.Ion.defaultAccessToken = "YOUR_TOKEN_HERE";- Start python proxy:
py -3.11 -m uvicorn main:app --reload --port 8788- Start Ollama:
ollama run mistral- Run AstroSentinel App in AndroidStudio
LE format official descryption NASA/NORAD: https://celestrak.org/NORAD/documentation/tle-fmt.php
Library satellite.js – counting satelites position: https://github.com/shashwatak/satellite-js
Cesium.js 3D visualization: https://cesium.com/platform/cesiumjs/
FusedLocationProvider – Android docs: https://developer.android.com/training/location
Ollama API doc: https://github.com/ollama/ollama/blob/main/docs/api.md download - https://ollama.com/
FastAPI REST framework: https://fastapi.tiangolo.com/
Wiktoria Chojnacka
