Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

merging in Dev branch #2

Merged
merged 74 commits into from
Jan 11, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
cfd53c2
initial commit
luke-iqt Dec 18, 2020
ab039c5
Update README.md
luke-iqt Dec 18, 2020
377fb22
adding a builtin DB
luke-iqt Dec 19, 2020
6820f38
Update flighttracker.py
luke-iqt Dec 19, 2020
49b8ccd
Dockerized!
luke-iqt Dec 21, 2020
f3bc8e1
Update docker-compose.yml
luke-iqt Dec 21, 2020
665fe4b
Update flighttracker.py
luke-iqt Dec 21, 2020
3e3d447
adding azimuth calculations
luke-iqt Dec 21, 2020
de058a2
Add a camera listener
luke-iqt Dec 22, 2020
86e74dd
controlling the pan tilt hat - basic
luke-iqt Dec 22, 2020
659f083
permission to access the I2C bus
luke-iqt Dec 22, 2020
7f57e5d
Update docker-compose.yml
luke-iqt Dec 22, 2020
1ba7afd
Update docker-compose.yml
luke-iqt Dec 22, 2020
e5a30d0
Update requirements.txt
luke-iqt Dec 22, 2020
f5a6c61
Update camera.py
luke-iqt Dec 22, 2020
9d8f94b
so that is how you ref dicts
luke-iqt Dec 22, 2020
b5436c2
Update camera.py
luke-iqt Dec 22, 2020
5cfe059
Update camera.py
luke-iqt Dec 22, 2020
0dffad5
Update camera.py
luke-iqt Dec 22, 2020
98063f9
Update camera.py
luke-iqt Dec 22, 2020
aec3975
Update camera.py
luke-iqt Dec 22, 2020
f3ba1a5
better pan calculations
luke-iqt Dec 22, 2020
ee5fbd5
better messages
luke-iqt Dec 22, 2020
758cbb3
Update camera.py
luke-iqt Dec 22, 2020
f21a428
Update camera.py
luke-iqt Dec 22, 2020
41e3520
Update flighttracker.py
luke-iqt Dec 22, 2020
eee7900
Update camera.py
luke-iqt Dec 22, 2020
89126e7
Update camera.py
luke-iqt Dec 22, 2020
cff5528
Update camera.py
luke-iqt Dec 22, 2020
2c1da38
Update camera.py
luke-iqt Dec 23, 2020
b77b0b3
Update camera.py
luke-iqt Dec 23, 2020
ff1c35b
Update camera.py
luke-iqt Dec 23, 2020
e272f04
Update camera.py
luke-iqt Dec 23, 2020
398e20a
Update camera.py
luke-iqt Dec 23, 2020
9d0f0b1
Update camera.py
luke-iqt Dec 23, 2020
4c14865
Update camera.py
luke-iqt Dec 23, 2020
6bfb3fd
Update camera.py
luke-iqt Dec 23, 2020
e5b2c4c
Update camera.py
luke-iqt Dec 23, 2020
bf2ae91
Update camera.py
luke-iqt Dec 23, 2020
bc619ab
photo snapping
luke-iqt Dec 24, 2020
7807678
Update docker-compose.yml
luke-iqt Dec 26, 2020
a5e6161
better linking
luke-iqt Dec 26, 2020
7d41ef2
Update docker-compose.yml
luke-iqt Dec 26, 2020
7fb0907
Update docker-compose.yml
luke-iqt Dec 26, 2020
a917696
fix for picam?
luke-iqt Dec 26, 2020
985e835
Update README.md
luke-iqt Dec 26, 2020
5298708
Update camera.py
luke-iqt Dec 26, 2020
5e2c38d
Update camera.py
luke-iqt Dec 26, 2020
834693a
Update camera.py
luke-iqt Dec 26, 2020
6731e2d
Update camera.py
luke-iqt Dec 26, 2020
a1e0207
Update camera.py
luke-iqt Dec 26, 2020
2008809
base elevation
luke-iqt Dec 28, 2020
a101dcc
Update camera.py
luke-iqt Dec 28, 2020
06b78b1
Added a ADSB-MQTT bridge
luke-iqt Jan 5, 2021
1c6ed02
Tracking with Axis PTZ
luke-iqt Jan 7, 2021
4ca9969
corrected terms: azimuth->elevation
luke-iqt Jan 7, 2021
33c1c56
added customized folders for saving pictures
luke-iqt Jan 8, 2021
8d22750
Update utils.py
luke-iqt Jan 8, 2021
caf28f9
changing permissions
luke-iqt Jan 8, 2021
c57895e
Update dockerfile
luke-iqt Jan 8, 2021
2a12d45
Update docker-compose.yml
luke-iqt Jan 8, 2021
e672725
Update docker-compose.yml
luke-iqt Jan 8, 2021
b9053f6
correcting docker-compose build
luke-iqt Jan 8, 2021
32d8e88
cleaned up printing
luke-iqt Jan 9, 2021
aefa14f
added restart
luke-iqt Jan 9, 2021
5ab3b28
Update flighttracker.py
luke-iqt Jan 9, 2021
f372af4
fix a divide by zero error
luke-iqt Jan 9, 2021
115e620
setting altitude
luke-iqt Jan 9, 2021
077245f
Update flighttracker.py
luke-iqt Jan 9, 2021
83048c5
Update camera.py
luke-iqt Jan 9, 2021
23be7db
added additional configuration
luke-iqt Jan 11, 2021
92f6496
Update README.md
luke-iqt Jan 11, 2021
3dc8351
updating readme
luke-iqt Jan 11, 2021
4fc9f83
improved documentation
luke-iqt Jan 11, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
adding a builtin DB
  • Loading branch information
luke-iqt committed Dec 19, 2020
commit 377fb2299e7e6d8dd7a3dbbf1c0a2857973ee436
7 changes: 7 additions & 0 deletions ADS-B-funhouse/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
bingconfig.py
*.sqb
*.db
*.pyc
logocolors.json
.vscode/

22 changes: 22 additions & 0 deletions ADS-B-funhouse/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
The MIT License (MIT)

Copyright (c) 2015 Johan Kanflo

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

79 changes: 79 additions & 0 deletions ADS-B-funhouse/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
**ADS-B funhouse**
==========

This is a collection of Python scripts for playing with [ADS-B](https://en.wikipedia.org/wiki/Automatic_dependent_surveillance-broadcast) data from [dump1090](https://github.com/antirez/dump1090). You will need an [rtl-sdr](https://sdr.osmocom.org/trac/wiki/rtl-sdr) receiver to join the fun.

## flighttracker.py

This script reads SBS1 messages from your dump1090 receiver and tracks the nearest aircraft. It publishes information about the flight on MQTT once every second with an increasing frequency if the aircraft is closer.

Install the requirements:

`% sudo -H pip3 install -r requirements.txt`

and start the tracker:

`% ./flighttracker.py -H <dump1090 host> -m <MQTT host> -pdb <plane database host> -l <receiver latitude> -L <reciver longitude> --prox <MQTT proximity topic>`

The published message is a string of JSON data containing the following fields:

| Key | Description | Sample data |
| ------------ | ----------------------------------------- | ----------------------------- |
| icao24 | ICAO24 designator | "4787B0"
| distance | Distance to aircraft [km] | 42
| bearing | Bearing of aircraft [degrees] | 42
| icao24 | ICAO24 designator | "4787B0"
| loggedDate | Local timestamp | "2015-09-08 21:08:26.061000"
| operator | Name of airline | "Cathay Pacific Airways"
| type | Type of aircraft | "Boeing 777 367ER"
| registration | Aircrafts ICAO registration | "B-KPY"
| callsign | Flight's callsign | "CPA257"
| heading | Aircraf's heading [degrees] | 131
| groundSpeed | Ground speed [knots] | 413
| altitude | Altitude [feet] | 17500
| image | Image URL | https://...
| lon | Lontitude | 13.33108
| lat | Latitude | 55.29126
| vspeed. | Vertical climb/descend rate [ft/min] | 2240


### Some notes

The aircraft's operator, type and registration are not available in the ADS-B data the aircraft transmits and needs to be pulled from another data source. These are hard to come by as no public database exists that allows robots, to my knowledge. You will need to do some scraping.

The script is designed to utilize a "Plane database server" you need to host by running

`% ./planedb-serv.py flightdata.sql 31541`

Starting the script will create an empty sqlite database for you to polulate with whatever scraped data you can find (ico24 -> aircraft type, registration, and operator).

When all is set, clone my [skygrazer git](https://github.com/kanflo/adsb-skygrazer) to have your Raspberry Pi display the data produced by flighttracker.

This git previously contained adsbclient.py and proxclient.py, both have been deprecated.


## airline-colors.py (will be deprecated)

This script allows commercial pilots to, unknowingly I might add, change your moodlight. Any MQTT controllable moodlight can be set to light up in the prominent color of the airline's logo, dimmed accodring to distance to the plane.

Subscribing to the JSON data from `proxclient.py`, it fetches the logo for the airline that operates the nearest flight and calculates the prominent color of their logo. The color is dimmed according to distance and posted to an MQTT topic.

The prominent color in the logo is the one found in the most pixels, white and black excluded. Colors are cached in a file called `logocolors.json`.

`% airline-colors.py -m <MQTT host> -d <max distance> -t <color topic>`

The default publish topic is `airlinecolor` containing the message `#RRGGBB`

The following arguments are supported by:

| Key | Description |
| ------------| ---------------------------------------------------- |
| --help | well...
| --mqtt-host | MQTT broker hostname
| --mqtt-port | MQTT broker port number (default 1883)
| --distance | max distance in kilometers, the color will be black (#000000) for aircrafts beyond this distance
| --topic | the topic to post color data to
| --verbose | Verbose output

-
Released under the MIT license. Have fun!
Loading