Skip to content

Real-time data visualization system designed specifically for our CanSat mission. Communicates between the onboard microcontroller and the ground station via our radio communication module.

License

Notifications You must be signed in to change notification settings

mikeedudee/CanSatTelemetrySoftware

Repository files navigation

⚠️ Disclaimer

This repository contains a preview version of the Telemetry Software for our experimental rocket "Hanggang Sa Dulo".
Please note that this source code is not finalized and remains under active development.
Unresolved bugs, incomplete features, and performance issues may occur.

Use with caution and make sure to install all the dependencies, especially the required CUDA version for your system, so that it will run accordingly, as it may affect your hardware.

CanSatTelemetrySoftware

Python Version License

Real-time data visualization system designed specifically for our CanSat mission. Communicates between the onboard microcontroller and the ground station via our radio communication module.


PREVIEW

Login Page Screenshot 2025-04-07 164517

Dashboard Screenshot 2025-04-07 163457


Table of Contents

  1. Features
  2. Architecture & Module Layout
  3. Prerequisites
  4. Installation & Dependencies
  5. IMPORTANT!
  6. Usage

Features

  • Real-time serial-port telemetry
    • Auto-detect available COM ports
    • Parse and validate 14 telemetry channels (pressure, GPS, attitude, etc.)
    • Compute horizontal speed via Haversine formula
  • Offline map integration
    • Pan/zoom over cached map tiles using tkintermapview
    • Plot current GPS track & waypoints
  • Responsive GUI
    • CustomTkinter theme & layout
    • Configurable widgets, buttons, status indicators
    • Real-time 3-dimensional trajectory/flight-path projection
  • User authentication
    • Simple login screen with bcrypt-encrypted credentials
  • Performance monitoring
    • Optional GPU acceleration via cupy
    • System stats overlay using psutil & GPUtil

Architecture & Module Layout

We follow a layered structure mirroring clean-architecture principles:

  • core/ (Domain Logic)
    • geo_utils.py ― Haversine & coordinate-conversion utilities
  • main
    • newui7_stable_rebuild_offlinemap.py ― Main dashboard & map widgets
    • login.py ― Login dialog and credential management
  • assets
    • CanSat Compe Logo.png - Competition Logo
    • Flag_of_the_Philippines.jpg — Philippine Flag
    • HsD Logo.png - Our group's Logo
    • hsd_logo_Fxh_icon.ico — Software's Logo
    • IAU Logo.png - Our University's Logo
    • syae.png - Our department Logo
  • assets\3dMeshes
    • cylinder.stl - For the Attitude Visualization 3d Object

Prerequisites

  • OS: Windows 10/11, macOS, or Linux
  • Python: ≥ 3.11 (3.11+)

    Tested in an environment of Python: v3.11.9 (tags/v3.11.9:de54cf5, Apr 2 2024, 10:12:12) [MSC v.1938 64 bit (AMD64)] on win32.

    Incompatibility may occur at your instance.

  • Hardware:
    • USB-serial adapter or onboard COM port
    • GPU with CUDA support

      Tested in an environment of CUDA Build: cuda_12.9.r12.9/compiler.35813241_0 (V12.9.41).

      Incompatibility may occur at your instance.


Installation

  1. Clone the repository
    git clone https://github.com/mikeedudee/CanSatTelemetrySoftware.git
    cd CanSatTelemetrySoftware
    
  2. Dependencies
    • customtkinter
    • pyserial
    • tkintermapview
    • cupy
    • psutil
    • GPUtil
    • matplotlib
    • numpy
    • numpy-stl
    • memory-profiler
    • bcrypt
    • pywinstyles
    • Pillow
  • You can install them all at once using the command below:

    pip install customtkinter pyserial tkintermapview cupy psutil GPUtil matplotlib numpy numpy-stl memory-profiler bcrypt pywinstyles Pillow
  • Or Install them with:

    pip install -r requirements.txt

Note:

Ensure you’re using a compatible Python 3.x interpreter.

  • For GPU acceleration, cupy must match your CUDA toolkit version. Please do be aware that some cupy builds might not support the latest versions of Python; you might need to use an environment that supports your cupy build. See Prerequisites for more info.
  • tkinter comes with the standard library, but on some Linux distributions, you may need to install python3-tk.

Usage:

Before running the file make sure to install all the pre-requisites and make sure to have a compatible CUDA version installed on your system; otherwise, it will not work.

To run, you can skip the login.py and go directly to the "newui7_stable_rebuild_offlinemap.py". If you wish to see it working and integrated into your system, your CanSat must provide the following format, or modify the reading formatting directly to suit your needs.

  • The Format
    • Pressure ― Pressure reading from MS5611 or any sensor capable of providing such.
    • Relative_Altitude — Derived from the pressure data or simply from any data gathered from a sensor.
    • Main Sensor Temperature — From your main sensor reading of temperature.
    • Backup Temperature — From your backup temperature sensor.
    • Latitude — Latitude reading from the GPS.
    • Longitude — Longitude reading from the GPS.
    • SD Card Status — Must be 0 or 1 value.
    • Elapsed Time — Time starting from the initialization of the CanSat.
    • Sensor Accurary — Accurary state of your Inertial Measurement Unit (IMU) or any 9-DoF sensor (if capable).
    • Yaw — Yaw reading for your Inertial Measurement Unit (IMU).
    • Pitch — Pitch reading for your Inertial Measurement Unit (IMU).
    • Roll — Roll reading for your Inertial Measurement Unit (IMU).
    • Velocity — Vertical velocity reading (derived or accessed) from the sensor
    • Absolute Altitude — The fixed altitude from sea level.

To make the GPS work offline, make sure you downloaded the maps of your place or the location of the launch site and run a python command line at that map JSON folder:

python -m http.server 8000

Download offline maps

  • Download Mobile Atlas Creator

    1. Select a Map Source:

      • Open MOBAC and choose the desired map source from the list (for example, OpenStreetMap, OpenCycleMap, etc.).
    2. Define the Area:

      • Use the map view to navigate to the region you want to download tiles for. You can either draw a bounding box or select a predefined region.
    3. Choose Zoom Levels:

      • In the interface, select the zoom levels you need. The more zoom levels you select, the larger (and more detailed) the downloaded atlas will be.
    4. Select an Atlas Format:

      • Under the “Atlas Format” options, choose the format that suits your needs. For offline tile serving, you can select a “Tile Directory” (which saves tiles in a folder structure like {z}/{x}/{y}.png) or an MBTiles format if your offline viewer supports it.
    5. Create the Atlas:

      • Click the “Create Atlas” button. MOBAC will download the tiles for the specified region and zoom levels and save them in your chosen format.
    6. Serve the Tiles Locally:

      • If you select a tile directory, you can then run a local HTTP server (e.g., using Python’s http.server module) in that folder so your application can use them offline.
    7. Export your atlas as an MBTiles file and then convert it into a folder structure. You can use a tool like mbutil to extract the tiles. For example, after exporting your MBTiles file (e.g., myatlas.mbtiles), install mbutil via pip:

    pip install mbutil
    mb-util myatlas.mbtiles offline_tiles
    • This command will create a directory structure with folders for each zoom level and the tiles organized as {z}/{x}/{y}.png.
    • We can now point the software's map server to this local directory served via a local HTTP server (using, for example, Python's built-in server):
     cd offline_tiles
     python -m http.server 8000

    This is the listener that allows it to do that (for your reference): tile_server="http://localhost:8000/{z}/{x}/{y}.png"

About

Real-time data visualization system designed specifically for our CanSat mission. Communicates between the onboard microcontroller and the ground station via our radio communication module.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages