Skip to content

Commit

Permalink
Av 1128 consolidate gss (#44)
Browse files Browse the repository at this point in the history
* lovely data

* feather test packet

* add mainpy

* edit mainpy

* Co-authored-by:
Aaditya Voruganti
<aaditya-voru@Aadityavoru
 mpkarpov-ui <[email protected]>

* added mqtt

Co-authored-by: mpkarpov-ui <[email protected]>

* added content

* high bandwidth added

* optimizing json parsing

* optimize combiners

* I'm him. (Removed out of order error and integrated with GSS)

* soft meeting 4/11

* testing 4/11

* Removed packet dropping -- may be out of order

* range test 4/12 final

* add static ip

* general refactor and improvements

* added some changes to offline maps

* added map functionality

* more issue fixes

* maps work yay

* fixed mapy

* made it look nicer and removed unesscary code chunks

* now called Mappy

* fixed ground

* fixed it

* changed bindings

* fixed the code to change frequency on a whim

* Documentation changes

* fix doc embed

* Move system architecture to more reasonable location

* Add usage help

* qol and disable control stream

* edit common packet

* fixed pull

* New telem packet (#46)

* added changes

* fixed to new telem packet

* fixed everything else

* made some fixes

* correct freq

* fixed the mistakes on the review

* fixed telem packet and added tilt_angle

* new test packet

* added RSSI

* actually new packet

* added frequency

* REAL FINAL PACKET THIS TIME

* added FSM_state and satcount

* working

* added chnages to tilt

* added some comments to make it easier

* Update main.cpp

* Fix GPS Coordinates

* added transmission settings

* fixed the decoding

* added drone code

* added new authors

* added frequency input

* added all the drone code

* fixed a small error

* fixed the issue of is_sustainer

* added fixes

* add relay func to gss_combiner

* resolve main merge

* fixed is_sustainer

* weird queue issue

* added timeouts

* added timings but it is till notnworking 100%

* change frequencies and output

* pre-rewrite

* added the frequency part back

* refactor and remove dupe packets

* added freq writing and easy config files

* doc improvements

* doc pass

* config change and doc improvements

* actually commit readme

* health update

* final telemetry health fixes

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* fixes for git conflict

* set freq local bug fix

* fixed some bugs on relay

* fixed all decoding

* fixed the relay stuff

* misc combiner fixes

* push latest

* Final combiner fixes

* added frequency polling

* added battery voltage

* added changes

* combiner fix + relay packet

* fsm satcound hb detect

* store changes

* hb detect

* push the chabnfges

* FINAL CODE FOR MICHAEL HE WILL NOT WRITE CODE EVER AGAIN

* Fix minor change

* Make system more stable

* Add other minor fixes

* Remove extraneous pyc files

---------

Co-authored-by: mpkarpov-ui <[email protected]>
Co-authored-by: mpkarpov-ui <[email protected]>
Co-authored-by: zyunlam <[email protected]>
Co-authored-by: Zyun Lam <[email protected]>
  • Loading branch information
5 people authored Oct 6, 2024
1 parent ef01db3 commit de66dd4
Show file tree
Hide file tree
Showing 42 changed files with 9,560 additions and 314 deletions.
101 changes: 101 additions & 0 deletions champaign_county_map.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
<!DOCTYPE html>
<html>
<head>

<meta http-equiv="content-type" content="text/html; charset=UTF-8" />

<script>
L_NO_TOUCH = false;
L_DISABLE_3D = false;
</script>

<style>html, body {width: 100%;height: 100%;margin: 0;padding: 0;}</style>
<style>#map {position:absolute;top:0;bottom:0;right:0;left:0;}</style>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/leaflet.js"></script>
<script src="https://code.jquery.com/jquery-3.7.1.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/Leaflet.awesome-markers/2.0.2/leaflet.awesome-markers.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/leaflet.css"/>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css"/>
<link rel="stylesheet" href="https://netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css"/>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/[email protected]/css/all.min.css"/>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/Leaflet.awesome-markers/2.0.2/leaflet.awesome-markers.css"/>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/python-visualization/folium/folium/templates/leaflet.awesome.rotate.min.css"/>

<meta name="viewport" content="width=device-width,
initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<style>
#map_484c021280c263d5a21b25e3fcea911f {
position: relative;
width: 100.0%;
height: 100.0%;
left: 0.0%;
top: 0.0%;
}
.leaflet-container { font-size: 1rem; }
</style>

</head>
<body>


<div class="folium-map" id="map_484c021280c263d5a21b25e3fcea911f" ></div>

</body>
<script>


var map_484c021280c263d5a21b25e3fcea911f = L.map(
"map_484c021280c263d5a21b25e3fcea911f",
{
center: [40.1397, -88.2001],
crs: L.CRS.EPSG3857,
zoom: 10,
zoomControl: true,
preferCanvas: false,
}
);





var tile_layer_50a2541f98e0874f9d1ac8357b59712d = L.tileLayer(
"https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",
{"attribution": "Data by \u0026copy; \u003ca target=\"_blank\" href=\"http://openstreetmap.org\"\u003eOpenStreetMap\u003c/a\u003e, under \u003ca target=\"_blank\" href=\"http://www.openstreetmap.org/copyright\"\u003eODbL\u003c/a\u003e.", "detectRetina": false, "maxNativeZoom": 18, "maxZoom": 18, "minZoom": 0, "noWrap": false, "opacity": 1, "subdomains": "abc", "tms": false}
);


tile_layer_50a2541f98e0874f9d1ac8357b59712d.addTo(map_484c021280c263d5a21b25e3fcea911f);

var marker_125b7991b2c0946e1581fabdc4b0ecb9 = L.marker(
[40.1164, -88.2434],
{}
).addTo(map_484c021280c263d5a21b25e3fcea911f);


var marker_a7e177cd715ebda9d48d70525727f200 = L.marker(
[40.1234, -88.2615],
{}
).addTo(map_484c021280c263d5a21b25e3fcea911f);


var marker_3faf02c3d567179b6c1620b853a2c39e = L.marker(
[40.1629, -88.1506],
{}
).addTo(map_484c021280c263d5a21b25e3fcea911f);


var marker_8394c4815e0393898bb77b323b905617 = L.marker(
[40.2284, -88.2614],
{}
).addTo(map_484c021280c263d5a21b25e3fcea911f);


var marker_fa26a8bb9167b6becceacefd68158c25 = L.marker(
[40.0971, -88.2017],
{}
).addTo(map_484c021280c263d5a21b25e3fcea911f);

</script>
</html>
1 change: 1 addition & 0 deletions ground/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
.vscode/c_cpp_properties.json
.vscode/launch.json
.vscode/ipch
*.pyc
176 changes: 176 additions & 0 deletions ground/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,176 @@
# GSS v1.1
This is the primary source of information for all things related to **GSS 1.1**, the telemetry system used for Spaceshot's 2024 launch of *Kairos II* at FAR 51025!

## Contributors

- Nicholas Phillips
- Gautam Dayal
- Patrick Marschoun
- Peter Giannetos
- Aaditya Voruganti
- Michael Karpov

System architecture:

Changes from **GSS 1.0**: Unlike GSS 1.0, the new system uses a single laptop to combine streams from our antenna array and send out the data to a network, with all other data consumers subscribing to a stream over [MQTT](https://mqtt.org/). Additionally, this architecture allows us to implement other systems into our ecosystem which use telemetry data but would otherwise slow down our telemetry computers.

![System Architecture](https://i.ibb.co/YtWs14w/Screenshot-2024-04-16-190354.png)

# Telemetry Recievers
This section refers to the Feather Reciever software which is stored at `./src/feather`.

This repository contains the software for the ground station hardware (LoRa Feather module) used by the Spaceshot Telemetry Team during the 2023-24 season.

## Description

The ground station software is responsible for receiving telemetry data from the rocket, processing commands sent from the ground station GUI, and interfacing with the LoRa Feather module. It includes functionalities such as setting frequency, sending commands to the rocket, and parsing telemetry data.

## Features

- Receive telemetry data from the rocket
- Send commands to the rocket
- Interface with the ground station GUI through serial communication
- Parse incoming commands from the ground station GUI
- Set frequency for communication with the rocket
- Decode and process telemetry data packets
- Handle errors and retries in command transmission

## Dependencies

- [RH_RF95 library](https://github.com/PaulStoffregen/RadioHead) - for LoRa communication
- [SPI library](https://github.com/PaulStoffregen/SPI) - for SPI communication
- [SerialParser library](link-to-serial-parser-library) - for parsing serial input

## Usage

1. Connect the LoRa Feather module to the ground station hardware.
2. Upload the appropriate version of the code to the ground station hardware using the Arduino IDE or compatible software.
- **For Ground Station**: Upload the code with `IS_GROUND` defined.
- **For Drone**: Upload the code with `IS_DRONE` defined.
3. Open the serial monitor to view output messages and interact with the ground station GUI.
4. Follow the commands and instructions provided by the ground station GUI to control the rocket and receive telemetry data.

## Configuration

- Adjust default frequencies (`RF95_FREQ`, `SUSTAINER_FREQ`, `BOOSTER_FREQ`, `GROUND_FREQ`) as needed for your application.
- `RF95_FREQ` is used only when `IS_GROUND` is active
- `SUSTAINER_FREQ`, `BOOSTER_FREQ`, `GROUND_FREQ` is used only when `IS_DRONE` is active

## Flashing Instructions

### Ground Station

It is used for the typical feathers on the ground and will be able to receive any code either directly from the rocket or from the drone relay.

1. Connect the ground station hardware to your computer.
2. Open the Arduino IDE or compatible software.
3. Load the code with `IS_GROUND` defined.
4. Compile and upload the code to the ground station hardware.

### Drone

This code is used by feathers to relay information via a drone from the rocket to ground, this is for better connectivity when the rocket is further away from us or is covered by earth elements.

1. Connect the drone hardware to your computer.
2. Open the Arduino IDE or compatible software.
3. Load the code with `IS_DRONE` defined.
4. Compile and upload the code to the drone hardware.







To upload to the reciever you must navigate to the `ground` directory and use the `Platformio` vscode extension and upload using either the `feather` or `drone` build environments.
Alternatively use the `pio` command like so:

```bash
$ pio run -t upload -e <feather/drone>
```

# Ground Station Combiner
This section refers to the Ground Station Combiner software which is stored at `./gss_combiner`.
## Installation and Operation
First, begin by cloning the repository to your computer (or opening it) and opening the `gss_combiner` folder:

```bash
$ git clone https://github.com/ISSUIUC/MIDAS-Software.git
$ cd ./MIDAS-Software/ground/gss_combiner
```

To install dependencies for the combiner, you can run:
```bash
$ pip install -r requirements.txt
```

*(MK) TODO: Add requirements.txt file.*

Then, you can run the combiner using **Python**:

```bash
$ python ./main.py <options>
```

`<options>` refers to a set of command line arguments that can be passed to `main.py`, listed below:

`--booster <COM1,COM2,COM3,...>`: Pass in a comma-separated list of COM ports to receive telemetry from, and transmit to the `Booster` data topics.

`--sustainer <COM1,COM2,COM3,...>`: Pass in a comma-separated list of COM ports to receive telemetry from, and transmit to the `Sustainer` data topics.

`--relay <COM1,COM2,COM3,...>`: Pass in a comma-separated list of COM ports to receive telemetry from, specifically for the `Drone Relay` system.

`--local (alias -l)`: Use `localhost` as the MQTT target. Useful for debugging.

`--no-log (alias -n)`: Do not generate logs for this run.

`--verbose (alias -v)`: Print out all combiner actions. This may slow down the combiner due to print volume.

`--no-vis (alias -nv)`: Disable the visualization for system health (Also disabled with `--verbose`).

`--config <config> (alias -c)`: Load an argument configuration from the `config.ini` file

`--no-rf`: Skip overriding RF frequencies for the feather reciever.

`--help (alias -h)`: Display a set of these options.


Not including sustainer / booster sources will throw a warning, but will still run the system, allowing you to check the connectivity for the backend MQTT broker.

### For Kairos II Summer Launch 2024:
The `config.ini` file will be updated to include all necessary configuration within the `launch` config. As such you will only need to edit the COM ports present in the file, and you will be able to execute the system with the command

```bash
$ python ./main.py -c launch
```


Additionally, for this launch we have adopted the following lookup scheme for determining the stage callsign:

| Callsign bit value (highest bit of `fsm_callsign_satcount`) | Callsign |
| ----------------------------------------------------------- | -------- |
| 0 | KD9ZPM |
| 1 | KD9ZMJ |


## MQTT Streams
This system uses [MQTT](https://mqtt.org/) as the primary data transfer method to other sections of the telemetry system. This is accomplished using multiple data streams. While technically unsecured, `data` streams are intended to be read-only (and only written to by this service), while `control` streams are intended to allow control of the system. As of writing (4/16), the current accepted data streams for GSS 1.1 are the following:

`FlightData-All` (`data`): Subscribe to receive all telemetry packets (Both booster and sustainer)

`FlightData-Sustainer` (`data`): Subscribe to receive sustainer telemetry packets

`FlightData-Booster` (`data`): Subscribe to receive booster telemetry packets

`Control-Sustainer` (`control`): Publish to edit Sustainer telemetry system functionality.

`Control-Booster` (`control`): Publish to edit Booster telemetry system functionality.

`Common` (`control / data`): Data published by auxiliary services or non-critical systems.


## Null-Modem Emulation
It is possible to run full tests of this telemetry system without access to the telemetry hardware. Installing a null-modem emulator such as [this one](https://com0com.sourceforge.net/) will allow you to emulate COM ports on your device and run the `test/test.py` script.

While this is the software we use for internal testing of this system, we cannot guarantee your results regarding installation and software safety.

1 change: 1 addition & 0 deletions ground/gss_combiner/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/outputs/
13 changes: 13 additions & 0 deletions ground/gss_combiner/config.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[config:rf]
rfBooster = 425.15
rfSustainer = 426.15
rfRelay = 420

[launch]
args = --sustainer COM1,COM2 --booster COM18 --relay COM20 --ip 192.168.0.69

[test]
args = --sustainer COM1,COM2 --booster COM18,COM20 --no-log --local --no-rf

[limited]
args = --sustainer COM13 --booster COM23 --no-log --local
Loading

0 comments on commit de66dd4

Please sign in to comment.