Skip to content

Commit b68446c

Browse files
committed
Add Lucky-7 image receiver
The implementation is based on https://github.com/Xerbo/Lucky7-Decoder This closes csete#192
1 parent 7043490 commit b68446c

6 files changed

Lines changed: 46 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1414
- Support for SPOC
1515
- PDU add metadata block
1616
- Support for AISTECHSAT-2 custom protocol
17+
- Lucky-7 image receiver
1718

1819
### Changed
1920
- Replaced boost::bind() by C++ lambdas

docs/source/command_line.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -573,8 +573,8 @@ displayed in real time as they are being received, using `feh`_.
573573

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

579579
For satellites supporting file reception, the ``--file_output_path`` parameter
580580
can be used to set the directory that is used to store received files. The

python/filereceiver/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ GR_PYTHON_INSTALL(
3737
k2sat.py
3838
filereceiver.py
3939
imagereceiver.py
40+
lucky7.py
4041
sat_1kuns_pf.py
4142
smogp.py
4243
swiatowid.py

python/filereceiver/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
from .by70_1 import by70_1
1919
from .dsat import dsat
2020
from .k2sat import k2sat
21+
from .lucky7 import lucky7
2122
from .sat_1kuns_pf import sat_1kuns_pf
2223
from .smogp import smogp
2324
from .swiatowid import swiatowid

python/filereceiver/lucky7.py

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#!/usr/bin/env python3
2+
# -*- coding: utf-8 -*-
3+
4+
# Copyright 2020 Daniel Estevez <daniel@destevez.net>
5+
#
6+
# This file is part of gr-satellites
7+
#
8+
# SPDX-License-Identifier: GPL-3.0-or-later
9+
#
10+
11+
# Based on the decoder by Xerbo
12+
# https://github.com/Xerbo/Lucky7-Decoder
13+
14+
import struct
15+
16+
from .imagereceiver import ImageReceiver
17+
18+
class ImageReceiverLucky7(ImageReceiver):
19+
def chunk_sequence(self, chunk):
20+
return struct.unpack('>H', chunk[3:5])[0]
21+
22+
def chunk_size(self):
23+
return 28
24+
25+
def chunk_data(self, chunk):
26+
return chunk[7:]
27+
28+
def file_size(self, chunk):
29+
return self.chunk_size() * struct.unpack('>H', chunk[5:7])[0]
30+
31+
def parse_chunk(self, chunk):
32+
address = struct.unpack('>H', chunk[1:3])[0]
33+
if address < 0xC000 \
34+
or address >= 0xC000 + self.file_size(chunk)/self.chunk_size():
35+
return None
36+
return chunk
37+
38+
lucky7 = ImageReceiverLucky7

python/satyaml/Lucky-7.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ norad: 44406
33
data:
44
&tlm Telemetry:
55
unknown
6+
&image Image:
7+
image: lucky7
68
transmitters:
79
4k8 FSK downlink:
810
frequency: 437.525e+6
@@ -11,3 +13,4 @@ transmitters:
1113
framing: Lucky-7
1214
data:
1315
- *tlm
16+
- *image

0 commit comments

Comments
 (0)