Skip to main content

No project description provided

Project description

TLE (position) tracker

This repository enable starting service using mqtt library to calculate position:

  • latitide
  • longitude
  • altitude (in km)

To calculate posittion of a satellite client needs TLE (2 lines) and broker (mosquitto). You can always sen 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

Listening

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()

Getting info

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

tle_tracker-0.1.0.tar.gz (3.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tle_tracker-0.1.0-py3-none-any.whl (4.4 kB view details)

Uploaded Python 3

File details

Details for the file tle_tracker-0.1.0.tar.gz.

File metadata

  • Download URL: tle_tracker-0.1.0.tar.gz
  • Upload date:
  • Size: 3.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for tle_tracker-0.1.0.tar.gz
Algorithm Hash digest
SHA256 c5b5390d04fd7788c2b5670592a47c2f1cf9e1240b57b2f87e95bff5f471aed2
MD5 93c5bc2c2f64e9a9c93199a30c982513
BLAKE2b-256 4b3171f8c8d2adbfc96135428e21501dae80f2286fb784bc88a9991d5a3e17c0

See more details on using hashes here.

File details

Details for the file tle_tracker-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: tle_tracker-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 4.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for tle_tracker-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b2167191a8e6b6f044adb17478e45332f61cbc67ab5c5ee95d5f1102ea8b6f7f
MD5 62292549388d900307ee059434592ecb
BLAKE2b-256 11e0d6d6ef12fb44fd38807c63a20f48b577545aedd3715a8acb556473fd7089

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page