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.0.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.0-py3-none-any.whl (4.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: tle_tracker-0.2.0.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.0.tar.gz
Algorithm Hash digest
SHA256 6b3b6cc03523fc058abdbc76b3d221e9ff2bdfa11498cf9ebe836c89536d212f
MD5 dfad1af4c120f8aff840cf4ecdfe37df
BLAKE2b-256 1e1ebdad4db95cdf264c61677d4a96392d82d011c89ba7c3c8f75f75c9359331

See more details on using hashes here.

File details

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

File metadata

  • Download URL: tle_tracker-0.2.0-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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b2aac623d2723bad2786d809ee66ffdbafffb126a3959c5bb918d0da7ed27cac
MD5 691f76cf1b4fbeff388185d01af6dde2
BLAKE2b-256 dd4f7701184b4896e60e5b09f45f03b34ea126dd7feef5b35b57da9237ededac

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