PiInTheSky / pits

Pi In The Sky Telemetry Software
GNU General Public License v2.0
87 stars 49 forks source link

PITS - HAB Tracker software for the PITS boards

Created by Dave Akerman (dave@sccs.co.uk)

This software is written for the PITS Zero with Pi Zero, PITS+ with the various A+/B+ models, and the original PITS with the Pi A/B boards.

PITS Zero and PITS+ can be purchased from board from http://ava.upuaut.net/store/.

Software support is provided for customers who have purchased a PITS, PITS Zero or PITS+ board, for use with that board only.

Installation

Follow the instructions at http://www.pi-in-the-sky.com/index.php?id=sd-card-image-from-scratch

Piezo Buzzer

A piezo buzzer is another helpful device for locating a landed payload. Use one that will operate from 3V and consumes less than 20mA; I use RS 617-3069 which is very loud. Connect to a 0V pin on the Pi GPIO connector, and a spare I/O pin.

Configure as follows, being careful to use a WiringPi pin number:

Piezo_Pin=4
Piezpo_Alt=1000

For the above settings, the buzzer light will come on during flight once the payload descends below 1000m.

Strobon LED strobe light

These are very bright LED strobe lights made for RC models. You can power them from the Pi 5V and 0V lines; note that they do pull 1A for 20ms for each flash, which might cause issues depending on the power supply; if in doubt add some capacitance at the strobe.

The LED uses a PWM input to control its mode. Choose any free pin, e.g. BCM pin 18 which is only used if you have an APRS board. Configure as follows, being careful to use BCM pin numbers and not WiringPi pin numbers:

Strobe_Pin=18
Strobe_Alt=1000

For the above settings, the strobe light will come on during flight once the payload descends below 1000m.

Both V1 and V2 Strobons have been tested to work fine. PITS controls the LED by using a standard 50Hz PWM signal set with 1ms pulse for off and 2ms for on. Note that when powered up, the V2 model strobes until PITS starts; the V1 starts up as off.

Additional Sensors

You can enable any one of these supported sensor devices using these lines in pisky.txt:

Enable_BME280=Y
Enable_MS5611=Y
Enable_BMP085=Y

All of them measure pressure and temperature; the BME280 also measures humidity.

RTTY through LoRa

To understand the settings, first take note that PITS has a concept of "radio channels" where a channel is a particular radio transmitter not mode (RTTY or LoRa).  We are using one of the LoRa devices (channels) to transmit RTTY.  So our settings are associated with the particular LoRa module (in CE0 or CE1 position).  Essentially we are overriding the normal LoRa functionality by telling the software to transmit RTTY as well as or instead of the LoRa packets.

These are the new settings (shown for channel 0)

Example:

LORA_RTTY_Frequency_0=434.350
LORA_RTTY_Baud_0=300
LORA_RTTY_Shift_0=610
LORA_RTTY_Count_0=2
LORA_RTTY_Every_0=12
LORA_RTTY_Preamble_0=8

USB Camera

To use a USB camera (i.e. a compact or SLR) instead of the Pi camera, you need to install gphoto2 and imagemagick:

sudo apt-get install gphoto2 imagemagick

and you need to edit /boot/pisky.txt and change the "camera" line to be:

Camera=G

(G/g are for gphoto2, U/F/u/f for fswebcam; N/n is for no camera, Y/y/1/TC/c is for CSI camera).

The camera must be able to support remote capture as well as image download, and this excludes a large number of cameras in particular all Canon compacts since 2009. There's a list of cameras at http://www.gphoto.org/doc/remote/.

The image resolution is not controlled so you should set this up in the camera. The full image files are stored on Pi SD card, so ensure that it has sufficient free capacity.

If you are transmitting images with SSDV, then these need to be resized before transmission. This is configured in pisky.txt in the usual way. The process though is different - the camera takes the full sized image, and this image is downloaded to the Pi unaltered. Before transmission the selected images are then resized using imagemagick. So, regardless of the image size settings in pisky.txt, the Pi SD card will contain the full-size images.

PITS does not set the camera exposure. Normally with the camera set to an automatic exposure mode you will get plenty of good images, but you can of course set it to any mode you wish including manual. If you wish to control this from the software rather than on the camera, then create an executable script "take_image" (there is a sample supplied as "take_image.sample"). Note that most settings are only available in the more basic modes - e.g. the aperture can only be controlled in aperture-priority or manual modes.

gphoto2 needs more work than the other camera options, and we strongly recommend some experimentation with the camera you intend to use. See http://gphoto.org/doc/manual/using-gphoto2.html.

USB Webcam

To use a USB webcam instead of the Pi camera, you need to install fswebcam:

sudo apt-get install fswebcam

and you need to edit /boot/pisky.txt and change the "camera" line to be:

Camera=U

IMAGE PROCESSING

All images now include telemetry (longitude, latitude, altitude) in the JPEG comment field, but only if EXIV2 has been installed.

It is therefore possible to overlay downloaded images with telemetry data, as text or graphics, using (for example) ImageMagick, and EXIV2 to extract the data from the JPEG being processed. A sample script "process_image.sample" is provided; to use this, rename to be "process_image", make it executable, and edit to your requirements. Please note that the sample assumes a particular image resolution and you will need to change the pixel positions of the various items. Imagemagick is quite complex to use but there is plenty of documentation on the web plus many samples.

Change Log

07_06_2024

06_06_2021

20_04_2021

21_01_2021

02/03/2020

14/02/2020

27/08/2019

08/07/2019

22/11/2018

21/11/2018

26/09/2018

09/04/2018

04/02/2018

21/09/2017

15/09/2017

05/09/2017

01/09/2017

19/08/2017

10/04/2017

03/03/2017

07/11/2016

19/09/2016

18/09/2016

29/09/2016

25/09/2016

12/09/2016

14/08/2016

12/08/2016

17/06/2016

18/05/2015

01/03/2016

28/11/2015

12/10/2015

18/08/2015

17/06/2015

01/06/2015

19/12/2014