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

Basic HORS Satellites Support #722

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 2 additions & 0 deletions docs/source/satyaml.rst
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,8 @@ The framings allowed in the ``framing`` field are the following:

* ``GEOSCAN``, the custom framing used by GEOSCAN-EDELVEIS.

* ``HORS``, the custom framing used by HORS-1/-2/-3/-4.

* ``SPINO``, the custom framing used by the SPINO payload on INSPIRE-Sat7.

* ``QUBIK``, the custom framing used by QUBIK.
Expand Down
1 change: 1 addition & 0 deletions grc/components/deframers/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -65,5 +65,6 @@ install(FILES
satellites_ua01_deframer.block.yml
satellites_usp_deframer.block.yml
satellites_yusat_deframer.block.yml
satellites_hors_deframer.block.yml
DESTINATION share/gnuradio/grc/blocks
)
41 changes: 41 additions & 0 deletions grc/components/deframers/satellites_hors_deframer.block.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
id: satellites_hors_deframer
label: HORS Deframer
category: '[Satellites]/Deframers'

parameters:
- id: threshold
label: Syncword threshold
dtype: int
default: 0
- id: options
label: Command line options
dtype: string
default: '""'
hide: part

inputs:
- domain: stream
dtype: float

outputs:
- domain: message
id: out

templates:
imports: import satellites.components.deframers
make: satellites.components.deframers.hors_deframer(syncword_threshold = ${threshold}, options=${options})

documentation: |-
Deframes HORS custom packets

Input:
A stream of soft symbols containing HORS packets

Output:
PDUs with the deframed HORS packets

Parameters:
Syncword threshold: number of bit errors to allow in syncword detection
Command line options: options to pass down to the block, following the syntax of the gr_satellites command line tool

file_format: 1
1 change: 1 addition & 0 deletions python/components/deframers/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ GR_PYTHON_INSTALL(
ua01_deframer.py
usp_deframer.py
yusat_deframer.py
hors_deframer.py
DESTINATION ${GR_PYTHON_DIR}/satellites/components/deframers
)

Expand Down
1 change: 1 addition & 0 deletions python/components/deframers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,4 @@
from .ua01_deframer import ua01_deframer
from .usp_deframer import usp_deframer
from .yusat_deframer import yusat_deframer
from .hors_deframer import hors_deframer
60 changes: 60 additions & 0 deletions python/components/deframers/hors_deframer.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

# Copyright 2022 Daniel Estevez <[email protected]>
# Mod by Egor UB1QBJ
# This file is part of gr-satellites
#
# SPDX-License-Identifier: GPL-3.0-or-later
#

from gnuradio import gr, digital

from ...hier.sync_to_pdu_packed import sync_to_pdu_packed
from ...utils.options_block import options_block


_syncword = '0100110000101101010001110111101111111011100001001000111001111111'


class hors_deframer(gr.hier_block2, options_block):
"""
Hierarchical block to deframe the HORS custom framing

The input is a float stream of soft symbols. The output are PDUs
with frames.

Args:
syncword_threshold: number of bit errors allowed in syncword (int)
options: Options from argparse
"""
def __init__(self, syncword_threshold=None, options=None):
gr.hier_block2.__init__(
self,
'hors_deframer',
gr.io_signature(1, 1, gr.sizeof_float),
gr.io_signature(0, 0, 0))
options_block.__init__(self, options)

self.message_port_register_hier_out('out')

if syncword_threshold is None:
syncword_threshold = self.options.syncword_threshold
self.slicer = digital.binary_slicer_fb()
self.deframer = sync_to_pdu_packed(
packlen=71, sync=_syncword, threshold=syncword_threshold)

self.connect(self, self.slicer, self.deframer)
self.msg_connect((self.deframer, 'out'), (self, 'out'))
Comment on lines +43 to +48
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there no CRC, no scrambling, no FEC, no nothing? Just a 64-bit syncword and 71 bytes of packet data?

Is there documentation publicly available about the transmission format used by these satellites?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Based on the correlation, it has a 64-bit sync word and 71 bytes of data. There is a PN pattern in the data, but since I have absolutely no documentation on these satellites, I don't know the PN generation polynomials. Otherwise, it doesn't have much else.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know if this is enough to constitute a deframer, especially because there is no way to check for bad decodes without a CRC.

Let me see if I got this right: through reverse-engineering you managed to identify that all the packets start by the same 64-bit sequence (which you are using here as syncword) and following that they have 71 * 8 bits. Moreover, you say that there is a PN pattern, so there might not be any data in these packets, or the data would need to be despread for further processing.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I hope will get at least some deeper info about packet structure, but it will be good to have ability to demodulate data from these sats


_default_sync_threshold = 7

@classmethod
def add_options(cls, parser):
"""
Adds HORS deframer specific options to the argparse parser
"""
parser.add_argument(
'--syncword_threshold', type=int,
default=cls._default_sync_threshold,
help='Syncword bit errors [default=%(default)r]')
1 change: 1 addition & 0 deletions python/core/gr_satellites_flowgraph.py
Original file line number Diff line number Diff line change
Expand Up @@ -479,6 +479,7 @@ def add_options(cls, parser, file=None, name=None, norad=None):
'OpenLST': deframers.openlst_deframer,
'HADES-D': set_options(deframers.hades_deframer, satellite='HADES-D'),
'HADES-R': set_options(deframers.hades_deframer, satellite='HADES-R'),
'HORS': deframers.hors_deframer
}
_transport_hooks = {
'KISS': transports.kiss_transport,
Expand Down
16 changes: 16 additions & 0 deletions python/satyaml/HORS-1.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: HORS-1
alternative_names:
- RS55S
- HORS
norad: 57188
data:
&tlm Telemetry:
unknown
transmitters:
9k6 FSK downlink:
frequency: 435.300e+6
modulation: FSK
baudrate: 9600
framing: HORS
data:
- *tlm
16 changes: 16 additions & 0 deletions python/satyaml/HORS-2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: HORS-2
alternative_names:
- RS56S
- HORS
norad: 57196
data:
&tlm Telemetry:
unknown
transmitters:
9k6 FSK downlink:
frequency: 435.500e+6
modulation: FSK
baudrate: 9600
framing: HORS
data:
- *tlm
23 changes: 23 additions & 0 deletions python/satyaml/HORS-3.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: HORS-3
alternative_names:
- RS81S
- HORS
norad: 61753
data:
&tlm Telemetry:
unknown
transmitters:
9k6 FSK downlink:
frequency: 435.650e+6
modulation: FSK
baudrate: 9600
framing: HORS
data:
- *tlm
9k6 FSK downlink:
frequency: 435.200e+6
modulation: FSK
baudrate: 9600
framing: HORS
data:
- *tlm
16 changes: 16 additions & 0 deletions python/satyaml/HORS-4.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: HORS-4
alternative_names:
- RS82S
- HORS
norad: 61754
data:
&tlm Telemetry:
unknown
transmitters:
9k6 FSK downlink:
frequency: 435.700e+6
modulation: FSK
baudrate: 9600
framing: HORS
data:
- *tlm
1 change: 1 addition & 0 deletions python/satyaml/satyaml.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ def __init__(self, path=_default_path):
'AO-40 FEC CRC-16-ARC short', 'DIY-1', 'BINAR-1', 'Endurosat',
'SanoSat', 'FORESAIL-1', 'HSU-SAT1', 'GEOSCAN', 'Light-1',
'SPINO', 'QUBIK', 'BINAR-2', 'OpenLST', 'HADES-D', 'HADES-R',
'HORS'
]
transports = [
'KISS', 'KISS no control byte', 'KISS KS-1Q', 'TM KISS',
Expand Down