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.2.1.tar.gz (2.8 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.2.1-py3-none-any.whl (4.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: tle_tracker-0.2.1.tar.gz
  • Upload date:
  • Size: 2.8 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.2.1.tar.gz
Algorithm Hash digest
SHA256 6d61c9b593d7f29886bcdca8061cadb23f5d0755ce3d368bcfd427c948a17a1f
MD5 2ef156a1448caf7c9943fd1d0b4d2630
BLAKE2b-256 9a309edb60d97c703d1e78af23d3cb552c596267479be9d94be4d008ca28c210

See more details on using hashes here.

File details

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

File metadata

  • Download URL: tle_tracker-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 4.0 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.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 43084e8a76893aa34fd8b0706512c09423d5a91c8fc758bc4d87806783d30118
MD5 70994c054a2195dd5b4b61f5e043c483
BLAKE2b-256 8ca6d0f174e6425567676d87435e6b95da4396b76aa0d2b3dcf5cb11058c04d6

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