No project description provided
Project description
TLE (position) tracker
TLE service for WUST-Sat OBC.
Tests and linter
This project enforces code quality using listed tools:
black - code formatter that ensures consistent style across the project
isort - organizes import statements into sections and alphabetically
ruff - linter for code quality checks and automatic fixes
You can test quality of code using poe command:
poe format will automatically correct formatting, import order, and check if
ruff returns errors.
poe format_check will run checkers and linters, but without editing the code.
TLE Tracker on Raspberry Pi
To deploy and run the TLE_tracker service on a Raspberry Pi, use the dedicated Ansible playbook:
Playbook: tle-tracker.yml
Repository: Wust-Sat/obc-system
Dependecies
Please install mosquitto or provide different MQTT server.
Features
This repository enable starting service using mqtt library to calculate position of satellite:
- time of the request
- latitide
- longitude
- altitude (in km)
To calculate posittion of a satellite client needs TLE (2 lines) and broker (mosquitto). You can always send TLE via terminal like this:
mosquitto_pub -h localhost -t cubesat/tle -m "1 25544U 98067A 20029.54791435 .00001264 00000-0 29621-4 0 9993\n2 25544 51.6434 21.3435 0007417 318.0083 42.0574 15.49176870211460"
but remember to have running both mosquitto_interface and mosquitto broker.
If you wish to use this in your code you need to import:
import paho.mqtt.client as mc
Operating the Library via Shell Commands
TLE_tracker primarily uses files located in the /var/lib/tle folder. It monitors the most recent file in this directory and extracts TLE lines from it when available.
If the folder does not exist, a warning message will be displayed during tle_tracker runtime. In that case, updating TLE lines is only possible through MQTT topics.
mosquitto_pub -h localhost -t cubesat/tle -m "1 25544U 98067A 20029.54791435 .00001264 00000-0 29621-4 0 9993\n2 25544 51.6434 21.3435 0007417 318.0083 42.0574 15.49176870211460"
mosquitto_sub -h localhost -t cubesat/req_position -m ""
mosquitto_sub -h localhost -t cubesat/req_last_update -m ""
Listening inside your program
In order to get position or time of last update you need:
def __init__(self, broker="localhost", port=1883):
self.client = mc.Client()
self.client.on_connect = self.on_connect
self.client.on_message = self.on_message
where:
def on_connect(self, client,userdata,flags,rc):
client.subscribe("cubesat/position")
client.subscribe("cubesat/last_update")
and:
def on_message(self, client, userdata, msg):
print(f"{msg.topic}: {msg.payload.decode()}")
if msg.topic == "cubesat/position":
func_for_what_to_do()
elif msg.topic == "cubesat/last_update":
func_for_what_to_do2()
Requesting info inside program
In order to make request for position info:
def get_pos_info():
self.client.publish("cubesat/req_position","")
In order to make request for last_update time:
def get_update_time_info():
self.client.publish("cubesat/req_last_update","")
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file tle_tracker-0.3.0.tar.gz.
File metadata
- Download URL: tle_tracker-0.3.0.tar.gz
- Upload date:
- Size: 4.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.1 CPython/3.10.12 Linux/6.8.0-60-generic
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
10f61e1424ff06f9bd9c822d874a67b0f4857bade7df5080ef9b35c647535f54
|
|
| MD5 |
63d9e3641874d38a8e11b0ce046ac86c
|
|
| BLAKE2b-256 |
082d77873702f04ea67c3d97b80501892754aba17cb91c5444acaff69a54e5d7
|
File details
Details for the file tle_tracker-0.3.0-py3-none-any.whl.
File metadata
- Download URL: tle_tracker-0.3.0-py3-none-any.whl
- Upload date:
- Size: 5.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.1 CPython/3.10.12 Linux/6.8.0-60-generic
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1156766bc2651e75816f5c90ac2d59d039fe4d1c9a622fb7fdd69ce8220cbecb
|
|
| MD5 |
1960fbc14ea28ea2554d48906164a9dc
|
|
| BLAKE2b-256 |
088af8784461ee268b84ee6e5dfe0562d9d99218d163367240d9a1320b41d385
|