Skip to content

Commit 57069ee

Browse files
Hamze-Issadaniestevez
authored andcommitted
Added MYSAT1 telemetry parser
1 parent 190dc50 commit 57069ee

7 files changed

+208
-37
lines changed

apps/mysat1.grc

+38-37
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version='1.0' encoding='utf-8'?>
2-
<?grc format='1' created='3.7.13'?>
2+
<?grc format='1' created='3.7.11'?>
33
<flow_graph>
44
<timestamp>Fri Aug 26 17:29:51 2016</timestamp>
55
<block>
@@ -72,10 +72,6 @@
7272
<key>run</key>
7373
<value>True</value>
7474
</param>
75-
<param>
76-
<key>sizing_mode</key>
77-
<value>fixed</value>
78-
</param>
7975
<param>
8076
<key>thread_safe_setters</key>
8177
<value></value>
@@ -84,10 +80,6 @@
8480
<key>title</key>
8581
<value>MYSAT 1 decoder</value>
8682
</param>
87-
<param>
88-
<key>placement</key>
89-
<value>(0,0)</value>
90-
</param>
9183
</block>
9284
<block>
9385
<key>variable</key>
@@ -356,10 +348,6 @@
356348
<key>short_id</key>
357349
<value></value>
358350
</param>
359-
<param>
360-
<key>hide</key>
361-
<value>none</value>
362-
</param>
363351
<param>
364352
<key>type</key>
365353
<value>eng_float</value>
@@ -689,10 +677,6 @@
689677
<key>short_id</key>
690678
<value></value>
691679
</param>
692-
<param>
693-
<key>hide</key>
694-
<value>none</value>
695-
</param>
696680
<param>
697681
<key>type</key>
698682
<value>string</value>
@@ -1455,10 +1439,6 @@
14551439
<key>short_id</key>
14561440
<value></value>
14571441
</param>
1458-
<param>
1459-
<key>hide</key>
1460-
<value>none</value>
1461-
</param>
14621442
<param>
14631443
<key>type</key>
14641444
<value>string</value>
@@ -1502,10 +1482,6 @@
15021482
<key>short_id</key>
15031483
<value></value>
15041484
</param>
1505-
<param>
1506-
<key>hide</key>
1507-
<value>none</value>
1508-
</param>
15091485
<param>
15101486
<key>type</key>
15111487
<value>eng_float</value>
@@ -1549,10 +1525,6 @@
15491525
<key>short_id</key>
15501526
<value></value>
15511527
</param>
1552-
<param>
1553-
<key>hide</key>
1554-
<value>none</value>
1555-
</param>
15561528
<param>
15571529
<key>type</key>
15581530
<value>eng_float</value>
@@ -1637,6 +1609,37 @@
16371609
<value>firdes.WIN_HAMMING</value>
16381610
</param>
16391611
</block>
1612+
<block>
1613+
<key>mysat1_100_telemetry_parser</key>
1614+
<param>
1615+
<key>alias</key>
1616+
<value></value>
1617+
</param>
1618+
<param>
1619+
<key>comment</key>
1620+
<value></value>
1621+
</param>
1622+
<param>
1623+
<key>affinity</key>
1624+
<value></value>
1625+
</param>
1626+
<param>
1627+
<key>_enabled</key>
1628+
<value>True</value>
1629+
</param>
1630+
<param>
1631+
<key>_coordinate</key>
1632+
<value>(352, 920)</value>
1633+
</param>
1634+
<param>
1635+
<key>_rotation</key>
1636+
<value>0</value>
1637+
</param>
1638+
<param>
1639+
<key>id</key>
1640+
<value>mysat1_100_telemetry_parser_0</value>
1641+
</param>
1642+
</block>
16401643
<block>
16411644
<key>note</key>
16421645
<param>
@@ -1733,10 +1736,6 @@
17331736
<key>short_id</key>
17341737
<value></value>
17351738
</param>
1736-
<param>
1737-
<key>hide</key>
1738-
<value>none</value>
1739-
</param>
17401739
<param>
17411740
<key>type</key>
17421741
<value>intx</value>
@@ -1780,10 +1779,6 @@
17801779
<key>short_id</key>
17811780
<value></value>
17821781
</param>
1783-
<param>
1784-
<key>hide</key>
1785-
<value>none</value>
1786-
</param>
17871782
<param>
17881783
<key>type</key>
17891784
<value>string</value>
@@ -2368,6 +2363,12 @@
23682363
<source_key>out</source_key>
23692364
<sink_key>print_pdu</sink_key>
23702365
</connection>
2366+
<connection>
2367+
<source_block_id>satellites_print_timestamp_0</source_block_id>
2368+
<sink_block_id>mysat1_100_telemetry_parser_0</sink_block_id>
2369+
<source_key>out</source_key>
2370+
<sink_key>in</sink_key>
2371+
</connection>
23712372
<connection>
23722373
<source_block_id>satellites_print_timestamp_0</source_block_id>
23732374
<sink_block_id>satellites_pdu_to_kiss_0</sink_block_id>

grc/CMakeLists.txt

+1
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ install(FILES
7878
satellites_cc11xx_remove_length.xml
7979
satellites_sat_3cat_1_telemetry_parser.xml
8080
satellites_suomi_100_telemetry_parser.xml
81+
satellites_mysat1_telemetry_parser.xml
8182
satellites_pwsat2_telemetry_parser.xml
8283
satellites_pwsat2_submitter.xml
8384
satellites_eseo_packet_crop.xml
+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?xml version="1.0"?>
2+
<block>
3+
<name>Mysat1 Telemetry Parser</name>
4+
<key>mysat1_100_telemetry_parser</key>
5+
<category>[Satellites]/Telemetry</category>
6+
<import>import satellites</import>
7+
<make>satellites.mysat1_telemetry_parser()</make>
8+
9+
<sink>
10+
<name>in</name>
11+
<type>message</type>
12+
</sink>
13+
</block>

python/CMakeLists.txt

+2
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,8 @@ GR_PYTHON_INSTALL(
9696
sat_3cat_1_telemetry_parser.py
9797
suomi_100_telemetry.py
9898
suomi_100_telemetry_parser.py
99+
mysat1_telemetry.py
100+
mysat1_telemetry_parser.py
99101
pwsat2_telemetry_parser.py
100102
pwsat2_submitter.py
101103
eseo_packet_crop.py

python/__init__.py

+2
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,8 @@
104104

105105
from suomi_100_telemetry_parser import suomi_100_telemetry_parser
106106

107+
from mysat1_telemetry_parser import mysat1_telemetry_parser
108+
107109
from pwsat2_telemetry_parser import pwsat2_telemetry_parser
108110
from pwsat2_submitter import pwsat2_submitter
109111

python/mysat1_telemetry.py

+97
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
#!/usr/bin/env python
2+
# -*- coding: utf-8 -*-
3+
#
4+
# Copyright 2018 Daniel Estevez <[email protected]>
5+
#
6+
# This is free software; you can redistribute it and/or modify
7+
# it under the terms of the GNU General Public License as published by
8+
# the Free Software Foundation; either version 3, or (at your option)
9+
# any later version.
10+
#
11+
# This software is distributed in the hope that it will be useful,
12+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
13+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14+
# GNU General Public License for more details.
15+
#
16+
# You should have received a copy of the GNU General Public License
17+
# along with this software; see the file COPYING. If not, write to
18+
# the Free Software Foundation, Inc., 51 Franklin Street,
19+
# Boston, MA 02110-1301, USA.
20+
#
21+
22+
from construct import *
23+
from adapters import *
24+
25+
Timestamp = UNIXTimestampAdapter(Int32ul)
26+
27+
Callsign = Struct(
28+
'callsign' / Bytes(5))
29+
30+
OBC = Struct(
31+
'obc_mode' / Int8ul,
32+
'obc_reset_counter' / Int32ul,
33+
'obc_uptime' / Int32ul)
34+
35+
Gyro = Struct(
36+
'gyro_norm' / Int8ul)
37+
38+
EPS = Struct(
39+
'eps_counter_boot' / Int32ul,
40+
'eps_last_boot_cause' / Int8ul,
41+
'eps_battery_mode' / Int8ul)
42+
43+
Timestamp_Struct = Struct(
44+
'timestamp' / Timestamp)
45+
46+
OBC_Temp = Struct(
47+
'obc_temp' / AffineAdapter(1, 128, Int8ul),
48+
'obc_daughter_board_temp' / AffineAdapter(1, 128, Int8ul))
49+
50+
EPS_Temp = Struct(
51+
'eps_battery_temp' / AffineAdapter(1, 128, Int8ul),
52+
'eps_board_temp' / AffineAdapter(1, 128, Int8ul))
53+
54+
Ants = Struct(
55+
'ants_temp' / AffineAdapter(1, 128, Int8ul))
56+
57+
TRXVU_Temp = Struct(
58+
'trxvu_temp' / AffineAdapter(1, 128, Int8ul))
59+
60+
ADCS = Struct(
61+
'adcs_temp' / AffineAdapter(1, 128, Int8ul))
62+
63+
OBC_Voltages = Struct(
64+
'obc_3v3_voltage' / LinearAdapter(10.0, Int8ul),
65+
'obc_5v0_voltage' / LinearAdapter(10.0, Int8ul))
66+
67+
TRXVU_Voltage = Struct(
68+
'trxvu_voltage' / LinearAdapter(10.0, Int8ul))
69+
70+
EPS_Batt_Voltage = Struct(
71+
'eps_batt_voltage' / LinearAdapter(10.0, Int8ul))
72+
73+
OBC_Current = Struct(
74+
'obc_5.0_current' / LinearAdapter(1000.0, Int16ul))
75+
76+
EPS_Currents = Struct(
77+
'eps_total_pv_current' / LinearAdapter(1000.0, Int16ul),
78+
'eps_total_system_current' / LinearAdapter(1000.0, Int16ul))
79+
80+
Beacon0 = Struct(
81+
'callsign' / Callsign,
82+
'obc' / OBC,
83+
'gyro' / Gyro,
84+
'eps' / EPS,
85+
'timestamp' / Timestamp_Struct,
86+
'obc_temp' / OBC_Temp,
87+
'eps_temp' / EPS_Temp,
88+
'ants' / Ants,
89+
'trxvu_temp' / TRXVU_Temp,
90+
'adcs' / ADCS,
91+
'obc_voltages' / OBC_Voltages,
92+
'trxvu_voltage' / TRXVU_Voltage,
93+
'eps_batt_voltage' / EPS_Batt_Voltage,
94+
'obc_current' / OBC_Current,
95+
'eps_currents' / EPS_Currents)
96+
97+
Beacon = Select(Beacon0)

python/mysat1_telemetry_parser.py

+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
#!/usr/bin/env python
2+
# -*- coding: utf-8 -*-
3+
#
4+
# Copyright 2018 Daniel Estevez <[email protected]>
5+
#
6+
# This is free software; you can redistribute it and/or modify
7+
# it under the terms of the GNU General Public License as published by
8+
# the Free Software Foundation; either version 3, or (at your option)
9+
# any later version.
10+
#
11+
# This software is distributed in the hope that it will be useful,
12+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
13+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14+
# GNU General Public License for more details.
15+
#
16+
# You should have received a copy of the GNU General Public License
17+
# along with this software; see the file COPYING. If not, write to
18+
# the Free Software Foundation, Inc., 51 Franklin Street,
19+
# Boston, MA 02110-1301, USA.
20+
#
21+
22+
import numpy
23+
from gnuradio import gr
24+
import pmt
25+
26+
import mysat1_telemetry
27+
28+
class mysat1_telemetry_parser(gr.basic_block):
29+
"""
30+
docstring for block mysat1_telemetry_parser
31+
"""
32+
def __init__(self):
33+
gr.basic_block.__init__(self,
34+
name="mysat1_telemetry_parser",
35+
in_sig=[],
36+
out_sig=[])
37+
38+
self.message_port_register_in(pmt.intern('in'))
39+
self.set_msg_handler(pmt.intern('in'), self.handle_msg)
40+
41+
def handle_msg(self, msg_pmt):
42+
msg = pmt.cdr(msg_pmt)
43+
# print (msg)
44+
if not pmt.is_u8vector(msg):
45+
print "[ERROR] Received invalid message type. Expected u8vector"
46+
return
47+
packet = bytearray(pmt.u8vector_elements(msg))
48+
49+
try:
50+
data = mysat1_telemetry.Beacon.parse(packet[16:])
51+
except:
52+
print "Could not decode telemetry beacon"
53+
return
54+
print(data)
55+

0 commit comments

Comments
 (0)