Skip to content

aaltosatellite/skylink

Repository files navigation

Skylink

Skylink protocol is a point-to-point communication protocol designed for small satellite applications operating over radio amateur band. The protocol has been designed to facilitate an efficient and reliable packet transmission between a satellite and ground station over a narrowband half-duplex channel and can be used for example operating a small satellite.

The protocol implements for example features such as:

  • Four logical virtual channels for mission specific purposes
  • Windowed Time Division Duplexing (TDD)
  • Reliable data transfer using automatic retransmission (ARQ)
  • Uplink and downlink data authentication

More detailed protocol specification can found /docs/Skylink_protocol_Specification_v1.pdf.

This repository contains the protocol implementation, PC host application and various test scripts. The implementation (found from /src) is written in pure C and has been designed to run on memory limited microcontrollers in space.

The source code is available under LGPL license, see LICENSE for the license text.

Main authors: Markus Hiltunen, Petri Niemelä

Additional help: Klaus Kivirikko, Topi Räty

Dependencies

A pythonic skymodem was made which uses Cython linking to the C-based Skylink. First install the UHD drivers for the USRP B200. This can be done by running the following commands in the terminal:

$ sudo add-apt-repository -y ppa:ettusresearch/uhd
$ sudo apt install uhd-host && sudo uhd_images_downloader && sudo usermod -a -G usrp $USERNAME
$ sudo apt install soapysdr-module-uhd soapysdr-tools

Once the drivers are installed, execute

$ uhd_usrp_probe

in the terminal. This should upload the FPGA image to the USRP and then print out some device info. If this succeeds, connecting to the USRP was successful.

Next install python dependencies:

$ sudo apt install python3-soapysdr 
$ pip install numpy numba Cython

Next compile cython skylink wrapper by running the following commands:

$ cd skylink/skymodem/skylink_wrapper/cython_skylink
$ python _run_compile.py

Now you should be able to run the application, but you have to update the HMAC key in the application.py file. It is located at the start of the main function, near the end of the file.

Running the application

Run the skymodem application by:

$ cd skylink/skymodem/
$ python application.py

There are some preset configurations for running the modem. These presets can be found in skylink/skymodem/modem_configs/presets.json Currently available presets are: fm_default, fm_backup, dev_default, fms_default, fm_multimode, dev_multimode, fms_multimode, fm_calculated_doppler

These can be ran by using:

$ python application.py --config ${preset_name_here}

Preset configurations can also be overriden by specifying other configs such as:

$ python application.py --config ${preset_name_here} --rx_gain 50

Configuration:

Doppler calculation configurations can be added interactively for a new satellite/ground station using:

$ python skylink/skymodem/TLE_doppler_configs/create_doppler_config.py

This new configuration can be then used by creating a new preset with:

$ python skylink/skymodem/modem_configs/add_preset.py

This will ask for configuration values in addition to a doppler config filename which will be used.

The new preset can then be used as specified in the "Running the application" section of this README.

Using skymodem to send messages to HAM Repeater

An interactive python script can be ran alongside skymodem to construct frames for the repeater and send them using skymodem.

$ python skylink/skymodem/repeater.py

If you want to use another program than skymodem to send the repeater frames. The raw bytes (In hex format) that need to be sent for a repeater frame can also be acquired using:

$ python skylink/skymodem/repeater_frame_bytes.py

You can also generate a WAV file of the frame to transmit by using:

$ python skylink/skymodem/repeater_frame_wav.py

This script can generate either a mono NRZ signal or interleaved IQ samples as stereo.

Important to note about the repeater frames sent to Foresail1p. These will be fixed for Aalto-3 and other future projects: The radio board code can not be updated and has a few errors in repeater frame parsing.

  1. There is no HLDC start or end flag (0x7E) that is standard to AX.25 frames. The frames sent to the satellite will also not include this.
  2. The CRC (FCS) is MSB instead of LSB.
  3. The CRC sent back will only have the correct second byte of the CRC and the first one will be from the original frame.
  4. Sending skylink frame CRC field which is default on the repeater channel will result in the repeater frame not being accepted. However the frame that is sent back will include this CRC which can still be used to check validity of frame. This CRC will be the 4 final bytes of the entire frame after Golay, RS, Scrambling and will cover the whole skylink frame. Details (used polynomial etc.) can be found in src/crc.c.

Including Skylink into an embedded application

Because no well standardized method for cross compiling libraries for embedded applications doesn't exist, the easiest method to include the Skylink implementation into a project is by symbolically linking the src folder under your project or by copying the whole src folder under the project. The Skylink project expects to find its includes located inside the src, so you need to add the Skylink implementation directory to the compiler's include directory listing.

In an embedded applications, the software architecture could look for example like this:

Skylink implemented in an embedded application

TODO: Example implementation.

Python parser

The python folder includes an (almost) independent parser for handling Skylink frames. The implementation can be used to parse and construct individual Skylink radio frames but it doesn't include the required logic to drive the protocol implementation in real-time for two-way communication.

About

Skylink protocol implementation

Resources

License

Stars

Watchers

Forks

Packages

No packages published