SSDV Uplink

My PITS software and LoRa Gateway software both allow for uplinks from ground to HAB; in this post I’m going to cover how to use the facility to fill in missing image packets.

Although LoRa has a very good range compared to RTTY for similar data rates, and in the UK we have a reasonably large LoRa receiver network for HABS, there are still situations where there might be enough packet loss to leave large holes in images downloaded via SSDV.  This could be the case if you are flying a long way from receivers, or if you are using higher bandwidths where the range is compromised.  In this instances an uplink can help by asking the tracker to re-send missing packets.

How It Works

The way this is done is by dedicating a certain amount of time for uplinks; during this time the tracker stops transmitting and starts listening, meanwhile the gateway collects information from the SSDV server, and uses that to build a message that it sends up to the tracker.  The tracker then marks up the requested SSDV packets as “Not Yet Sent” so they then can re-sent.

Timing

Normally I set the system to a 1-minute cycle, with the tracker listening from 0s to 5s past the minute, and the gateway transmitting at the 2s mark.

Frequencies and LoRa Mode

The requirements for the uplink are different to those for the downlink, so it may be a good idea to use a different frequency, bandwidth etc.  For downlinks we need to use a frequency band where we can transmit for (nearly) 100% of the time; for the uplink we only transmit for (depending on settings) 1% or less of the time, and generally that allows for use of a different band where higher powers are allowed.  This is good because the HAB is in a relatively noisy environment (it can potentially hear signals from a large circle on the ground below it) so extra power is needed to overcome that noise.

Tracker Configuration

This is an example configuration for an 868MHz module on channel CE0:

LORA_Uplink_Cycle_0=60
LORA_Uplink_Period_0=5
LORA_Uplink_Frequency_0=869.5
LORA_Uplink_Mode_0=6

This sets the tracker to listen for the first 5 seconds of each minute, and transmit the rest of the time.  The uplink frequency (which it listens on during those 5 seconds) is set to 869.5MHz which is near the centre of a band that IR2030 allows 500mW transmissions at up to 10% duty cycle. Mode 6 is a convenient set of LoRa settings for the uplink.

Gateway Configuration

This is an example configuration for an 868MHz module on channel CE0:

UplinkTime_0=2
UplinkCycle_0=60
UplinkFrequency=869.5
UplinkMode=6
SSDVUplink_0=Y

This sets the gateway to transmit at the 2-second mark after each minute, and to listen the rest of the time.  The uplink frequency is set to 869.5MHz, and the mode to 6, to match the tracker settings above.  The last line enables the SSDV uplink.

Since the uplink system uses the current time to decide when to transmit or listen, the gateway needs to have an accurate time reference – e.g. GPS or an NTP server.

List Of Missing Packets

The gateway source includes a Python script ssdv_resend.py that is simply run like so:

python3 ssdv_resend.py PISKY

The “PISKY” is the ID of the payload, and should be no more than 6 characters (the SSDV server truncates longer payload IDs).  The script periodically creates a “missing packets” file that the gateway reads, sends to the tracker, and then deletes.

As well as having the standard LoRa gateway installation, you will also need Python3 installed:

sudo apt-get install python3

 

This entry was posted in Weather Balloon. Bookmark the permalink.

1 Response to SSDV Uplink

  1. Alessandro says:

    Hello, I’m trying to get the ‘missing ssdv packet re-send’ working.

    On the tracker, I have:
    LORA_Uplink_Cycle_1=60
    LORA_Uplink_Period_1=5
    LORA_Uplink_Frequency_1=434.200
    LORA_Uplink_Mode_1=6

    On the gateway, I have:
    UplinkTime_1=2
    UplinkCycle_1=60
    UplinkFrequency_1=434.200
    UplinkMode_1=6
    SSDVUplink_1=Y

    (note that the frequency is the same of normal operation, hope this is not a problem).

    I start the python program:
    python3 ssdv_resend.py NASD01

    If I force the gateway to miss some packets (closing and quickly restarting it) I can see that the python program detects the missing packets and creates an ‘uplink.txt’ file with content like “!1:10=6-7”.
    Also, at the beginning of next minute, the gateway detects the ‘uplink.txt’ file and displays the following message:
    17:10:01 Ch1: … [last packet received before pause]
    Got uplink.txt 10 bytes
    Change frequency to 434/200MHz
    Change LoRa mode to 6
    17:10:05 Ch1: [new packets are received after a pause of 5 seconds]

    Despite that, the image remains corrupted (looks like the tracker does not send back the missing packets).

    What I see is:
    – The pause in the reception seems to be generated on the gateway and not on the tracker: if I totally comment out the uplink lines in the gateway.txt, I can see that the tracker NEVER STOPS sending packets even during the uplink-mode time slot between 00 and 05 seconds of every minute.
    – The pause in the reception disappears as soon as I comment out the ‘SSDVUplink_1=Y’ line in the gateway or I stop the python program (which leads to no ‘uplink.txt’ files available for upload). It really seems that the tracker ignores it’s uplink settings and never stops transmitting telemetry and ssdv packets, despite the fact that I can read this message by manually starting it:
    – Uplink period 10s every 60s
    (here I tried enlarging to 10 secs the slot duration to see if something changed in the reception pause on gateway side, but this is not the case: the tracker never stops transmitting).

    – If I change the timing on the tracker (i.e. setting a 10 seconds period, nothing changes on the gateway (it keeps stopping for 5 secs and only if uplink mode is configured and uplink.txt exists).

    I’m having troubles checking the tracker’s console output because if I stop and restart it manually (in order to see the messages in the console) by these commands:
    sudo killall startup
    sudo killall tracker
    cd pits/tracker
    sudo ./tracker
    the tracker starts, I can read telemetry in the console, but no image is ever sent (I only get ‘Null uplink packets’ until I totally reboot the tracker, loosing the ability to read the console).

    I’m using the latest version of the tracker with the ‘pedestrian mode’ for UBlox (thanks Dave!).

    Where do I go wrong?

    Thanks in advance and Best Regards
    Alessandro, Italy

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.