Finally fix build
continuous-integration/drone/push Build was killed Details

This commit is contained in:
Christoph Honal 2020-02-26 02:30:58 +01:00
parent 6b2761e76d
commit 78133f9b55
18 changed files with 5318 additions and 520 deletions

View File

@ -47,22 +47,21 @@ WORKDIR /app/move2radio/build
RUN cmake -DAPPIMAGE=OFF -DCONDA_ENV=OFF -DLDPC_OFFLINE=ON -DGR_CCSDS_OFFLINE=ON -DFEC_OFFLINE=ON -DOFFLINE_DEPENDENCY_PATH=/app/move2radio-prop .. && \
make move2radio
# # Run stage
# FROM base AS run
# ENV DEBIAN_FRONTEND=noninteractive TZ=Europe/Berlin
# Run stage
FROM base AS run
ENV DEBIAN_FRONTEND=noninteractive TZ=Europe/Berlin
ENV PATH="/app/move2radio/build/prefix/usr/bin:${PATH}" \
PYTHONPATH="/app/move2radio/build/prefix/usr/lib/python2.7/dist-packages:${PYTHONPATH}" \
LD_LIBRARY_PATH="/app/move2radio/build/prefix/usr/lib:${LD_LIBRARY_PATH}"
# # Copy sources from build stage
# COPY --from=build /app/move2radio/build/prefix/usr /app/move2radio/build/prefix/usr
# COPY --from=build /app/move2radio/AppDir/move-ii-gr /app/move2radio/AppDir/move-ii-gr
# ENV PATH="/app/move2radio/build/prefix/usr/bin:${PATH}" \
# PYTHONPATH="/app/move2radio/build/prefix/usr/lib/python2.7/dist-packages:${PYTHONPATH}" \
# LD_LIBRARY_PATH="/app/move2radio/build/prefix/usr/lib:${LD_LIBRARY_PATH}"
# Copy sources from build stage
COPY --from=build /app/move2radio/build/prefix/usr /app/move2radio/build/prefix/usr
COPY --from=build /app/move2radio/AppDir/move-ii-gr/AR4JA_r12_k1024n.a /app/gnuradio/
COPY build/gnuradio/* /app/gnuradio/
# # Install binaries
# # COPY build/blocks/* app/move2radio/build/prefix/usr/share/gnuradio/grc/blocks/
# COPY build/fakeserver/* /app/fakeserver/
# COPY build/run*.sh /app/
# RUN chmod 644 app/move2radio/build/prefix/usr/share/gnuradio/grc/blocks/*.xml && \
# chmod +x /app/run*.sh && ldconfig
# Install binaries
COPY build/fakeserver/* /app/fakeserver/
COPY build/run*.sh /app/
RUN chmod +x /app/run*.sh && ldconfig
# ENTRYPOINT ["/app/run-cli.sh"]
ENTRYPOINT ["/app/run-cli.sh"]

View File

@ -16,7 +16,7 @@ Starting the container without any arguments opens a shell into the container. Y
The GUI container needs to know which X11 server to connect to, this can be configured using `docker run --env DISPLAY=host.docker.internal:0.0 ...` when using Docker Desktop for Windows or OS X. On Linux `host.docker.internal` cannot be resolved so there you have to use something like `$(docker network inspect bridge --format='{{(index .IPAM.Config 0).Gateway}}')` (The gateway address of the `docker0` bridge interface) or its IP address directly like `172.17.0.1`, but note that your configuration may differ.
## Development
Use the `scripts/*-dev.sh` to build and run the docker container for local development. The other scripts will download and run the precompiled image.
Use the `scripts/*-dev*.sh` to build and run the docker container for local development. The other scripts will download and run the precompiled image.
The public docker image is built by the CI server using the `master` branch of this repository. Please use the `dev` branch for local development.

View File

@ -1,85 +0,0 @@
<?xml version="1.0"?>
<block>
<name>LDPC Decoder (CCSDS)</name>
<key>ccsds_ldpc_decoder</key>
<category>CCSDS/Channelcoding</category>
<import>import ccsds</import>
<make>ccsds.ldpc_decoder($par_file, $systype.fcn, $puncttype.fcn, $num_punct, tuple($punct_pos))</make>
<param>
<name>Paritycheck matrix</name>
<key>par_file</key>
<type>file_open</type>
</param>
<param>
<name>Systematic</name>
<key>systype</key>
<value>ccsds.LDPC_SYS_FRONT</value>
<type>enum</type>
<option>
<name>None</name>
<key>sys_none</key>
<opt>fcn:ccsds.LDPC_SYS_NONE</opt>
</option>
<option>
<name>Front</name>
<key>sys_front</key>
<opt>fcn:ccsds.LDPC_SYS_FRONT</opt>
</option>
<option>
<name>Back</name>
<key>sys_back</key>
<opt>fcn:ccsds.LDPC_SYS_BACK</opt>
</option>
</param>
<param>
<name>Puncturing position</name>
<key>puncttype</key>
<value>ccsds.LDPC_PUNCT_NONE</value>
<type>enum</type>
<option>
<name>None</name>
<key>punct_none</key>
<opt>fcn:ccsds.LDPC_PUNCT_NONE</opt>
</option>
<option>
<name>Front</name>
<key>punct_front</key>
<opt>fcn:ccsds.LDPC_PUNCT_FRONT</opt>
</option>
<option>
<name>Back</name>
<key>punct_back</key>
<opt>fcn:ccsds.LDPC_PUNCT_BACK</opt>
</option>
<option>
<name>Custom</name>
<key>punct_custom</key>
<opt>fcn:ccsds.LDPC_PUNCT_CUSTOM</opt>
</option>
</param>
<param>
<name>Number of punctures</name>
<key>num_punct</key>
<value>0</value>
<type>int</type>
</param>
<param>
<name>Custom puncturing positions</name>
<key>punct_pos</key>
<value>[]</value>
<type>int_vector</type>
</param>
<check>$num_punct >= 0</check>
<sink>
<name>in</name>
<type>message</type>
</sink>
<source>
<name>out</name>
<type>message</type>
</source>
</block>

View File

@ -1,85 +0,0 @@
<?xml version="1.0"?>
<block>
<name>LDPC Encoder (CCSDS)</name>
<key>ccsds_ldpc_encoder</key>
<category>CCSDS/Channelcoding</category>
<import>import ccsds</import>
<make>ccsds.ldpc_encoder($gen_file, $systype.fcn, $puncttype.fcn, $num_punct, tuple($punct_pos))</make>
<param>
<name>Generator matrix</name>
<key>gen_file</key>
<type>file_open</type>
</param>
<param>
<name>Systematic</name>
<key>systype</key>
<value>ccsds.LDPC_SYS_FRONT</value>
<type>enum</type>
<option>
<name>None</name>
<key>sys_none</key>
<opt>fcn:ccsds.LDPC_SYS_NONE</opt>
</option>
<option>
<name>Front</name>
<key>sys_front</key>
<opt>fcn:ccsds.LDPC_SYS_FRONT</opt>
</option>
<option>
<name>Back</name>
<key>sys_back</key>
<opt>fcn:ccsds.LDPC_SYS_BACK</opt>
</option>
</param>
<param>
<name>Puncturing position</name>
<key>puncttype</key>
<value>ccsds.LDPC_PUNCT_NONE</value>
<type>enum</type>
<option>
<name>None</name>
<key>punct_none</key>
<opt>fcn:ccsds.LDPC_PUNCT_NONE</opt>
</option>
<option>
<name>Front</name>
<key>punct_front</key>
<opt>fcn:ccsds.LDPC_PUNCT_FRONT</opt>
</option>
<option>
<name>Back</name>
<key>punct_back</key>
<opt>fcn:ccsds.LDPC_PUNCT_BACK</opt>
</option>
<option>
<name>Custom</name>
<key>punct_custom</key>
<opt>fcn:ccsds.LDPC_PUNCT_CUSTOM</opt>
</option>
</param>
<param>
<name>Number of punctures</name>
<key>num_punct</key>
<value>0</value>
<type>int</type>
</param>
<param>
<name>Custom puncturing positions</name>
<key>punct_pos</key>
<value>[]</value>
<type>int_vector</type>
</param>
<check>$num_punct >= 0</check>
<sink>
<name>in</name>
<type>message</type>
</sink>
<source>
<name>out</name>
<type>message</type>
</source>
</block>

View File

@ -1,48 +0,0 @@
<?xml version="1.0"?>
<block>
<name>message_info</name>
<key>ccsds_message_info</key>
<category>[ccsds]</category>
<import>import ccsds</import>
<make>ccsds.message_info($prefix, $mode)</make>
<param>
<name>Prefix</name>
<key>prefix</key>
<value>"Message info: "</value>
</param>
<param>
<name>Mode</name>
<key>mode</key>
<value>10</value>
<type>enum</type>
<option>
<name>Silent</name>
<key>0</key>
<opt>fcn:0</opt>
</option>
<option>
<name>Compact</name>
<key>10</key>
<opt>fcn:10</opt>
</option>
<option>
<name>Full</name>
<key>20</key>
<opt>fcn:20</opt>
</option>
</param>
<sink>
<name>in</name>
<type>message</type>
</sink>
<doc>
Print out messages with a timestamp.
Prefix: String that will be written before the data line(s)
Modes:
- Silent: Do not write anything
- Compact: Write one line summary of the message
- Full: Write full content of the message
</doc>
</block>

View File

@ -1,35 +0,0 @@
<?xml version="1.0"?>
<block>
<name>Output rate counter</name>
<key>ccsds_output_counter_cc</key>
<category>[ccsds]</category>
<import>import ccsds</import>
<make>ccsds.output_counter_cc($block_length)</make>
<param>
<name>Block size</name>
<key>block_length</key>
<value>1024</value>
<type>int</type>
</param>
<sink>
<name>in</name>
<type>complex</type>
</sink>
<source>
<name>in_cpy</name>
<type>complex</type>
<optional>1</optional>
</source>
<source>
<name>out</name>
<type>message</type>
<optional>1</optional>
</source>
<doc>
Copies the input complex intput to the (optional) output.
Counts the number of copied samples and emits a "block_out" message everytime 'Block size' samples have been copied.
This block is intendet to enable limiting the number of samples queueing up before a transmitter. So far the only block capable of using this messages is the udp_source_rate_idle block.
</doc>
</block>

View File

@ -1,56 +0,0 @@
<?xml version="1.0"?>
<block>
<name>Pseudo (De)randomiser with Softbits (CCSDS)</name>
<key>ccsds_randomiser_softbits</key>
<category>CCSDS/Telemetry</category>
<import>import ccsds</import>
<make>ccsds.randomiser_softbits($poly,$seed)</make>
<param>
<name>Generating Polynimoal</name>
<key>poly</key>
<value>0x95</value>
<type>int</type>
</param>
<param>
<name>Seed</name>
<key>seed</key>
<value>0xFF</value>
<type>int</type>
</param>
<check>$poly >= 0</check>
<check>$poly &lt; 256</check>
<check>$seed >= 0</check>
<check>$seed &lt; 256</check>
<sink>
<name>in</name>
<type>message</type>
</sink>
<source>
<name>out</name>
<type>message</type>
</source>
<doc>
Pseudo (De)randomiser
Combines the input frame with a pseudo random sequence by XOR operation. A one
in the PRN sequence will invert the softbit, a zero will copy it untouched. The
pseudo random sequence is generated by an 8-bit linear feedback shift register
(LFSR) as defined in ECSS.
The pseudo random sequence can be modified by the generating polygon as well as
shifted by choosing a different initial seed state.
poly: Polynomial that defines the network of the 8 shift registers. The MSB
encodes whether the last shift register (which is used for the output) should be
used to generate the new input while the LSB encodes whether the first shift
register (that holds the input bit of the last step should be used to generate
the output. Or in ECSS definition: The MSB holds the coefficient for x^0 up to
the LSB which holds coefficient x^7. x^8 is not encoded as it is always set (due
to the fact that this is a maximum length 8 bit shift register). The default
value is 0x95 which corresponds to the randomiser defined in ECSS with the
polynomial representation x^8+x^7+x^5+x^3+x^0.
seed: Initial state of the shift registers. MSB corresponds to the last register
(which will be the output on the next step). Default to all ones as defined in
ECSS.
</doc>
</block>

View File

@ -1,17 +0,0 @@
<?xml version="1.0"?>
<block>
<name>Send Nanolink Frames to REST</name>
<key>ccsds_send_nanolink</key>
<category>[ccsds]</category>
<import>import ccsds</import>
<make>ccsds.send_nanolink($url)</make>
<param>
<name>Url</name>
<key>url</key>
<value>"localhost:8082"</value>
</param>
<sink>
<name>in</name>
<type>message</type>
</sink>
</block>

View File

@ -1,17 +0,0 @@
<?xml version="1.0"?>
<block>
<name>Softbit PDU to Hardbyte PDU</name>
<key>ccsds_soft_to_hard_message</key>
<category>[ccsds]/Conversion</category>
<import>import ccsds</import>
<make>ccsds.soft_to_hard_message()</make>
<sink>
<name>in</name>
<type>message</type>
</sink>
<source>
<name>out</name>
<type>message</type>
</source>
<doc>Convert PDU with softbit payload to PDU with hardbits (compacted to bytes) payload.</doc>
</block>

View File

@ -1,29 +0,0 @@
<?xml version="1.0"?>
<block>
<name>Softbit Message Sink</name>
<key>ccsds_softbit_msg_sink_f</key>
<category>CCSDS/Conversion</category>
<import>import ccsds</import>
<make>ccsds.softbit_msg_sink_f($frame_len)</make>
<param>
<name>Frame length</name>
<key>frame_len</key>
<value>40</value>
<type>int</type>
</param>
<sink>
<name>in</name>
<type>float</type>
</sink>
<source>
<name>out</name>
<type>message</type>
</source>
<doc>
Softbit message sink
Copies portions of Frame length softbits from the input stream to a softbit message.
Frame length: Length of a frame in (soft)bits.
</doc>
</block>

View File

@ -1,29 +0,0 @@
<?xml version="1.0"?>
<block>
<name>Softbit Message Source</name>
<key>ccsds_softbit_msg_source_f</key>
<category>CCSDS/Conversion</category>
<import>import ccsds</import>
<make>ccsds.softbit_msg_source_f($frame_len)</make>
<param>
<name>Frame length</name>
<key>frame_len</key>
<value>40</value>
<type>int</type>
</param>
<sink>
<name>in</name>
<type>message</type>
</sink>
<source>
<name>out</name>
<type>float</type>
</source>
<doc>
Softbit message source
Copies the floats contained in the incomming Softbit messages to the output stream.
Frame length: Length of a frame in (soft)bits.
</doc>
</block>

View File

@ -1,100 +0,0 @@
<?xml version="1.0"?>
<block>
<name>Rate controled UDP source with idle frames</name>
<key>ccsds_udp_source_rate_idle_b</key>
<category>[ccsds]</category>
<throttle>1</throttle>
<import>import ccsds</import>
<make>ccsds.udp_source_rate_idle_b($host_recv, $port_recv, $host_ctl, $port_ctl, $max_frame_length, $block_len, $num_blocks_floating, $idle_pattern)</make>
<param>
<name>Hostname (data)</name>
<key>host_recv</key>
<value>'localhost'</value>
<type>string</type>
</param>
<param>
<name>Port (data)</name>
<key>port_recv</key>
<type>int</type>
</param>
<param>
<name>Hostname (control)</name>
<key>host_ctl</key>
<value>'localhost'</value>
<type>string</type>
</param>
<param>
<name>Port (control)</name>
<key>port_ctl</key>
<type>int</type>
</param>
<param>
<name>Max Frame length (Bytes)</name>
<key>max_frame_length</key>
<value>1024</value>
<type>int</type>
</param>
<param>
<name>Block size (Bytes)</name>
<key>block_len</key>
<value>1024</value>
<type>int</type>
</param>
<param>
<name>Num. blocks floating</name>
<key>num_blocks_floating</key>
<value>10</value>
<type>int</type>
</param>
<param>
<name>Idle pattern</name>
<key>idle_pattern</key>
<value>[0x00, 0xFF,]*12</value>
<type>raw</type>
</param>
<check>$port_recv &gt; 0</check>
<check>$port_ctl &gt; 0</check>
<check>$max_frame_length &gt; 0</check>
<check>$block_len &gt; 0</check>
<check>$num_blocks_floating &gt; 0</check>
<sink>
<name>in</name>
<type>message</type>
</sink>
<source>
<name>out</name>
<type>byte</type>
</source>
<doc>
UDP source with rate control and idle pattern insertion
This block will keep 'Num. blocks floating' blocks of 'Block size' bytes in the downstream processing. It receives "block_out" messages from a downstream block to be notified once a block has left the processing chain at that block and a new one should be inserted by the source.
It receives datagrams of a maximum size of 'Max Frame length' Bytes over the UDP socket listening to the data hostname and port and buffers them internally. If the internal buffer holds more data than what could be send out in 1 block, it sends a control datagram with the 's' Byte (encoded in ASCII) to the control hostname and port. Once the buffer contains less data than required to fill a complete block, it will send a 'g' Byte (encoded in ASCII) to the control hostname and port.
If a new block has to be send out and there is not enough data in the internal buffer to complete the block, (multiple) copies of the idle patterns are inserted at the back of the buffer.
If an element in the buffer does not completely fit into the current block to be send it is split, such that the rest of the element is send as first item of the next block.
The only block so far that provides the "block_out" message is the output_counter block.
'Hostname (data)' and 'Port (data)':
Hostname and port for the UDP socket on which the data arrives and is stored in the internal buffer. The block will bind to this socket (UDP Server).
'Hostname (control)' and 'Port (control)':
Target hostname and port for the control datagrams 's' and 'g'. The block will only send to this socket, but not bind to it (UDP Client).
'Max Frame length':
Maximum frame (datagram) length in Bytes that can be received over the data socket. This value is only used for buffer allocation.
'Block size':
Number of bytes that constitute one data block. The value entered here must correspond to the block size parameter of the downstream block that provides the "block_out" messages or the flowgrapg between the two blocks will fill up, or run empty over time.
'Num. blocks floating':
Number of data blocks that should be in the flowgraph at the same time.
'Idle pattern':
Python vector of Bytes that form the idle pattern. Everytime a new data block has to be send out and there is not enough data in the internal buffer to fill this data block, one or multiple copies of the idle pattern are added to the end of the internal buffer in order to be able to complete the data block transmission. If transmitted, the idle pattern is always transmitted completely.
</doc>
</block>

4975
build/gnuradio/downlink.grc Normal file

File diff suppressed because it is too large Load Diff

315
build/gnuradio/downlink.py Normal file
View File

@ -0,0 +1,315 @@
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
##################################################
# GNU Radio Python Flow Graph
# Title: Downlink from TVAC (This should run all the time)
# Author: Sebastian Rückerl
# Generated: Wed Feb 26 01:20:37 2020
##################################################
if __name__ == '__main__':
import ctypes
import sys
if sys.platform.startswith('linux'):
try:
x11 = ctypes.cdll.LoadLibrary('libX11.so')
x11.XInitThreads()
except:
print "Warning: failed to XInitThreads()"
from PyQt4 import Qt
from gnuradio import analog
from gnuradio import blocks
from gnuradio import digital
from gnuradio import digital;import cmath
from gnuradio import eng_notation
from gnuradio import filter
from gnuradio import gr
from gnuradio import qtgui
from gnuradio.eng_option import eng_option
from gnuradio.filter import firdes
from gnuradio.qtgui import Range, RangeWidget
from optparse import OptionParser
import ccsds
import math
import osmosdr
import sip
import sys
import time
from gnuradio import qtgui
class downlink(gr.top_block, Qt.QWidget):
def __init__(self):
gr.top_block.__init__(self, "Downlink from TVAC (This should run all the time)")
Qt.QWidget.__init__(self)
self.setWindowTitle("Downlink from TVAC (This should run all the time)")
qtgui.util.check_set_qss()
try:
self.setWindowIcon(Qt.QIcon.fromTheme('gnuradio-grc'))
except:
pass
self.top_scroll_layout = Qt.QVBoxLayout()
self.setLayout(self.top_scroll_layout)
self.top_scroll = Qt.QScrollArea()
self.top_scroll.setFrameStyle(Qt.QFrame.NoFrame)
self.top_scroll_layout.addWidget(self.top_scroll)
self.top_scroll.setWidgetResizable(True)
self.top_widget = Qt.QWidget()
self.top_scroll.setWidget(self.top_widget)
self.top_layout = Qt.QVBoxLayout(self.top_widget)
self.top_grid_layout = Qt.QGridLayout()
self.top_layout.addLayout(self.top_grid_layout)
self.settings = Qt.QSettings("GNU Radio", "downlink")
self.restoreGeometry(self.settings.value("geometry").toByteArray())
##################################################
# Variables
##################################################
self.block_len_enc = block_len_enc = 1024/8*2
self.variable_constellation_0 = variable_constellation_0 = digital.constellation_calcdist(([-1, 1]), ([0, 1]), 4, 1).base()
self.samp_rate_factor = samp_rate_factor = 5
self.samp_rate = samp_rate = 250000
self.rgain = rgain = 0
self.payload = payload = block_len_enc+4
self.freq_offset_flag = freq_offset_flag = 0
self.freq_offset = freq_offset = 0
##################################################
# Blocks
##################################################
self._rgain_range = Range(0, 11, 1, 0, 200)
self._rgain_win = RangeWidget(self._rgain_range, self.set_rgain, 'RX Gain', "counter_slider", float)
self.top_grid_layout.addWidget(self._rgain_win)
self._freq_offset_range = Range(-400e3, 400e3, 1.5e3, 0, 200)
self._freq_offset_win = RangeWidget(self._freq_offset_range, self.set_freq_offset, 'Frequency Offset', "counter_slider", float)
self.top_grid_layout.addWidget(self._freq_offset_win)
self.rational_resampler_xxx_1 = filter.rational_resampler_ccc(
interpolation=1,
decimation=5,
taps=None,
fractional_bw=None,
)
self.qtgui_sink_x_1 = qtgui.sink_c(
1024, #fftsize
firdes.WIN_BLACKMAN_hARRIS, #wintype
0, #fc
samp_rate, #bw
"", #name
False, #plotfreq
False, #plotwaterfall
False, #plottime
True, #plotconst
)
self.qtgui_sink_x_1.set_update_time(1.0/10)
self._qtgui_sink_x_1_win = sip.wrapinstance(self.qtgui_sink_x_1.pyqwidget(), Qt.QWidget)
self.top_grid_layout.addWidget(self._qtgui_sink_x_1_win)
self.qtgui_sink_x_1.enable_rf_freq(False)
self.qtgui_sink_x_0_0_1 = qtgui.sink_c(
1024, #fftsize
firdes.WIN_BLACKMAN_hARRIS, #wintype
0, #fc
samp_rate, #bw
"Vor Sync", #name
True, #plotfreq
True, #plotwaterfall
True, #plottime
True, #plotconst
)
self.qtgui_sink_x_0_0_1.set_update_time(1.0/10)
self._qtgui_sink_x_0_0_1_win = sip.wrapinstance(self.qtgui_sink_x_0_0_1.pyqwidget(), Qt.QWidget)
self.top_grid_layout.addWidget(self._qtgui_sink_x_0_0_1_win)
self.qtgui_sink_x_0_0_1.enable_rf_freq(False)
self.qtgui_sink_x_0_0 = qtgui.sink_c(
1024, #fftsize
firdes.WIN_BLACKMAN_hARRIS, #wintype
0, #fc
samp_rate*samp_rate_factor, #bw
"Vor Sync", #name
True, #plotfreq
True, #plotwaterfall
True, #plottime
True, #plotconst
)
self.qtgui_sink_x_0_0.set_update_time(1.0/10)
self._qtgui_sink_x_0_0_win = sip.wrapinstance(self.qtgui_sink_x_0_0.pyqwidget(), Qt.QWidget)
self.top_grid_layout.addWidget(self._qtgui_sink_x_0_0_win)
self.qtgui_sink_x_0_0.enable_rf_freq(False)
self.osmosdr_source_0 = osmosdr.source( args="numchan=" + str(1) + " " + 'rtl=0' )
self.osmosdr_source_0.set_sample_rate(samp_rate*samp_rate_factor)
self.osmosdr_source_0.set_center_freq(145.79e6, 0)
self.osmosdr_source_0.set_freq_corr(0, 0)
self.osmosdr_source_0.set_dc_offset_mode(0, 0)
self.osmosdr_source_0.set_iq_balance_mode(0, 0)
self.osmosdr_source_0.set_gain_mode(False, 0)
self.osmosdr_source_0.set_gain(rgain, 0)
self.osmosdr_source_0.set_if_gain(0, 0)
self.osmosdr_source_0.set_bb_gain(0, 0)
self.osmosdr_source_0.set_antenna('', 0)
self.osmosdr_source_0.set_bandwidth(0, 0)
self._freq_offset_flag_range = Range(0, 1, 1, 0, 200)
self._freq_offset_flag_win = RangeWidget(self._freq_offset_flag_range, self.set_freq_offset_flag, 'Enable flatsat freq', "counter_slider", float)
self.top_grid_layout.addWidget(self._freq_offset_flag_win)
self.fir_filter_xxx_0 = filter.fir_filter_ccc(samp_rate_factor, (1, ))
self.fir_filter_xxx_0.declare_sample_delay(0)
self.digital_mpsk_receiver_cc_0_0 = digital.mpsk_receiver_cc(2, 0, cmath.pi/100.0, -0.05, 0.05, 0.25, 0.05, 4, 4, 0.005)
self.digital_constellation_decoder_cb_0 = digital.constellation_decoder_cb(variable_constellation_0)
self.ccsds_softbits_msg_to_bytes_b_0 = ccsds.softbits_msg_to_bytes_b()
self.ccsds_randomiser_softbits_0 = ccsds.randomiser_softbits(0x95,0xFF)
self.ccsds_mpsk_ambiguity_resolver_f_0 = ccsds.mpsk_ambiguity_resolver_f(2,'49E0DCC7',32,1,0.8,block_len_enc,0)
self.ccsds_message_info_0 = ccsds.message_info("Block received and sent to Nanolink: ", 10)
self.ccsds_ldpc_decoder_0 = ccsds.ldpc_decoder('/app/gnuradio/AR4JA_r12_k1024n.a', ccsds.LDPC_SYS_FRONT, ccsds.LDPC_PUNCT_BACK, 512, tuple(([])), False)
self.ccsds_blob_msg_sink_b_0 = ccsds.blob_msg_sink_b(256/2)
self.blocks_udp_sink_0_1 = blocks.udp_sink(gr.sizeof_char*1, '127.0.0.1', 5431, 256, True)
self.blocks_udp_sink_0_0 = blocks.udp_sink(gr.sizeof_char*1, '127.0.0.1', 5433, 1472, True)
self.blocks_udp_sink_0 = blocks.udp_sink(gr.sizeof_gr_complex*1, '127.0.0.1', 5435, 1472, True)
self.blocks_null_sink_1 = blocks.null_sink(gr.sizeof_char*1)
self.blocks_multiply_xx_0_0 = blocks.multiply_vcc(1)
self.blocks_multiply_xx_0 = blocks.multiply_vcc(1)
self.blocks_char_to_float_0 = blocks.char_to_float(1, 0.5)
self.blocks_add_const_vxx_0 = blocks.add_const_vff((-1, ))
self.band_pass_filter_0 = filter.fir_filter_ccc(1, firdes.complex_band_pass(
1, samp_rate*samp_rate_factor, 40e3, 60e3, 6e3, firdes.WIN_HAMMING, 6.76))
self.analog_sig_source_x_0_0 = analog.sig_source_c(samp_rate*samp_rate_factor, analog.GR_COS_WAVE, -freq_offset, 1, 0)
self.analog_sig_source_x_0 = analog.sig_source_c(samp_rate, analog.GR_COS_WAVE, -50000, 1, 0)
self.analog_agc_xx_0 = analog.agc_cc(1e-4, 0.5, 1.0)
self.analog_agc_xx_0.set_max_gain(65536)
##################################################
# Connections
##################################################
self.msg_connect((self.ccsds_blob_msg_sink_b_0, 'out'), (self.ccsds_message_info_0, 'in'))
self.msg_connect((self.ccsds_ldpc_decoder_0, 'out'), (self.ccsds_softbits_msg_to_bytes_b_0, 'in'))
self.msg_connect((self.ccsds_mpsk_ambiguity_resolver_f_0, 'out'), (self.ccsds_randomiser_softbits_0, 'in'))
self.msg_connect((self.ccsds_randomiser_softbits_0, 'out'), (self.ccsds_ldpc_decoder_0, 'in'))
self.connect((self.analog_agc_xx_0, 0), (self.rational_resampler_xxx_1, 0))
self.connect((self.analog_sig_source_x_0, 0), (self.blocks_multiply_xx_0, 0))
self.connect((self.analog_sig_source_x_0_0, 0), (self.blocks_multiply_xx_0_0, 0))
self.connect((self.band_pass_filter_0, 0), (self.fir_filter_xxx_0, 0))
self.connect((self.blocks_add_const_vxx_0, 0), (self.ccsds_mpsk_ambiguity_resolver_f_0, 0))
self.connect((self.blocks_char_to_float_0, 0), (self.blocks_add_const_vxx_0, 0))
self.connect((self.blocks_multiply_xx_0, 0), (self.analog_agc_xx_0, 0))
self.connect((self.blocks_multiply_xx_0, 0), (self.qtgui_sink_x_0_0_1, 0))
self.connect((self.blocks_multiply_xx_0_0, 0), (self.band_pass_filter_0, 0))
self.connect((self.ccsds_softbits_msg_to_bytes_b_0, 0), (self.blocks_null_sink_1, 0))
self.connect((self.ccsds_softbits_msg_to_bytes_b_0, 0), (self.blocks_udp_sink_0_1, 0))
self.connect((self.ccsds_softbits_msg_to_bytes_b_0, 0), (self.ccsds_blob_msg_sink_b_0, 0))
self.connect((self.digital_constellation_decoder_cb_0, 0), (self.blocks_char_to_float_0, 0))
self.connect((self.digital_constellation_decoder_cb_0, 0), (self.blocks_udp_sink_0_0, 0))
self.connect((self.digital_mpsk_receiver_cc_0_0, 0), (self.digital_constellation_decoder_cb_0, 0))
self.connect((self.digital_mpsk_receiver_cc_0_0, 0), (self.qtgui_sink_x_1, 0))
self.connect((self.fir_filter_xxx_0, 0), (self.blocks_multiply_xx_0, 1))
self.connect((self.osmosdr_source_0, 0), (self.blocks_multiply_xx_0_0, 1))
self.connect((self.osmosdr_source_0, 0), (self.blocks_udp_sink_0, 0))
self.connect((self.osmosdr_source_0, 0), (self.qtgui_sink_x_0_0, 0))
self.connect((self.rational_resampler_xxx_1, 0), (self.digital_mpsk_receiver_cc_0_0, 0))
def closeEvent(self, event):
self.settings = Qt.QSettings("GNU Radio", "downlink")
self.settings.setValue("geometry", self.saveGeometry())
event.accept()
def get_block_len_enc(self):
return self.block_len_enc
def set_block_len_enc(self, block_len_enc):
self.block_len_enc = block_len_enc
self.set_payload(self.block_len_enc+4)
def get_variable_constellation_0(self):
return self.variable_constellation_0
def set_variable_constellation_0(self, variable_constellation_0):
self.variable_constellation_0 = variable_constellation_0
def get_samp_rate_factor(self):
return self.samp_rate_factor
def set_samp_rate_factor(self, samp_rate_factor):
self.samp_rate_factor = samp_rate_factor
self.qtgui_sink_x_0_0.set_frequency_range(0, self.samp_rate*self.samp_rate_factor)
self.osmosdr_source_0.set_sample_rate(self.samp_rate*self.samp_rate_factor)
self.band_pass_filter_0.set_taps(firdes.complex_band_pass(1, self.samp_rate*self.samp_rate_factor, 40e3, 60e3, 6e3, firdes.WIN_HAMMING, 6.76))
self.analog_sig_source_x_0_0.set_sampling_freq(self.samp_rate*self.samp_rate_factor)
def get_samp_rate(self):
return self.samp_rate
def set_samp_rate(self, samp_rate):
self.samp_rate = samp_rate
self.qtgui_sink_x_1.set_frequency_range(0, self.samp_rate)
self.qtgui_sink_x_0_0_1.set_frequency_range(0, self.samp_rate)
self.qtgui_sink_x_0_0.set_frequency_range(0, self.samp_rate*self.samp_rate_factor)
self.osmosdr_source_0.set_sample_rate(self.samp_rate*self.samp_rate_factor)
self.band_pass_filter_0.set_taps(firdes.complex_band_pass(1, self.samp_rate*self.samp_rate_factor, 40e3, 60e3, 6e3, firdes.WIN_HAMMING, 6.76))
self.analog_sig_source_x_0_0.set_sampling_freq(self.samp_rate*self.samp_rate_factor)
self.analog_sig_source_x_0.set_sampling_freq(self.samp_rate)
def get_rgain(self):
return self.rgain
def set_rgain(self, rgain):
self.rgain = rgain
self.osmosdr_source_0.set_gain(self.rgain, 0)
def get_payload(self):
return self.payload
def set_payload(self, payload):
self.payload = payload
def get_freq_offset_flag(self):
return self.freq_offset_flag
def set_freq_offset_flag(self, freq_offset_flag):
self.freq_offset_flag = freq_offset_flag
def get_freq_offset(self):
return self.freq_offset
def set_freq_offset(self, freq_offset):
self.freq_offset = freq_offset
self.analog_sig_source_x_0_0.set_frequency(-self.freq_offset)
def main(top_block_cls=downlink, options=None):
from distutils.version import StrictVersion
if StrictVersion(Qt.qVersion()) >= StrictVersion("4.5.0"):
style = gr.prefs().get_string('qtgui', 'style', 'raster')
Qt.QApplication.setGraphicsSystem(style)
qapp = Qt.QApplication(sys.argv)
tb = top_block_cls()
tb.start(2080)
tb.show()
def quitting():
tb.stop()
tb.wait()
qapp.connect(qapp, Qt.SIGNAL("aboutToQuit()"), quitting)
qapp.exec_()
if __name__ == '__main__':
main()

View File

@ -4,4 +4,4 @@ mkdir -p /app/data/output
touch /app/data/output/frames.txt
python3 /app/fakeserver/server.py &
bash
/app/gnuradio/downlink.py

View File

@ -4,4 +4,4 @@ mkdir -p /app/data/output
touch /app/data/output/frames.txt
python3 /app/fakeserver/server.py &
gnuradio-companion
gnuradio-companion /app/gnuradio/downlink.grc

10
scripts/run-dev-gui.sh Normal file
View File

@ -0,0 +1,10 @@
#!/bin/bash
cd "${0%/*}/.."
source ./config/config.sh
docker run -it --rm \
-v $(pwd)/data:/app/data:rw \
--env DISPLAY=host.docker.internal:0.0 \
--entrypoint /app/run-gui.sh \
move2docker:dev-$(arch)