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
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
Update README.md
  • Loading branch information
luke-iqt committed Jan 11, 2021
commit 92f64961fb47469f3ec38fcbf95fb7131ce8803e
57 changes: 55 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,73 @@ Automatically photograph planes that fly by!
-----
Follow allowing as we build, [here](https://iqtlabs.github.io/SkyScan/)

## Overview
To enable better tracking, most planes broadcast a signal known as [Automatic Dependent Surveillance–Broadcast](https://en.wikipedia.org/wiki/Automatic_Dependent_Surveillance–Broadcast) or ADS-B. This signal is at 1090MHz and can be easily received using a low cost Software Defined Radio (SDR), like the [RTL-SDR](https://learn.adafruit.com/getting-started-with-rtl-sdr-and-sdr-sharp) which repurposes a digital TV chip.

From the ADS-B transmissions, you can get a plane's location and altitude. If you know where a plane is and where you are, you can do some math and point a camera at the plane and take a picture. If you have a Pan/Tilt camera lying around, you can have it automatically track a plane as it flies by and snap photos.

## Hardware
The project works with the following hardware. It should be easy to extended to work with other SDRs or cameras... but that is on you.
- Raspberry Pi 4
- [Axis m5525](https://www.axis.com/en-us/products/axis-m5525-e) Axis has a great API for their network cameras, and it should work with any of there PTZ cameras. The m5525 is nice because it supports continuous 360 degree rotation. You can literally have it spin around in circles, giving you complete coverage. It also has 10x optical zoom.
- [Pan Tilt Hat](https://shop.pimoroni.com/products/pan-tilt-hat?variant=22408353287) & Raspberry Pi Camera - This is the budget option. It is a small kit that uses servo motors to move the Raspberry Pi Cam around. It only has about 170 degrees of panning and the positioning is not that accurate. Since the Pi Cam is used, it is not zoomed in much. If you are in a spot where planes are flying low overhead, this could be a perfect solution.
- [RTL-SDR](https://www.nooelec.com/store/sdr/nesdr-smart-sdr.html) This is nice and stable RTL-SDR. It is compact and doesn't block all the other ports on a Pi. Since you are just trying to capture local planes, you can get away with using any antenna you have lying around.

## Software Architecture

The different components for this project have been made into Docker containers. This modularity makes it easier to add in new data sources or cameras down the road. We have found containers to work really well on the Pi and the help enforce that you have properly documented all of the software requirements.

+-------------+ +-------------+ +---------------+ +--------------+
| | | | | | | |
| | | | | | | Axis+PTZ |
| Pi+Aware +----->+ ADSB+MQTT +---------->+ Tracker +----------->+ |
| | TCP | | MQTT | | MQTT | |
| | | | all | | only | |
+-------------+ +-------------+ planes +---------------+ tracking +-------+------+
plane |
| HTTP API
| Pan/Tilt
v
+--------------------+ +--------+---------+
| | | |
| | | |
| MQTT Broker | | Axis m5525 |
| | | Camera |
| | | |
| | | |
+--------------------+ +------------------+



Here is a brief overview of each component. There are additional details in the component's subdirectory

- [mikenye/piaware](https://github.com/mikenye/docker-piaware) - This is a dockerized version of FlightAware's [PiAware](https://flightaware.com/adsb/piaware/) program. PiAware is actually just a wrapper around [dump1090](https://flightaware.com/adsb/piaware/). Dump1090 is a small program that can use an RTL-SDR to receive an ADS-B transmission. The program uses these transmission to track where nearby planes are and display then on a webpage. It also output all of the messages it receives on a TCP port, for other programs to use. We use this connection to get the plane information. PiAware adds the ability to send the information to FlightAware. You could probably just switch this to only use Dump1090.

- [ADSB-MQTT](adsb-mqtt) Is a small python program that reads in information collected by Dump1090 over a TCP port and publishes all the messages it receives onto the MQTT bus.

- [tracker](tracker) Receives all of the plane's location, determines how far away from the camera each one is and then finds the closest plane. The location and relative position of the closest plane is periodically published as an MQTT messages. Tracker needs to know the location and altitude of the camera in order to determine the planes relative position.

- [axis-ptz](axis-ptz) Receives updates on which plane to track over MQTT and then directs the PTZ camera towards the plane and takes a picture.



### Configure
Copy the **env-example** file to **.env**. Edit the **.env** file to include the correct values.
In order to start PiAware, you need to register with Flight Aware and request a Feed ID. There are directions on how to do that [here](https://github.com/mikenye/docker-piaware#new-to-piaware).

Update **docker-compose.yml** with the correct ID for your RTL-SDR.
Copy the **env-example** file to **.env**. Edit the **.env** file to include the correct values.

### Operations
Launch the application using docker-compose:
```bash
docker-compose up
```

A web interface will be available on **port 8080**. As pictures of planes are captured they will be saved in folders in the **./capture** directory.


### Enable Raspi-camera

If you are using the Pan Tilt hat, you will need to make sure the Pi Camera has been configured correctly:
In the base OS on the Pi make sure the Camera is enabled:
```bash
sudo raspi-config
Expand Down