Skip to content

Commit

Permalink
Add Lucky-7 image receiver
Browse files Browse the repository at this point in the history
The implementation is based on
https://github.com/Xerbo/Lucky7-Decoder

This closes csete#192
  • Loading branch information
daniestevez committed Nov 13, 2020
1 parent 7043490 commit b68446c
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Support for SPOC
- PDU add metadata block
- Support for AISTECHSAT-2 custom protocol
- Lucky-7 image receiver

### Changed
- Replaced boost::bind() by C++ lambdas
Expand Down
4 changes: 2 additions & 2 deletions docs/source/command_line.rst
Original file line number Diff line number Diff line change
Expand Up @@ -573,8 +573,8 @@ displayed in real time as they are being received, using `feh`_.

Currently the satellites that have decoders supporting file reception are ATL-1
and SMOG-P (they transmit RF spectrum data), and the satellites that have
decoders supporting image reception are 1KUNS-PF, BY70-1, D-SAT, LilacSat-1 and
Światowid.
decoders supporting image reception are 1KUNS-PF, BY70-1, D-SAT, LilacSat-1,
Lucky-7 and Światowid.

For satellites supporting file reception, the ``--file_output_path`` parameter
can be used to set the directory that is used to store received files. The
Expand Down
1 change: 1 addition & 0 deletions python/filereceiver/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ GR_PYTHON_INSTALL(
k2sat.py
filereceiver.py
imagereceiver.py
lucky7.py
sat_1kuns_pf.py
smogp.py
swiatowid.py
Expand Down
1 change: 1 addition & 0 deletions python/filereceiver/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
from .by70_1 import by70_1
from .dsat import dsat
from .k2sat import k2sat
from .lucky7 import lucky7
from .sat_1kuns_pf import sat_1kuns_pf
from .smogp import smogp
from .swiatowid import swiatowid
38 changes: 38 additions & 0 deletions python/filereceiver/lucky7.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

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

# Based on the decoder by Xerbo
# https://github.com/Xerbo/Lucky7-Decoder

import struct

from .imagereceiver import ImageReceiver

class ImageReceiverLucky7(ImageReceiver):
def chunk_sequence(self, chunk):
return struct.unpack('>H', chunk[3:5])[0]

def chunk_size(self):
return 28

def chunk_data(self, chunk):
return chunk[7:]

def file_size(self, chunk):
return self.chunk_size() * struct.unpack('>H', chunk[5:7])[0]

def parse_chunk(self, chunk):
address = struct.unpack('>H', chunk[1:3])[0]
if address < 0xC000 \
or address >= 0xC000 + self.file_size(chunk)/self.chunk_size():
return None
return chunk

lucky7 = ImageReceiverLucky7
3 changes: 3 additions & 0 deletions python/satyaml/Lucky-7.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ norad: 44406
data:
&tlm Telemetry:
unknown
&image Image:
image: lucky7
transmitters:
4k8 FSK downlink:
frequency: 437.525e+6
Expand All @@ -11,3 +13,4 @@ transmitters:
framing: Lucky-7
data:
- *tlm
- *image

0 comments on commit b68446c

Please sign in to comment.