Skip to content

Commit

Permalink
satnogs api test, requirements cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
tomvdb committed Feb 19, 2022
1 parent 9fd4874 commit 44a8e43
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 12 deletions.
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,18 @@ Once you satellite is added you need to add it to a collection. Currently the "D

Go back to the site home and your satellite will now show. You can select it to get more details and show the orbit and next pass.

# Updating TLE files

```
python update_tle.py
```

Its recommended to schedule that file via cron (no more than once a day)

# Security

This has not been designed to be exposed to the internet. Don't do it!

# Rotator Control

This is still a work in progress, but essentially I have [Node-Red](https://nodered.org/) installed on the same pi. My flow contains a websocket component that listens for az/el requests. More information on this soon.
Expand Down
11 changes: 11 additions & 0 deletions app/routes_jsapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from app.forms import CreateCollectionForm, AddSatelliteCollectionForm
from sqlalchemy import and_
from app import config
import requests

from app.satellite_functions import calc_current_pos, get_next_pass, get_orbit

Expand Down Expand Up @@ -45,6 +46,16 @@ def satellite_data(collection_id):
return jsonify(data)


@app.route('/browser/tle_api/<norad_id>')
def tle_api(norad_id):
req = requests.get("https://db.satnogs.org/api/tle/?format=json&norad_cat_id=" + norad_id)

if req.status_code == 200:
data = req.json()
return jsonify(data)

return jsonify([{}])




2 changes: 1 addition & 1 deletion app/templates/add_satellite_form.html
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
}
else {
$.ajax({
url: "https://db.satnogs.org/api/tle/?format=json&norad_cat_id=" + noradid,
url: "/browser/tle_api/" + noradid,
type: 'GET',
dataType: 'json',
success: function (res) {
Expand Down
11 changes: 0 additions & 11 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,29 +1,18 @@
Bootstrap-Flask==2.0.1
certifi==2020.6.20
chardet==4.0.0
click==8.0.3
colorzero==1.1
distro==1.5.0
dominate==2.6.0
Flask==2.0.3
Flask-Bootstrap==3.3.7.1
Flask-SQLAlchemy==2.5.1
Flask-WTF==1.0.0
gpiozero==1.6.2
idna==2.10
itsdangerous==2.1.0
Jinja2==3.0.3
jplephem==2.17
MarkupSafe==2.1.0
python-apt==2.2.1
requests==2.25.1
RPi.GPIO==0.7.0
sgp4==2.20
six==1.16.0
skyfield==1.42
spidev==3.5
SQLAlchemy==1.4.31
ssh-import-id==5.10
urllib3==1.26.5
visitor==0.1.3
Werkzeug==2.0.3
Expand Down

0 comments on commit 44a8e43

Please sign in to comment.