Whilst most high altitude balloons only transmit data (telemetry and sometimes images) down to the ground, there are several applications for sending data to a balloon, for example:
- Requesting re-send of missing image packets
- Balloon repeating of other balloon telemetry
- Commanded cutdowns etc.
My PITS software and LoRa gateway already provide the first option, and I’ve flown a balloon network before. What my released software has lacked up to now is the ability to upload commands. So now, after a lot of work on the various components, I am pleased to announce an uplink system that:
- Can command a payload to cutdown, switch an output, control a servo or run a script
- Works with various trackers: Pi In The Sky, FlexTrack (generic AVR and ESP32 tracker code) and FlexTrak (Pi Zero AVR tracker)
- Works with various ground station software: Pi LoRa Gateway, HAB Explora, HAB PADD, HAB Base
- Encrypts the radio link to protect the tracker against 3rd party attacks
- Works with different radio timing schemes e.g. TDM
Commands
The commands implemented so far are:
- Cutdown the flight now
- Set cutdown altitude (tracker will cut down when this altitude is reached)
- Set an output on
- Set a servo to specified position
- Run a named script or command
Not all of these are available in all trackers – for example scripting is only implemented on Pi In The Sky.
Timing
is everything.
Pretty obviously, each command has to be sent when the tracker is listening. So both the tracker and the ground transmitter have to use the same timing scheme so that the tracker listens at certain times and the transmitter only transmits during those times.
Where the tracker needs to transmit a lot – which basically means trackers that send image data as well as telemetry, then the recommended scheme is for the tracker to listen for a few seconds each minute. The transmitter then needs to be set to transmit at some point during the listening window. For example the tracker might listen from the 0s mark to 5 seconds past the minute, and the transmitter is then set to transmit beginning at the 2-second mark. Remember that packets take a finite time to transmit (around 1 second in LoRa mode 1) so be sure to arrange the timings to allow for that.
For trackers that only send telemetry, then a better scheme is to set the tracker in TDM (Time Division Multiplex) mode. This specifies a repeat period – say every 10 seconds – and a time slot within those 10 seconds at which the tracker transmits – say slot 5 which would be at 5, 15, 25, 35, 45 and 55 seconds past the minute. An advantage of this method is that you can have multiple trackers using the same frequency and same TDM period but each with a different slot. Remember that transmit times may preclude the use of adjacent slots. The ground transmitter can then be set to transmit at a certain time, or simply transmit immediately after it receives a packet from a balloon.
Tracker Configuration
Pi In The Sky
Timing Settings
If you are using SSDV, then use settings like these in pisky.txt:
LORA_Uplink_Cycle_1=60 LORA_Uplink_Period_1=5
This sets the tracker to listen for the first 5 seconds of each minute. Use “_1” for a module in CE1 position, or “_0” for CE0.
If you are not using SSDV, then set TDM mode instead:
LORA_Cycle_1=10 LORA_Slot_1=2
This example transmits packets once every 10 seconds, at 2, 12, 22 etc seconds past each minute.
Cutdown Settings
Cutdown needs to be configured, minimally with these settings:
Enable_Cutdown=Y
Cutdown_Period=5
Cutdown_Pin=22
Which enables cutdowns, sets the default cutdown period to 5 seconds, and uses Wiring Pi pin 22 for the cutdown output. The output would normally then connect to a power MOSFET gate which then applies external power to a length of nichrome wire or a small low-value resistor.
The Pi In The Sky software also provides settings for automatic cutdowns such as “above altitude of x metres” or “flights longer than y minutes”; see the source or await documentation on these and other options.
Encryption Password
Set this, and to something other than SECRET, or take the huge risk that someone else will deliberately upload commands to your tracker!
Uplink_Code=SECRET
Ground App Usage
HAB Explora
See my blog post on how to use uplinks from HAB Explora.
If you are using SSDV, then use the “Send on n’th second option”, and set the time to be just before the centre of the tracker’s listening window. e.g. 2 seconds for the settings above.
If you are using the TDM option, then use “Send After Rx” instead.
Don’t use “Send Now” for either option, unless you’re feeling brave.
HAB PADD
See my blog post on how to use uplinks from HAB Explora.
If you are using SSDV, and uploading from a USB or Bluetooth device, then use the “Send on n’th second option”, and set the time to be just before the centre of the tracker’s listening window. e.g. 2 seconds for the settings above.
If you are using the TDM option, and uploading from a USB or Bluetooth device, then use “Send After Rx” instead.
If you are uploading via a LoRa Gateway, then the timing is done by the gateway, so the see section below on how to configure that.
HAB Base
First, select the source device that you wish to transmit through. This can be a serial device (USB or Bluetooth) or a LoRa Gateway. If it’s a gateway then you need to set up the timing scheme separately – see the gateway section below.
For gateway sources you will see:
The target payload should be filled in for you, using the last payload received by that gateway, but you can choose a different payload if you wish. Remember to select the correct LoRa channel 0 or 1 to match the device CE0 or CE1.
Choose the command you want to send, with any parameters as appropriate.
For USB or Bluetooth serial sources, you will see a slightly more complicated panel:
This time you also need to enter the encryption password, and when to send. If you are using SSDV then use the “Send on n’th second option”, and set the time to be just before the centre of the tracker’s listening window. e.g. 2 seconds for the settings above.
If you are using the TDM option then use “Send After Rx” instead.
HAB Gateway
Set the timing in gateway.txt to match the tracker settings. e.g. to transmit at 2 seconds past the minute, with our top-secret encryption code:
UplinkTime_0=2 UplinkCycle_0=60 UplinkCode=SECRET
Command Format
The uplink packets begin with ‘*’ which tells the tracker that a command follows. The basic format is:
* <encrypted message>
The encryption is a simple 7-bit XOR with a secret code known to the transmitter (ground station) and receiver (tracker), with the high bit set on each byte. Decrypted, the message format is:
* <payload ID> / <command> <parameter 1> [,<parameter 2> etc]
Commands are:
- C = Cutdown
- CN = Cutdown now. Parameter = cutdown time in seconds
- CA = Cutdown at specified altitude; Parameter = Altitude.
- H = Reserved
- D = Reserved
- P = Switch on output pin
- P <pin>/<seconds>
- S = Servo output
- S <pin>/<seconds>/<position>
- R = Run script
- R <script>
dear dave
what lora transmitter antenna are you suggesting to use?
is uplinking possible without amateur radio license?
best form zurich, namor