├── .gitignore
├── LICENSE
├── README.md
├── addons
├── Dockerfile
├── README.md
├── build.sh
├── direwolf.conf
├── gnuradio
│ ├── log.conf
│ └── udp.conf
├── grc
│ ├── udp2ishort.grc
│ └── udp2ishort.png
├── packages.builder
├── packages.client
├── packages.pip
├── packages.rust
├── sat.cfg
├── satdump_cfg.json
├── satyaml
│ └── .gitignore
└── scripts
│ ├── bandscan.sh
│ ├── check-sdr.sh
│ ├── direwolf.sh
│ ├── find_samp_rate.py
│ ├── gpio.py
│ ├── grsat.py
│ ├── imagedecode.py
│ ├── iq_dump_rename.sh
│ ├── liveupdate-satyaml.sh
│ ├── meminfo.py
│ ├── meteor.sh
│ ├── rotor-park.sh
│ ├── satdump.sh
│ ├── satnogs-post
│ ├── satnogs-pre
│ ├── sdrplay.sh
│ ├── test-flowgraph.sh
│ └── wf2png.py
├── lsf
├── .gitignore
├── 10-satnogs.rules
├── LSF-GUIDE.md
├── README.md
├── docker-compose.maxed
├── docker-compose.yml
├── notes.txt
├── satnogs-blacklist.conf
└── station.env-dist
├── sa2kng
├── Dockerfile
├── Dockerfile.obs
├── README.md
├── build-addons.sh
├── build-obs.sh
├── build.sh
├── packages.builder
└── packages.client
└── update-docker-cli.sh
/.gitignore:
--------------------------------------------------------------------------------
1 | # build dir
2 | build
3 | .idea
4 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | GNU AFFERO GENERAL PUBLIC LICENSE
2 | Version 3, 19 November 2007
3 |
4 | Copyright (C) 2007 Free Software Foundation, Inc.
5 | Everyone is permitted to copy and distribute verbatim copies
6 | of this license document, but changing it is not allowed.
7 |
8 | Preamble
9 |
10 | The GNU Affero General Public License is a free, copyleft license for
11 | software and other kinds of works, specifically designed to ensure
12 | cooperation with the community in the case of network server software.
13 |
14 | The licenses for most software and other practical works are designed
15 | to take away your freedom to share and change the works. By contrast,
16 | our General Public Licenses are intended to guarantee your freedom to
17 | share and change all versions of a program--to make sure it remains free
18 | software for all its users.
19 |
20 | When we speak of free software, we are referring to freedom, not
21 | price. Our General Public Licenses are designed to make sure that you
22 | have the freedom to distribute copies of free software (and charge for
23 | them if you wish), that you receive source code or can get it if you
24 | want it, that you can change the software or use pieces of it in new
25 | free programs, and that you know you can do these things.
26 |
27 | Developers that use our General Public Licenses protect your rights
28 | with two steps: (1) assert copyright on the software, and (2) offer
29 | you this License which gives you legal permission to copy, distribute
30 | and/or modify the software.
31 |
32 | A secondary benefit of defending all users' freedom is that
33 | improvements made in alternate versions of the program, if they
34 | receive widespread use, become available for other developers to
35 | incorporate. Many developers of free software are heartened and
36 | encouraged by the resulting cooperation. However, in the case of
37 | software used on network servers, this result may fail to come about.
38 | The GNU General Public License permits making a modified version and
39 | letting the public access it on a server without ever releasing its
40 | source code to the public.
41 |
42 | The GNU Affero General Public License is designed specifically to
43 | ensure that, in such cases, the modified source code becomes available
44 | to the community. It requires the operator of a network server to
45 | provide the source code of the modified version running there to the
46 | users of that server. Therefore, public use of a modified version, on
47 | a publicly accessible server, gives the public access to the source
48 | code of the modified version.
49 |
50 | An older license, called the Affero General Public License and
51 | published by Affero, was designed to accomplish similar goals. This is
52 | a different license, not a version of the Affero GPL, but Affero has
53 | released a new version of the Affero GPL which permits relicensing under
54 | this license.
55 |
56 | The precise terms and conditions for copying, distribution and
57 | modification follow.
58 |
59 | TERMS AND CONDITIONS
60 |
61 | 0. Definitions.
62 |
63 | "This License" refers to version 3 of the GNU Affero General Public License.
64 |
65 | "Copyright" also means copyright-like laws that apply to other kinds of
66 | works, such as semiconductor masks.
67 |
68 | "The Program" refers to any copyrightable work licensed under this
69 | License. Each licensee is addressed as "you". "Licensees" and
70 | "recipients" may be individuals or organizations.
71 |
72 | To "modify" a work means to copy from or adapt all or part of the work
73 | in a fashion requiring copyright permission, other than the making of an
74 | exact copy. The resulting work is called a "modified version" of the
75 | earlier work or a work "based on" the earlier work.
76 |
77 | A "covered work" means either the unmodified Program or a work based
78 | on the Program.
79 |
80 | To "propagate" a work means to do anything with it that, without
81 | permission, would make you directly or secondarily liable for
82 | infringement under applicable copyright law, except executing it on a
83 | computer or modifying a private copy. Propagation includes copying,
84 | distribution (with or without modification), making available to the
85 | public, and in some countries other activities as well.
86 |
87 | To "convey" a work means any kind of propagation that enables other
88 | parties to make or receive copies. Mere interaction with a user through
89 | a computer network, with no transfer of a copy, is not conveying.
90 |
91 | An interactive user interface displays "Appropriate Legal Notices"
92 | to the extent that it includes a convenient and prominently visible
93 | feature that (1) displays an appropriate copyright notice, and (2)
94 | tells the user that there is no warranty for the work (except to the
95 | extent that warranties are provided), that licensees may convey the
96 | work under this License, and how to view a copy of this License. If
97 | the interface presents a list of user commands or options, such as a
98 | menu, a prominent item in the list meets this criterion.
99 |
100 | 1. Source Code.
101 |
102 | The "source code" for a work means the preferred form of the work
103 | for making modifications to it. "Object code" means any non-source
104 | form of a work.
105 |
106 | A "Standard Interface" means an interface that either is an official
107 | standard defined by a recognized standards body, or, in the case of
108 | interfaces specified for a particular programming language, one that
109 | is widely used among developers working in that language.
110 |
111 | The "System Libraries" of an executable work include anything, other
112 | than the work as a whole, that (a) is included in the normal form of
113 | packaging a Major Component, but which is not part of that Major
114 | Component, and (b) serves only to enable use of the work with that
115 | Major Component, or to implement a Standard Interface for which an
116 | implementation is available to the public in source code form. A
117 | "Major Component", in this context, means a major essential component
118 | (kernel, window system, and so on) of the specific operating system
119 | (if any) on which the executable work runs, or a compiler used to
120 | produce the work, or an object code interpreter used to run it.
121 |
122 | The "Corresponding Source" for a work in object code form means all
123 | the source code needed to generate, install, and (for an executable
124 | work) run the object code and to modify the work, including scripts to
125 | control those activities. However, it does not include the work's
126 | System Libraries, or general-purpose tools or generally available free
127 | programs which are used unmodified in performing those activities but
128 | which are not part of the work. For example, Corresponding Source
129 | includes interface definition files associated with source files for
130 | the work, and the source code for shared libraries and dynamically
131 | linked subprograms that the work is specifically designed to require,
132 | such as by intimate data communication or control flow between those
133 | subprograms and other parts of the work.
134 |
135 | The Corresponding Source need not include anything that users
136 | can regenerate automatically from other parts of the Corresponding
137 | Source.
138 |
139 | The Corresponding Source for a work in source code form is that
140 | same work.
141 |
142 | 2. Basic Permissions.
143 |
144 | All rights granted under this License are granted for the term of
145 | copyright on the Program, and are irrevocable provided the stated
146 | conditions are met. This License explicitly affirms your unlimited
147 | permission to run the unmodified Program. The output from running a
148 | covered work is covered by this License only if the output, given its
149 | content, constitutes a covered work. This License acknowledges your
150 | rights of fair use or other equivalent, as provided by copyright law.
151 |
152 | You may make, run and propagate covered works that you do not
153 | convey, without conditions so long as your license otherwise remains
154 | in force. You may convey covered works to others for the sole purpose
155 | of having them make modifications exclusively for you, or provide you
156 | with facilities for running those works, provided that you comply with
157 | the terms of this License in conveying all material for which you do
158 | not control copyright. Those thus making or running the covered works
159 | for you must do so exclusively on your behalf, under your direction
160 | and control, on terms that prohibit them from making any copies of
161 | your copyrighted material outside their relationship with you.
162 |
163 | Conveying under any other circumstances is permitted solely under
164 | the conditions stated below. Sublicensing is not allowed; section 10
165 | makes it unnecessary.
166 |
167 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
168 |
169 | No covered work shall be deemed part of an effective technological
170 | measure under any applicable law fulfilling obligations under article
171 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or
172 | similar laws prohibiting or restricting circumvention of such
173 | measures.
174 |
175 | When you convey a covered work, you waive any legal power to forbid
176 | circumvention of technological measures to the extent such circumvention
177 | is effected by exercising rights under this License with respect to
178 | the covered work, and you disclaim any intention to limit operation or
179 | modification of the work as a means of enforcing, against the work's
180 | users, your or third parties' legal rights to forbid circumvention of
181 | technological measures.
182 |
183 | 4. Conveying Verbatim Copies.
184 |
185 | You may convey verbatim copies of the Program's source code as you
186 | receive it, in any medium, provided that you conspicuously and
187 | appropriately publish on each copy an appropriate copyright notice;
188 | keep intact all notices stating that this License and any
189 | non-permissive terms added in accord with section 7 apply to the code;
190 | keep intact all notices of the absence of any warranty; and give all
191 | recipients a copy of this License along with the Program.
192 |
193 | You may charge any price or no price for each copy that you convey,
194 | and you may offer support or warranty protection for a fee.
195 |
196 | 5. Conveying Modified Source Versions.
197 |
198 | You may convey a work based on the Program, or the modifications to
199 | produce it from the Program, in the form of source code under the
200 | terms of section 4, provided that you also meet all of these conditions:
201 |
202 | a) The work must carry prominent notices stating that you modified
203 | it, and giving a relevant date.
204 |
205 | b) The work must carry prominent notices stating that it is
206 | released under this License and any conditions added under section
207 | 7. This requirement modifies the requirement in section 4 to
208 | "keep intact all notices".
209 |
210 | c) You must license the entire work, as a whole, under this
211 | License to anyone who comes into possession of a copy. This
212 | License will therefore apply, along with any applicable section 7
213 | additional terms, to the whole of the work, and all its parts,
214 | regardless of how they are packaged. This License gives no
215 | permission to license the work in any other way, but it does not
216 | invalidate such permission if you have separately received it.
217 |
218 | d) If the work has interactive user interfaces, each must display
219 | Appropriate Legal Notices; however, if the Program has interactive
220 | interfaces that do not display Appropriate Legal Notices, your
221 | work need not make them do so.
222 |
223 | A compilation of a covered work with other separate and independent
224 | works, which are not by their nature extensions of the covered work,
225 | and which are not combined with it such as to form a larger program,
226 | in or on a volume of a storage or distribution medium, is called an
227 | "aggregate" if the compilation and its resulting copyright are not
228 | used to limit the access or legal rights of the compilation's users
229 | beyond what the individual works permit. Inclusion of a covered work
230 | in an aggregate does not cause this License to apply to the other
231 | parts of the aggregate.
232 |
233 | 6. Conveying Non-Source Forms.
234 |
235 | You may convey a covered work in object code form under the terms
236 | of sections 4 and 5, provided that you also convey the
237 | machine-readable Corresponding Source under the terms of this License,
238 | in one of these ways:
239 |
240 | a) Convey the object code in, or embodied in, a physical product
241 | (including a physical distribution medium), accompanied by the
242 | Corresponding Source fixed on a durable physical medium
243 | customarily used for software interchange.
244 |
245 | b) Convey the object code in, or embodied in, a physical product
246 | (including a physical distribution medium), accompanied by a
247 | written offer, valid for at least three years and valid for as
248 | long as you offer spare parts or customer support for that product
249 | model, to give anyone who possesses the object code either (1) a
250 | copy of the Corresponding Source for all the software in the
251 | product that is covered by this License, on a durable physical
252 | medium customarily used for software interchange, for a price no
253 | more than your reasonable cost of physically performing this
254 | conveying of source, or (2) access to copy the
255 | Corresponding Source from a network server at no charge.
256 |
257 | c) Convey individual copies of the object code with a copy of the
258 | written offer to provide the Corresponding Source. This
259 | alternative is allowed only occasionally and noncommercially, and
260 | only if you received the object code with such an offer, in accord
261 | with subsection 6b.
262 |
263 | d) Convey the object code by offering access from a designated
264 | place (gratis or for a charge), and offer equivalent access to the
265 | Corresponding Source in the same way through the same place at no
266 | further charge. You need not require recipients to copy the
267 | Corresponding Source along with the object code. If the place to
268 | copy the object code is a network server, the Corresponding Source
269 | may be on a different server (operated by you or a third party)
270 | that supports equivalent copying facilities, provided you maintain
271 | clear directions next to the object code saying where to find the
272 | Corresponding Source. Regardless of what server hosts the
273 | Corresponding Source, you remain obligated to ensure that it is
274 | available for as long as needed to satisfy these requirements.
275 |
276 | e) Convey the object code using peer-to-peer transmission, provided
277 | you inform other peers where the object code and Corresponding
278 | Source of the work are being offered to the general public at no
279 | charge under subsection 6d.
280 |
281 | A separable portion of the object code, whose source code is excluded
282 | from the Corresponding Source as a System Library, need not be
283 | included in conveying the object code work.
284 |
285 | A "User Product" is either (1) a "consumer product", which means any
286 | tangible personal property which is normally used for personal, family,
287 | or household purposes, or (2) anything designed or sold for incorporation
288 | into a dwelling. In determining whether a product is a consumer product,
289 | doubtful cases shall be resolved in favor of coverage. For a particular
290 | product received by a particular user, "normally used" refers to a
291 | typical or common use of that class of product, regardless of the status
292 | of the particular user or of the way in which the particular user
293 | actually uses, or expects or is expected to use, the product. A product
294 | is a consumer product regardless of whether the product has substantial
295 | commercial, industrial or non-consumer uses, unless such uses represent
296 | the only significant mode of use of the product.
297 |
298 | "Installation Information" for a User Product means any methods,
299 | procedures, authorization keys, or other information required to install
300 | and execute modified versions of a covered work in that User Product from
301 | a modified version of its Corresponding Source. The information must
302 | suffice to ensure that the continued functioning of the modified object
303 | code is in no case prevented or interfered with solely because
304 | modification has been made.
305 |
306 | If you convey an object code work under this section in, or with, or
307 | specifically for use in, a User Product, and the conveying occurs as
308 | part of a transaction in which the right of possession and use of the
309 | User Product is transferred to the recipient in perpetuity or for a
310 | fixed term (regardless of how the transaction is characterized), the
311 | Corresponding Source conveyed under this section must be accompanied
312 | by the Installation Information. But this requirement does not apply
313 | if neither you nor any third party retains the ability to install
314 | modified object code on the User Product (for example, the work has
315 | been installed in ROM).
316 |
317 | The requirement to provide Installation Information does not include a
318 | requirement to continue to provide support service, warranty, or updates
319 | for a work that has been modified or installed by the recipient, or for
320 | the User Product in which it has been modified or installed. Access to a
321 | network may be denied when the modification itself materially and
322 | adversely affects the operation of the network or violates the rules and
323 | protocols for communication across the network.
324 |
325 | Corresponding Source conveyed, and Installation Information provided,
326 | in accord with this section must be in a format that is publicly
327 | documented (and with an implementation available to the public in
328 | source code form), and must require no special password or key for
329 | unpacking, reading or copying.
330 |
331 | 7. Additional Terms.
332 |
333 | "Additional permissions" are terms that supplement the terms of this
334 | License by making exceptions from one or more of its conditions.
335 | Additional permissions that are applicable to the entire Program shall
336 | be treated as though they were included in this License, to the extent
337 | that they are valid under applicable law. If additional permissions
338 | apply only to part of the Program, that part may be used separately
339 | under those permissions, but the entire Program remains governed by
340 | this License without regard to the additional permissions.
341 |
342 | When you convey a copy of a covered work, you may at your option
343 | remove any additional permissions from that copy, or from any part of
344 | it. (Additional permissions may be written to require their own
345 | removal in certain cases when you modify the work.) You may place
346 | additional permissions on material, added by you to a covered work,
347 | for which you have or can give appropriate copyright permission.
348 |
349 | Notwithstanding any other provision of this License, for material you
350 | add to a covered work, you may (if authorized by the copyright holders of
351 | that material) supplement the terms of this License with terms:
352 |
353 | a) Disclaiming warranty or limiting liability differently from the
354 | terms of sections 15 and 16 of this License; or
355 |
356 | b) Requiring preservation of specified reasonable legal notices or
357 | author attributions in that material or in the Appropriate Legal
358 | Notices displayed by works containing it; or
359 |
360 | c) Prohibiting misrepresentation of the origin of that material, or
361 | requiring that modified versions of such material be marked in
362 | reasonable ways as different from the original version; or
363 |
364 | d) Limiting the use for publicity purposes of names of licensors or
365 | authors of the material; or
366 |
367 | e) Declining to grant rights under trademark law for use of some
368 | trade names, trademarks, or service marks; or
369 |
370 | f) Requiring indemnification of licensors and authors of that
371 | material by anyone who conveys the material (or modified versions of
372 | it) with contractual assumptions of liability to the recipient, for
373 | any liability that these contractual assumptions directly impose on
374 | those licensors and authors.
375 |
376 | All other non-permissive additional terms are considered "further
377 | restrictions" within the meaning of section 10. If the Program as you
378 | received it, or any part of it, contains a notice stating that it is
379 | governed by this License along with a term that is a further
380 | restriction, you may remove that term. If a license document contains
381 | a further restriction but permits relicensing or conveying under this
382 | License, you may add to a covered work material governed by the terms
383 | of that license document, provided that the further restriction does
384 | not survive such relicensing or conveying.
385 |
386 | If you add terms to a covered work in accord with this section, you
387 | must place, in the relevant source files, a statement of the
388 | additional terms that apply to those files, or a notice indicating
389 | where to find the applicable terms.
390 |
391 | Additional terms, permissive or non-permissive, may be stated in the
392 | form of a separately written license, or stated as exceptions;
393 | the above requirements apply either way.
394 |
395 | 8. Termination.
396 |
397 | You may not propagate or modify a covered work except as expressly
398 | provided under this License. Any attempt otherwise to propagate or
399 | modify it is void, and will automatically terminate your rights under
400 | this License (including any patent licenses granted under the third
401 | paragraph of section 11).
402 |
403 | However, if you cease all violation of this License, then your
404 | license from a particular copyright holder is reinstated (a)
405 | provisionally, unless and until the copyright holder explicitly and
406 | finally terminates your license, and (b) permanently, if the copyright
407 | holder fails to notify you of the violation by some reasonable means
408 | prior to 60 days after the cessation.
409 |
410 | Moreover, your license from a particular copyright holder is
411 | reinstated permanently if the copyright holder notifies you of the
412 | violation by some reasonable means, this is the first time you have
413 | received notice of violation of this License (for any work) from that
414 | copyright holder, and you cure the violation prior to 30 days after
415 | your receipt of the notice.
416 |
417 | Termination of your rights under this section does not terminate the
418 | licenses of parties who have received copies or rights from you under
419 | this License. If your rights have been terminated and not permanently
420 | reinstated, you do not qualify to receive new licenses for the same
421 | material under section 10.
422 |
423 | 9. Acceptance Not Required for Having Copies.
424 |
425 | You are not required to accept this License in order to receive or
426 | run a copy of the Program. Ancillary propagation of a covered work
427 | occurring solely as a consequence of using peer-to-peer transmission
428 | to receive a copy likewise does not require acceptance. However,
429 | nothing other than this License grants you permission to propagate or
430 | modify any covered work. These actions infringe copyright if you do
431 | not accept this License. Therefore, by modifying or propagating a
432 | covered work, you indicate your acceptance of this License to do so.
433 |
434 | 10. Automatic Licensing of Downstream Recipients.
435 |
436 | Each time you convey a covered work, the recipient automatically
437 | receives a license from the original licensors, to run, modify and
438 | propagate that work, subject to this License. You are not responsible
439 | for enforcing compliance by third parties with this License.
440 |
441 | An "entity transaction" is a transaction transferring control of an
442 | organization, or substantially all assets of one, or subdividing an
443 | organization, or merging organizations. If propagation of a covered
444 | work results from an entity transaction, each party to that
445 | transaction who receives a copy of the work also receives whatever
446 | licenses to the work the party's predecessor in interest had or could
447 | give under the previous paragraph, plus a right to possession of the
448 | Corresponding Source of the work from the predecessor in interest, if
449 | the predecessor has it or can get it with reasonable efforts.
450 |
451 | You may not impose any further restrictions on the exercise of the
452 | rights granted or affirmed under this License. For example, you may
453 | not impose a license fee, royalty, or other charge for exercise of
454 | rights granted under this License, and you may not initiate litigation
455 | (including a cross-claim or counterclaim in a lawsuit) alleging that
456 | any patent claim is infringed by making, using, selling, offering for
457 | sale, or importing the Program or any portion of it.
458 |
459 | 11. Patents.
460 |
461 | A "contributor" is a copyright holder who authorizes use under this
462 | License of the Program or a work on which the Program is based. The
463 | work thus licensed is called the contributor's "contributor version".
464 |
465 | A contributor's "essential patent claims" are all patent claims
466 | owned or controlled by the contributor, whether already acquired or
467 | hereafter acquired, that would be infringed by some manner, permitted
468 | by this License, of making, using, or selling its contributor version,
469 | but do not include claims that would be infringed only as a
470 | consequence of further modification of the contributor version. For
471 | purposes of this definition, "control" includes the right to grant
472 | patent sublicenses in a manner consistent with the requirements of
473 | this License.
474 |
475 | Each contributor grants you a non-exclusive, worldwide, royalty-free
476 | patent license under the contributor's essential patent claims, to
477 | make, use, sell, offer for sale, import and otherwise run, modify and
478 | propagate the contents of its contributor version.
479 |
480 | In the following three paragraphs, a "patent license" is any express
481 | agreement or commitment, however denominated, not to enforce a patent
482 | (such as an express permission to practice a patent or covenant not to
483 | sue for patent infringement). To "grant" such a patent license to a
484 | party means to make such an agreement or commitment not to enforce a
485 | patent against the party.
486 |
487 | If you convey a covered work, knowingly relying on a patent license,
488 | and the Corresponding Source of the work is not available for anyone
489 | to copy, free of charge and under the terms of this License, through a
490 | publicly available network server or other readily accessible means,
491 | then you must either (1) cause the Corresponding Source to be so
492 | available, or (2) arrange to deprive yourself of the benefit of the
493 | patent license for this particular work, or (3) arrange, in a manner
494 | consistent with the requirements of this License, to extend the patent
495 | license to downstream recipients. "Knowingly relying" means you have
496 | actual knowledge that, but for the patent license, your conveying the
497 | covered work in a country, or your recipient's use of the covered work
498 | in a country, would infringe one or more identifiable patents in that
499 | country that you have reason to believe are valid.
500 |
501 | If, pursuant to or in connection with a single transaction or
502 | arrangement, you convey, or propagate by procuring conveyance of, a
503 | covered work, and grant a patent license to some of the parties
504 | receiving the covered work authorizing them to use, propagate, modify
505 | or convey a specific copy of the covered work, then the patent license
506 | you grant is automatically extended to all recipients of the covered
507 | work and works based on it.
508 |
509 | A patent license is "discriminatory" if it does not include within
510 | the scope of its coverage, prohibits the exercise of, or is
511 | conditioned on the non-exercise of one or more of the rights that are
512 | specifically granted under this License. You may not convey a covered
513 | work if you are a party to an arrangement with a third party that is
514 | in the business of distributing software, under which you make payment
515 | to the third party based on the extent of your activity of conveying
516 | the work, and under which the third party grants, to any of the
517 | parties who would receive the covered work from you, a discriminatory
518 | patent license (a) in connection with copies of the covered work
519 | conveyed by you (or copies made from those copies), or (b) primarily
520 | for and in connection with specific products or compilations that
521 | contain the covered work, unless you entered into that arrangement,
522 | or that patent license was granted, prior to 28 March 2007.
523 |
524 | Nothing in this License shall be construed as excluding or limiting
525 | any implied license or other defenses to infringement that may
526 | otherwise be available to you under applicable patent law.
527 |
528 | 12. No Surrender of Others' Freedom.
529 |
530 | If conditions are imposed on you (whether by court order, agreement or
531 | otherwise) that contradict the conditions of this License, they do not
532 | excuse you from the conditions of this License. If you cannot convey a
533 | covered work so as to satisfy simultaneously your obligations under this
534 | License and any other pertinent obligations, then as a consequence you may
535 | not convey it at all. For example, if you agree to terms that obligate you
536 | to collect a royalty for further conveying from those to whom you convey
537 | the Program, the only way you could satisfy both those terms and this
538 | License would be to refrain entirely from conveying the Program.
539 |
540 | 13. Remote Network Interaction; Use with the GNU General Public License.
541 |
542 | Notwithstanding any other provision of this License, if you modify the
543 | Program, your modified version must prominently offer all users
544 | interacting with it remotely through a computer network (if your version
545 | supports such interaction) an opportunity to receive the Corresponding
546 | Source of your version by providing access to the Corresponding Source
547 | from a network server at no charge, through some standard or customary
548 | means of facilitating copying of software. This Corresponding Source
549 | shall include the Corresponding Source for any work covered by version 3
550 | of the GNU General Public License that is incorporated pursuant to the
551 | following paragraph.
552 |
553 | Notwithstanding any other provision of this License, you have
554 | permission to link or combine any covered work with a work licensed
555 | under version 3 of the GNU General Public License into a single
556 | combined work, and to convey the resulting work. The terms of this
557 | License will continue to apply to the part which is the covered work,
558 | but the work with which it is combined will remain governed by version
559 | 3 of the GNU General Public License.
560 |
561 | 14. Revised Versions of this License.
562 |
563 | The Free Software Foundation may publish revised and/or new versions of
564 | the GNU Affero General Public License from time to time. Such new versions
565 | will be similar in spirit to the present version, but may differ in detail to
566 | address new problems or concerns.
567 |
568 | Each version is given a distinguishing version number. If the
569 | Program specifies that a certain numbered version of the GNU Affero General
570 | Public License "or any later version" applies to it, you have the
571 | option of following the terms and conditions either of that numbered
572 | version or of any later version published by the Free Software
573 | Foundation. If the Program does not specify a version number of the
574 | GNU Affero General Public License, you may choose any version ever published
575 | by the Free Software Foundation.
576 |
577 | If the Program specifies that a proxy can decide which future
578 | versions of the GNU Affero General Public License can be used, that proxy's
579 | public statement of acceptance of a version permanently authorizes you
580 | to choose that version for the Program.
581 |
582 | Later license versions may give you additional or different
583 | permissions. However, no additional obligations are imposed on any
584 | author or copyright holder as a result of your choosing to follow a
585 | later version.
586 |
587 | 15. Disclaimer of Warranty.
588 |
589 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
590 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
591 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
592 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
593 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
594 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
595 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
596 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
597 |
598 | 16. Limitation of Liability.
599 |
600 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
601 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
602 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
603 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
604 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
605 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
606 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
607 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
608 | SUCH DAMAGES.
609 |
610 | 17. Interpretation of Sections 15 and 16.
611 |
612 | If the disclaimer of warranty and limitation of liability provided
613 | above cannot be given local legal effect according to their terms,
614 | reviewing courts shall apply local law that most closely approximates
615 | an absolute waiver of all civil liability in connection with the
616 | Program, unless a warranty or assumption of liability accompanies a
617 | copy of the Program in return for a fee.
618 |
619 | END OF TERMS AND CONDITIONS
620 |
621 | How to Apply These Terms to Your New Programs
622 |
623 | If you develop a new program, and you want it to be of the greatest
624 | possible use to the public, the best way to achieve this is to make it
625 | free software which everyone can redistribute and change under these terms.
626 |
627 | To do so, attach the following notices to the program. It is safest
628 | to attach them to the start of each source file to most effectively
629 | state the exclusion of warranty; and each file should have at least
630 | the "copyright" line and a pointer to where the full notice is found.
631 |
632 |
633 | Copyright (C)
634 |
635 | This program is free software: you can redistribute it and/or modify
636 | it under the terms of the GNU Affero General Public License as published
637 | by the Free Software Foundation, either version 3 of the License, or
638 | (at your option) any later version.
639 |
640 | This program is distributed in the hope that it will be useful,
641 | but WITHOUT ANY WARRANTY; without even the implied warranty of
642 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
643 | GNU Affero General Public License for more details.
644 |
645 | You should have received a copy of the GNU Affero General Public License
646 | along with this program. If not, see .
647 |
648 | Also add information on how to contact you by electronic and paper mail.
649 |
650 | If your software can interact with users remotely through a computer
651 | network, you should also make sure that it provides a way for users to
652 | get its source. For example, if your program is a web application, its
653 | interface could display a "Source" link that leads users to an archive
654 | of the code. There are many ways you could offer source, and different
655 | solutions will be better for different programs; see section 13 for the
656 | specific requirements.
657 |
658 | You should also get your employer (if you work as a programmer) or school,
659 | if any, to sign a "copyright disclaimer" for the program, if necessary.
660 | For more information on this, and how to apply and follow the GNU AGPL, see
661 | .
662 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # SatNOGS-client-docker
2 |
3 | This is useage of the [Libre Space Foundation](https://hub.docker.com/u/librespace) base images, and more, the standalone build is moved to the legacy branch.
4 |
5 | The recommended [guide](lsf/LSF-GUIDE.md) for getting started.
6 | My collected [addons](addons/README.md) to the LSF images.
7 | Also have a look at the [SA2KNG collection](sa2kng/README.md) of branches.
8 |
9 | The main repos that is used here:
10 | * [docker-hamlib](https://gitlab.com/librespacefoundation/docker-hamlib)
11 | * [docker-gnuradio](https://gitlab.com/librespacefoundation/docker-gnuradio)
12 | * [satnogs-client](https://gitlab.com/librespacefoundation/satnogs/satnogs-client/)
13 | * [satnogs-auto-scheduler](https://gitlab.com/librespacefoundation/satnogs/satnogs-auto-scheduler)
14 |
--------------------------------------------------------------------------------
/addons/Dockerfile:
--------------------------------------------------------------------------------
1 | ARG SATNOGS_IMAGE_TAG=master
2 | ARG REPO_ROOT=librespace
3 | ARG RUST_IMAGE_TAG=bullseye
4 |
5 | FROM ${REPO_ROOT}/satnogs-client:${SATNOGS_IMAGE_TAG} AS builder
6 | WORKDIR /usr/src
7 | USER root
8 |
9 | # install build env and required libs etc
10 | COPY packages.builder .
11 | RUN apt -y update && \
12 | xargs -a packages.builder apt install -qy
13 |
14 | # install everything in /target and it will go in to / on destination image. symlink make it easier for builds to find files installed by this.
15 | RUN mkdir -p /target/usr && rm -rf /usr/local && ln -sf /target/usr /usr/local
16 |
17 | ARG CMAKE_BUILD_PARALLEL_LEVEL
18 |
19 | # install gr-satellites, this is now included in the base image
20 | #RUN git clone -b maint-3.8 --depth=1 https://github.com/daniestevez/gr-satellites.git
21 | #RUN cd gr-satellites &&\
22 | # cmake -B build -DCMAKE_INSTALL_PREFIX=/target/usr &&\
23 | # cmake --build build --target install
24 |
25 | # install beesat-sdr for mobitex support
26 | RUN git clone -b maint-3.8 --depth=1 https://github.com/daniestevez/beesat-sdr.git
27 | RUN cd beesat-sdr/gr-tnc_nx &&\
28 | cmake -B build -DCMAKE_INSTALL_PREFIX=/target/usr -DCMAKE_BUILD_TYPE=Release &&\
29 | cmake --build build --target install
30 |
31 | # SSDV with support for DSLWP and JY1SAT modes
32 | RUN git clone --depth=1 https://github.com/daniestevez/ssdv.git
33 | RUN cd ssdv &&\
34 | make DESTDIR=/target install
35 |
36 | # install satnogs_gr-satellites, also implemented in grsat.py
37 | #RUN git clone --depth=1 https://github.com/kng/satnogs_gr-satellites.git
38 | #RUN cd satnogs_gr-satellites &&\
39 | # make DESTDIR=/target PREFIX=/usr install
40 |
41 | # install mirisdr
42 | RUN git clone https://github.com/ericek111/libmirisdr-5.git
43 | RUN cd libmirisdr-5 &&\
44 | cmake -B build -DCMAKE_INSTALL_PREFIX=/target/usr -DCMAKE_BUILD_TYPE=Release &&\
45 | cmake --build build --target install
46 |
47 | # install soapymiri
48 | RUN git clone https://github.com/ericek111/SoapyMiri.git
49 | RUN cd SoapyMiri &&\
50 | cmake -B build -DCMAKE_INSTALL_PREFIX=/target/usr/local -DCMAKE_BUILD_TYPE=Release &&\
51 | cmake --build build --target install
52 |
53 | # SDRplay services install
54 | RUN MAJVERS=3 &&\
55 | VERS=3.15 &&\
56 | MINVERS=2 &&\
57 | BINARY=SDRplay_RSP_API-Linux-${VERS}.${MINVERS}.run &&\
58 | DIR=$(dpkg --print-architecture) &&\
59 | curl --no-keepalive -o sdrplay_api https://www.sdrplay.com/software/${BINARY} &&\
60 | sh ./sdrplay_api --noexec --target sdrplay &&\
61 | install -m 755 sdrplay/${DIR}/sdrplay_apiService /target/usr/bin/ &&\
62 | install -m 644 sdrplay/inc/sdrplay_api*.h /target/usr/include/ &&\
63 | install -m 644 sdrplay/${DIR}/libsdrplay_api.so.${VERS} /target/usr/lib/ &&\
64 | ln -sf libsdrplay_api.so.${VERS} /target/usr/lib/libsdrplay_api.so.${MAJVERS} &&\
65 | ln -sf libsdrplay_api.so.${MAJVERS} /target/usr/lib/libsdrplay_api.so &&\
66 | ldconfig
67 |
68 | # SoapySDRPlay3 from pothosware
69 | RUN git clone --depth=1 -b soapy-sdrplay3-0.5.1 https://github.com/pothosware/SoapySDRPlay3.git
70 | RUN cd SoapySDRPlay3 &&\
71 | cmake -B build -DCMAKE_INSTALL_PREFIX=/target/usr/local -DCMAKE_BUILD_TYPE=Release &&\
72 | cmake --build build --target install
73 |
74 | # SoapyRTLTCP from pothosware
75 | RUN git clone --depth=1 https://github.com/pothosware/SoapyRTLTCP.git
76 | RUN cd SoapyRTLTCP &&\
77 | cmake -B build -DCMAKE_INSTALL_PREFIX=/target/usr/local -DCMAKE_BUILD_TYPE=Release &&\
78 | cmake --build build --target install
79 |
80 | # install aptdec
81 | RUN git clone --recursive https://github.com/Xerbo/aptdec.git
82 | RUN cd aptdec &&\
83 | cmake -B build -DCMAKE_INSTALL_PREFIX=/target/usr -DCMAKE_BUILD_TYPE=Release &&\
84 | cmake --build build --target install
85 |
86 | # fpc is a quite big install, build meted
87 | ##RUN apt install -y fpc --no-install-recommends
88 | #RUN git clone https://github.com/artlav/meteor_decoder.git
89 | #RUN cd meteor_decoder && mkdir units &&\
90 | # fpc -CX -XX -O3 -Mdelphi -FUunits -Fualib medet.dpr &&\
91 | # cp medet /target/usr/bin
92 |
93 | # satellite orbit prediction for tle
94 | RUN git clone -b v2.0.0 https://github.com/la1k/libpredict.git
95 | RUN cd libpredict &&\
96 | cmake -B build -DCMAKE_INSTALL_PREFIX=/target/usr -DCMAKE_BUILD_TYPE=Release &&\
97 | cmake --build build --target install
98 |
99 | # needs qt5 in base image ?
100 | #RUN apt install -y qtbase5-dev libmuparser-dev libshp-dev
101 | #RUN git clone https://github.com/Xerbo/LeanHRPT-Decode.git
102 | #RUN cd LeanHRPT-Decode &&\
103 | # cmake -B build -DCMAKE_INSTALL_PREFIX=/target/usr &&\
104 | # cmake --build build --target install
105 |
106 | # kalibrate for rtl_sdr
107 | RUN git clone https://github.com/steve-m/kalibrate-rtl.git
108 | RUN cd kalibrate-rtl &&\
109 | ./bootstrap &&\
110 | CXXFLAGS='-W -Wall -O3' ./configure &&\
111 | make &&\
112 | cp src/kal /target/usr/bin
113 |
114 | # rx_fm rx_power rx_sdr
115 | RUN git clone --depth=1 https://github.com/rxseger/rx_tools.git
116 | RUN cd rx_tools &&\
117 | cmake -B build -DCMAKE_INSTALL_PREFIX=/target/usr -DCMAKE_BUILD_TYPE=Release &&\
118 | cmake --build build --target install
119 |
120 | # rffft from strf
121 | RUN git clone --depth=1 https://github.com/cbassa/strf.git
122 | RUN cd strf && make rffft && cp rffft /target/usr/bin
123 |
124 | # Meteor-M2 series demodulator
125 | RUN git clone --depth=1 https://github.com/dbdexter-dev/meteor_demod.git
126 | RUN cd meteor_demod &&\
127 | cmake -B build -DCMAKE_INSTALL_PREFIX=/target/usr -DCMAKE_BUILD_TYPE=Release &&\
128 | cmake --build build --target install
129 |
130 | # Meteor-M series LRPT decoder
131 | RUN git clone --depth=1 https://github.com/dbdexter-dev/meteor_decode.git
132 | RUN cd meteor_decode &&\
133 | cmake -B build -DCMAKE_INSTALL_PREFIX=/target/usr -DCMAKE_BUILD_TYPE=Release &&\
134 | cmake --build build --target install
135 |
136 | # libgpredict
137 | RUN git clone --depth=1 https://github.com/cubehub/libgpredict.git
138 | RUN cd libgpredict &&\
139 | cmake -B build -DCMAKE_INSTALL_PREFIX=/target/usr -DCMAKE_BUILD_TYPE=Release &&\
140 | cmake --build build --target install
141 |
142 | # URESAT-1 decoder
143 | RUN git clone --depth=1 https://github.com/AMSAT-EA/URESAT-1-decoder.git
144 | RUN cd URESAT-1-decoder/bit-version/linux &&\
145 | make &&\
146 | install -m 755 uresat-decoder-linux-x86 /target/usr/bin
147 |
148 | # SatDump CLI, disabled by default as it is a lengthy build
149 | ARG BUILD_SATDUMP
150 | RUN if [ -n "$BUILD_SATDUMP" ]; then \
151 | git clone --depth=1 https://github.com/SatDump/SatDump.git &&\
152 | cd SatDump &&\
153 | cmake -B build \
154 | -DCMAKE_INSTALL_PREFIX=/usr \
155 | -DCMAKE_STAGING_PREFIX=/target/usr \
156 | -DCMAKE_BUILD_TYPE=Release \
157 | -DBUILD_GUI=OFF \
158 | -DPLUGIN_SCRIPTING=ON \
159 | -DBUILD_TOOLS=ON &&\
160 | cmake --build build --target install ;\
161 | fi
162 |
163 | ARG SATNOGS_CLIENT_VARSTATEDIR=/var/lib/satnogs-client
164 | # UDP client for programs that require data on stdin
165 | COPY gnuradio/*.conf /target/etc/gnuradio/conf.d/
166 | COPY grc/*.grc .
167 | RUN grcc -o /target/usr/bin/ *.grc
168 |
169 | COPY scripts/* /target/usr/bin/
170 | COPY satyaml/* /target/usr/lib/python3/dist-packages/satellites/satyaml/
171 | COPY --chown=satnogs-client:satnogs-client direwolf.conf /target/etc/
172 | COPY --chown=satnogs-client:satnogs-client sat.cfg /target/$SATNOGS_CLIENT_VARSTATEDIR/.gr_satellites/sat.cfg
173 | COPY --chown=satnogs-client:satnogs-client satdump_cfg.json /target/$SATNOGS_CLIENT_VARSTATEDIR/.config/satdump/satdump_cfg.json
174 | # Don't rely on repository file permissions, COPY --chmod requires BuildKit
175 | RUN chmod 0755 /target/usr/bin/*
176 |
177 | ENTRYPOINT []
178 | CMD ["bash"]
179 |
180 |
181 | FROM rust:${RUST_IMAGE_TAG} AS rust
182 | WORKDIR /usr/src
183 | USER root
184 |
185 | ARG DEBIAN_FRONTEND=noninteractive
186 | # install build env and required libs etc
187 | COPY packages.rust .
188 | RUN apt -y update && \
189 | xargs -a packages.rust apt install -qy
190 |
191 | # install everything in /target and it will go in to / on destination image
192 | RUN mkdir -p /target/usr/bin
193 |
194 | ARG CMAKE_BUILD_PARALLEL_LEVEL
195 |
196 | # libgpredict
197 | RUN git clone --depth=1 https://github.com/cubehub/libgpredict.git
198 | RUN cd libgpredict &&\
199 | cmake -B build -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release &&\
200 | cmake --build build --target install
201 |
202 | # satnogs-monitor
203 | RUN git clone --depth=1 https://github.com/wose/satnogs-monitor.git
204 | RUN cd satnogs-monitor/monitor &&\
205 | cargo update &&\
206 | cargo build --release &&\
207 | cp ../target/release/satnogs-monitor /target/usr/bin/
208 |
209 |
210 | FROM ${REPO_ROOT}/satnogs-client:${SATNOGS_IMAGE_TAG} AS runner
211 | LABEL org.opencontainers.image.authors="Daniel Ekman "
212 |
213 | WORKDIR /usr/src
214 | COPY packages.client .
215 | RUN apt -y update && \
216 | xargs -a packages.client apt install -qy && \
217 | rm -rf /var/lib/apt/lists/*
218 |
219 | # install python packages
220 | COPY packages.pip .
221 | RUN xargs -a packages.pip pip install
222 |
223 | # copy the files built
224 | COPY --from=builder /target /
225 | COPY --from=rust /target /
226 |
227 | RUN chown -R satnogs-client:satnogs-client /usr/lib/python3/dist-packages/satellites/satyaml
228 | ARG SATNOGS_CLIENT_VARSTATEDIR=/var/lib/satnogs-client
229 | WORKDIR $SATNOGS_CLIENT_VARSTATEDIR
230 |
231 |
--------------------------------------------------------------------------------
/addons/README.md:
--------------------------------------------------------------------------------
1 | # SA2KNG's satnogs-client addons
2 |
3 | ## Info
4 |
5 | This is a collection of scripts and software builds that can be added to the official docker images.
6 |
7 | These build a bunch of additional software on top of the image, as well as include some useful scripts.
8 |
9 | ## [satnogs-pre](scripts/satnogs-pre) and [satnogs-post](scripts/satnogs-post)
10 | This is the glue for everything regarding the observations, they are executed before and after the actual observation. In these you can launch things that can help with automated processing, demodulators and more.
11 | By default, I recommend these two as they have been used for a long time and many other stations use them:
12 | ```
13 | SATNOGS_PRE_OBSERVATION_SCRIPT=satnogs-pre {{ID}} {{FREQ}} {{TLE}} {{TIMESTAMP}} {{BAUD}} {{SCRIPT_NAME}}
14 | SATNOGS_POST_OBSERVATION_SCRIPT=satnogs-post {{ID}} {{FREQ}} {{TLE}} {{TIMESTAMP}} {{BAUD}} {{SCRIPT_NAME}}
15 | ```
16 |
17 | ## [grsat.py](scripts/grsat.py)
18 | This is the [gr-satellites](https://github.com/daniestevez/gr-satellites) integration into the client.
19 | It needs the UDP output to be enabled in the flowgraphs and the above pre-/post- scripts.
20 | ```
21 | UDP_DUMP_HOST=0.0.0.0
22 | ```
23 |
24 | The main idea is to get the doppler corrected IQ stream from the flowgraph into a running gr_satellites in UDP raw mode.
25 | Pre-obs script launches gr-satellites in the background and it’s output is directed to a log file and a KISS file.
26 | Post-obs stops the gr_satellites and looks for any KISS data, parses and creates the necessary files for upload via the satnogs-client.
27 |
28 | ## [imagedecode.py](scripts/imagedecode.py)
29 | TODO: document the image decoder
30 |
31 | ## [gpio.py](scripts/gpio.py)
32 | TODO: document IO control
33 |
34 | ## [SatDump](scripts/satdump.sh)
35 | TODO: finish the implementation and document
36 |
37 | ## [iq_dump_rename](scripts/iq_dump_rename.sh)
38 | This script helps rename the IQ_DUMP files between the observations, else they're overwritten by the next obs.
39 | Required settings in `station.env` is:
40 | ```
41 | ENABLE_IQ_DUMP=true
42 | IQ_DUMP_RENAME=true
43 | IQ_DUMP_FILENAME=/srv/iq
44 | ```
45 | To make use of it you should bind-mount a directory, so it is stored on the host instead of in the image or volume.
46 | Add this to docker-compose.yml in the satnogs_client service, under `volumes:`:
47 | ```yaml
48 | volumes:
49 | - type: 'bind'
50 | source: './srv'
51 | target: '/srv'
52 | ```
53 | Before bringing the stack up, the source dir needs to exist, create with `mkdir -p srv`
54 |
55 | ## [liveupdate-satyaml](scripts/liveupdate-satyaml.sh)
56 | This script fetches the latest SatYAML from the main repo. This requires the image to be mounted with read-write, see [docker-compose.yml](../lsf/docker-compose.yml) in the service satnogs_client, comment out the line `#read_only: true`.
57 | It can be auto-executed when the stack is brought up, by adding it in the `command:` key under the satnogs_client service:
58 | ```yaml
59 | command: liveupdate-satyaml.sh satnogs-client
60 | ```
61 | It will execute the script, then execute the arguments after it, in this case the client itself.
62 |
63 | ## [test-flowgraph](scripts/test-flowgraph.sh)
64 | This will test the sdr settings by launching a flowgraph and record waterfall and audio, it can be used to quickly verify that the settings in `station.env` is correct.
65 |
66 | ## [bandscan](scripts/bandscan.sh)
67 | A bandscan script that can run in between observations to monitor a frequency and log the data to be later used in the [strf tools](https://github.com/cbassa/strf)
68 | The `rx_sdr` will use the device, antenna, gain etc from the satnogs settings.
69 | Configuration in `station.env`, the only required is enable, all the others have defaults:
70 | ```shell
71 | BANDSCAN_ENABLE=true
72 | BANDSCAN_FREQ=435000000 # default 401M
73 | BANDSCAN_SAMPLERATE=2e6 # override the default from SATNOGS_RX_SAMP_RATE
74 | BANDSCAN_DIR=/srv/bandscan # make sure to bind-mount a path from the host
75 | ```
76 |
77 | ## [direwolf](scripts/direwolf.sh)
78 | Run [direwolf](https://github.com/wb2osz/direwolf) and demodulate APRS in between observations.
79 | The `rx_sdr` will use the device, antenna, gain etc from the satnogs settings.
80 | Configuration in `station.env`, the only required is enable, all the others have defaults:
81 | ```
82 | DIREWOLF_ENABLE=true
83 | DIREWOLF_FREQ=144800000 # EU 144.8M, modify for NA 144.39M
84 | DIREWOLF_CONF=/etc/direwolf.conf # change to /var/lib/satnogs-client/direwolf.conf for custom config
85 | ```
86 | The default config only displays decoded APRS. If you want to run it as a IGate you will need to build a custom configuration and save it in the home volume.
87 | Use a text editor to make the config, then copy the contents and paste it in the following procedure.
88 | Launch a shell in the running client container `docker compose exec satnogs_client bash`.
89 | Terminate the cat command with Ctrl-D after pasting in the contents:
90 | ```shell
91 | cat > ~/direwolf.conf
92 | ADEVICE stdin null
93 | ADEVICE - null
94 | MYCALL xx-10
95 | IGSERVER euro.aprs2.net
96 | IGLOGIN xx-10 12345
97 | IBEACON DELAY=1 EVERY=30 VIA=WIDE1-1 SENDTO=IG
98 | PBEACON DELAY=1 EVERY=30 OVERLAY=S SYMBOL="digi" LAT=xx^yy.zzN LONG=xxx^yy.zzE HEIGHT=20 POWER=0 GAIN=4 COMMENT="SatNOGS #xx" VIA=WIDE1-1,WIDE2-1 SENDTO=IG
99 | ```
100 | Make sure to change all xx/yy/zz to values for your station.
101 | Normally the direwolf script is started after a observation, so it doesn't start automatically when the container is started.
102 | You can launch it manually in a docker shell with `direwolf.sh start`.
103 |
104 | ## [meteor](scripts/meteor.sh)
105 | Demodulate Meteor-M2 images from the UDP stream.
106 | Based on [meteor_demod](https://github.com/dbdexter-dev/meteor_demod) and [meteor_decode](https://github.com/dbdexter-dev/meteor_decode)
107 | Configuration in `station.env`:
108 | ```
109 | UDP_DUMP_HOST=0.0.0.0 # required, enable UDP output from flowgraphs
110 | METEOR_NORAD=57166 # optional, space separated list of ID's to activate demodulation
111 | ```
112 |
113 | ## Miri SDR
114 | [libmirisdr-5](https://github.com/ericek111/libmirisdr-5) and [SoapyMiri](https://github.com/ericek111/SoapyMiri)
115 |
116 | ## SDRplay
117 | The [api](https://www.sdrplay.com/api/) is installed and [SoapySDRPlay3](https://github.com/pothosware/SoapySDRPlay3).
118 | To run it you need to change the [docker-compose.yml](../lsf/docker-compose.yml) command in the client to `command: 'sdrplay.sh satnogs-client'`
119 | If the api is run for the first time, the USB device will reconnect and that makes the container loose access to it.
120 | It looks like this in dmesg:
121 | ```
122 | usb 2-14: USB disconnect, device number 16
123 | usb 2-14: new high-speed USB device number 18 using xhci_hcd
124 | ```
125 |
126 | To deal with this automatically, use the `check-sdr.sh` script that probes for the SDR and restarts if needed.
127 | Change the command to `command: 'sdrplay.sh check-sdr.sh satnogs-client' to use this functionality.
128 |
129 | To deal with it manually, simply probe first, then restart the container/stack, and it will be able to access the device.
130 | To see if it is working, launch a shell inside the client container `docker compose exec satnogs_client bash` and run:
131 | `SoapySDRUtil --probe="driver=sdrplay"`
132 |
133 | ## [wf2png](scripts/wf2png.py)
134 | This converts a waterfall .dat file to .png
135 |
136 | ## [satnogs-monitor](https://github.com/wose/satnogs-monitor/)
137 | Rust application for monitoring your station live.
138 | Refer to the [example config](https://github.com/wose/satnogs-monitor/blob/master/monitor/examples/config.toml).
139 | Minimal config that only sets the required station ID, change XXXX:
140 | ```
141 | [[stations]]
142 | satnogs_id = XXXX
143 | local = true
144 | ```
145 | Open it up locally in a text editor, edit, copy the contents and paste into this:
146 | `docker-compose exec satnogs_client bash -c "mkdir -p ~/.config/satnogs-monitor/ && cat > ~/.config/satnogs-monitor/config.toml"`
147 | After pasting the contents, press Ctrl-D
148 | Launching it with `docker-compose exec satnogs_client satnogs-monitor`
149 |
150 | ## Repositories built
151 |
152 | beesat-sdr for mobitex support https://github.com/daniestevez/beesat-sdr
153 | SSDV with support for DSLWP and JY1SAT modes https://github.com/daniestevez/ssdv
154 | satnogs_gr-satellites https://github.com/kng/satnogs_gr-satellites
155 | mirisdr https://github.com/ericek111/libmirisdr-5
156 | soapymiri https://github.com/ericek111/SoapyMiri
157 | aptdec https://github.com/Xerbo/aptdec
158 | satellite orbit prediction for tle https://github.com/la1k/libpredict
159 | kalibrate for rtl_sdr https://github.com/steve-m/kalibrate-rtl
160 | rx_fm rx_power rx_sdr https://github.com/rxseger/rx_tools
161 | rffft from strf https://github.com/cbassa/strf
162 | Meteor-M2 series demodulator from https://github.com/dbdexter-dev/meteor_demod
163 | Meteor-M series LRPT decoder https://github.com/dbdexter-dev/meteor_decode
164 | SatNOGS Monitor https://github.com/wose/satnogs-monitor
165 | URESAT-1 decoder https://github.com/AMSAT-EA/URESAT-1-decoder
166 |
--------------------------------------------------------------------------------
/addons/build.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | export DOCKER_BUILDKIT=1
3 | if [ "${1^^}" == "DEV" ]; then
4 | TAG="lsf-dev-addons"
5 | SATNOGS_IMAGE_TAG="master-unstable"
6 | else
7 | TAG="lsf-addons"
8 | SATNOGS_IMAGE_TAG="master"
9 | fi
10 | REPO_ROOT="knegge"
11 |
12 | ARGS=" --build-arg SATNOGS_IMAGE_TAG=${SATNOGS_IMAGE_TAG}"
13 | #ARGS+=" --build-arg CMAKE_BUILD_PARALLEL_LEVEL=8"
14 | #ARGS+=" --build-arg REPO_ROOT=${REPO_ROOT}"
15 |
16 | docker build \
17 | -t ${REPO_ROOT}/satnogs-client:${TAG} \
18 | ${ARGS} \
19 | .
20 |
--------------------------------------------------------------------------------
/addons/direwolf.conf:
--------------------------------------------------------------------------------
1 | # Audio from stdin
2 | ADEVICE stdin null
3 | CHANNEL 0
4 |
5 | # Put your callsign in place of xxx below.
6 | #MYCALL xxx
7 |
8 | # Pick appropriate servers for your geographical region.
9 | # noam.aprs2.net - for North America
10 | # soam.aprs2.net - for South America
11 | # euro.aprs2.net - for Europe and Africa
12 | # asia.aprs2.net - for Asia
13 | # aunz.aprs2.net - for Oceania
14 | #IGSERVER euro.aprs2.net
15 |
16 | # You also need to specify your login name and passcode.
17 | # This is the same passcode you would use with any other IGate
18 | # application. Contact the author if you can't figure out
19 | # how to generate the passcode.
20 | #IGLOGIN xxx 123456
21 |
--------------------------------------------------------------------------------
/addons/gnuradio/log.conf:
--------------------------------------------------------------------------------
1 | [LOG]
2 | log_level = error
3 | debug_level = off
4 |
--------------------------------------------------------------------------------
/addons/gnuradio/udp.conf:
--------------------------------------------------------------------------------
1 | [udp_blocks]
2 | buf_size_payloads = 8192
3 |
--------------------------------------------------------------------------------
/addons/grc/udp2ishort.grc:
--------------------------------------------------------------------------------
1 | options:
2 | parameters:
3 | author: knegge
4 | category: '[GRC Hier Blocks]'
5 | cmake_opt: ''
6 | comment: ''
7 | copyright: ''
8 | description: ''
9 | gen_cmake: 'On'
10 | gen_linking: dynamic
11 | generate_options: no_gui
12 | hier_block_src_path: '.:'
13 | id: udp2ishort
14 | max_nouts: '0'
15 | output_language: python
16 | placement: (0,0)
17 | qt_qss_theme: ''
18 | realtime_scheduling: ''
19 | run: 'True'
20 | run_command: '{python} -u {filename}'
21 | run_options: run
22 | sizing_mode: fixed
23 | thread_safe_setters: ''
24 | title: Read UDP from a SatNOGS flowgraph
25 | window_size: ''
26 | states:
27 | bus_sink: false
28 | bus_source: false
29 | bus_structure: null
30 | coordinate: [8, 8]
31 | rotation: 0
32 | state: enabled
33 |
34 | blocks:
35 | - name: blocks_complex_to_interleaved_short_0
36 | id: blocks_complex_to_interleaved_short
37 | parameters:
38 | affinity: ''
39 | alias: ''
40 | comment: ''
41 | maxoutbuf: '0'
42 | minoutbuf: '0'
43 | vector_output: 'False'
44 | states:
45 | bus_sink: false
46 | bus_source: false
47 | bus_structure: null
48 | coordinate: [376, 148.0]
49 | rotation: 0
50 | state: true
51 | - name: blocks_file_sink_0
52 | id: blocks_file_sink
53 | parameters:
54 | affinity: ''
55 | alias: ''
56 | append: 'False'
57 | comment: ''
58 | file: /dev/stdout
59 | type: short
60 | unbuffered: 'True'
61 | vlen: '1'
62 | states:
63 | bus_sink: false
64 | bus_source: false
65 | bus_structure: null
66 | coordinate: [568, 132.0]
67 | rotation: 0
68 | state: true
69 | - name: blocks_multiply_const_vxx_0
70 | id: blocks_multiply_const_vxx
71 | parameters:
72 | affinity: ''
73 | alias: ''
74 | comment: ''
75 | const: '16768'
76 | maxoutbuf: '0'
77 | minoutbuf: '0'
78 | type: complex
79 | vlen: '1'
80 | states:
81 | bus_sink: false
82 | bus_source: false
83 | bus_structure: null
84 | coordinate: [200, 148.0]
85 | rotation: 0
86 | state: true
87 | - name: blocks_udp_source_0
88 | id: blocks_udp_source
89 | parameters:
90 | affinity: ''
91 | alias: ''
92 | comment: ''
93 | eof: 'True'
94 | ipaddr: udp_dump_host
95 | maxoutbuf: '0'
96 | minoutbuf: '0'
97 | port: udp_dump_port
98 | psize: '1472'
99 | type: complex
100 | vlen: '1'
101 | states:
102 | bus_sink: false
103 | bus_source: false
104 | bus_structure: null
105 | coordinate: [16, 124.0]
106 | rotation: 0
107 | state: true
108 | - name: udp_dump_host
109 | id: parameter
110 | parameters:
111 | alias: ''
112 | comment: ''
113 | hide: none
114 | label: host/ip to bind udp sink
115 | short_id: u
116 | type: str
117 | value: '"0.0.0.0"'
118 | states:
119 | bus_sink: false
120 | bus_source: false
121 | bus_structure: null
122 | coordinate: [384, 12.0]
123 | rotation: 0
124 | state: enabled
125 | - name: udp_dump_port
126 | id: parameter
127 | parameters:
128 | alias: ''
129 | comment: ''
130 | hide: none
131 | label: host port for udp sink
132 | short_id: p
133 | type: intx
134 | value: '57356'
135 | states:
136 | bus_sink: false
137 | bus_source: false
138 | bus_structure: null
139 | coordinate: [208, 12.0]
140 | rotation: 0
141 | state: enabled
142 |
143 | connections:
144 | - [blocks_complex_to_interleaved_short_0, '0', blocks_file_sink_0, '0']
145 | - [blocks_multiply_const_vxx_0, '0', blocks_complex_to_interleaved_short_0, '0']
146 | - [blocks_udp_source_0, '0', blocks_multiply_const_vxx_0, '0']
147 |
148 | metadata:
149 | file_format: 1
150 |
--------------------------------------------------------------------------------
/addons/grc/udp2ishort.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kng/satnogs-client-docker/023e901a0dd1ca73ba5172c07cb6f70e6a00b9fe/addons/grc/udp2ishort.png
--------------------------------------------------------------------------------
/addons/packages.builder:
--------------------------------------------------------------------------------
1 | autoconf
2 | automake
3 | build-essential
4 | cmake
5 | fakeroot
6 | feh
7 | git
8 | gnuradio-dev
9 | jq
10 | libcurl4-openssl-dev
11 | libglib2.0-dev
12 | libjemalloc-dev
13 | libnng-dev
14 | libpng-dev
15 | librtlsdr-dev
16 | libsndfile-dev
17 | libsoapysdr-dev
18 | libsox-dev
19 | libssl-dev
20 | libtiff-dev
21 | libtool
22 | libusb-1.0-0-dev
23 | libzstd-dev
24 | ninja-build
25 | patch
26 | pkgconf
27 | psmisc
28 | swig
29 |
--------------------------------------------------------------------------------
/addons/packages.client:
--------------------------------------------------------------------------------
1 | direwolf
2 | git
3 | jq
4 | libjemalloc2
5 | libnng1
6 | libsox3
7 | libtiff5
8 | netcat-openbsd
9 | python3-psutil
10 | soapyremote-server
11 | zstd
12 |
--------------------------------------------------------------------------------
/addons/packages.pip:
--------------------------------------------------------------------------------
1 | pymcp2221
2 |
--------------------------------------------------------------------------------
/addons/packages.rust:
--------------------------------------------------------------------------------
1 | build-essential
2 | cmake
3 | git
--------------------------------------------------------------------------------
/addons/sat.cfg:
--------------------------------------------------------------------------------
1 | 35933 --clk_bw 0.3
2 | 46276 --clk_bw 0.15
--------------------------------------------------------------------------------
/addons/satdump_cfg.json:
--------------------------------------------------------------------------------
1 | {
2 | "tle_settings": {
3 | "urls_to_fetch": [
4 | "https://db.satnogs.org/api/tle/?format=3le"
5 | ]
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/addons/satyaml/.gitignore:
--------------------------------------------------------------------------------
1 | *
2 | !.gitignore
3 |
--------------------------------------------------------------------------------
/addons/scripts/bandscan.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | if [[ ! "${BANDSCAN_ENABLE^^}" =~ (TRUE|YES|1) ]]; then exit; fi
3 | # exit if pipeline fails or unset variables
4 | set -eu
5 | # default values
6 | : "${BANDSCAN_FREQ?Needs to be defined.}"
7 | : "${BANDSCAN_SAMPLERATE:=$SATNOGS_RX_SAMP_RATE}"
8 | : "${BANDSCAN_DIR:=/srv/bandscan}"
9 | : "${SATNOGS_PPM_ERROR:=0}"
10 | : "${SATNOGS_APP_PATH:=/tmp/.satnogs}"
11 | : "${BANDSCAN_BIN:=rx_sdr}"
12 | : "${BANDSCAN_OUTPUT_FORMAT:=CF32}"
13 | : "${BANDSCAN_INPUT_FORMAT:=float}"
14 | : "${SATNOGS_RF_GAIN:=0}"
15 | : "${SATNOGS_OTHER_SETTINGS:=0}"
16 | BANDSCAN_PID="$SATNOGS_APP_PATH/bandscan.pid"
17 |
18 | # if unset, try calculating channels
19 | if [ -n "${BANDSCAN_CHANNELS:-}" ]; then
20 | CHANNELS="$BANDSCAN_CHANNELS"
21 | elif [ "${BANDSCAN_FREQ%.*}" -lt 300000000 ]; then
22 | CHANNELS="20" # VHF
23 | elif [ "${BANDSCAN_FREQ%.*}" -lt 500000000 ]; then
24 | CHANNELS="50" # UHF
25 | else
26 | CHANNELS="100" # S-BAND
27 | fi
28 |
29 | if [ "${1^^}" == "START" ]; then
30 | echo "Starting bandscan at $BANDSCAN_FREQ"
31 | DAY=$(date -Idate)
32 | SAVEDIR="$BANDSCAN_DIR/$BANDSCAN_FREQ/$DAY"
33 | mkdir -p "$SAVEDIR" "$SATNOGS_APP_PATH"
34 | INDEX=$(find "$SAVEDIR" -mindepth 1 -maxdepth 1 -type f | wc -l)
35 | $BANDSCAN_BIN -d "$SATNOGS_SOAPY_RX_DEVICE" \
36 | -a "$SATNOGS_ANTENNA" \
37 | -p "$SATNOGS_PPM_ERROR" \
38 | -g "$SATNOGS_RF_GAIN" \
39 | -t "$SATNOGS_OTHER_SETTINGS" \
40 | -s "$BANDSCAN_SAMPLERATE" \
41 | -f "$BANDSCAN_FREQ" \
42 | -F "$BANDSCAN_OUTPUT_FORMAT" - \
43 | | rffft -q \
44 | -f "$BANDSCAN_FREQ" \
45 | -s "$BANDSCAN_SAMPLERATE" \
46 | -F "$BANDSCAN_INPUT_FORMAT" \
47 | -c "$CHANNELS" \
48 | -t 1 \
49 | -p "$SAVEDIR" \
50 | -o "$DAY" \
51 | -S "$INDEX" &
52 | echo $! > "$BANDSCAN_PID"
53 | fi
54 |
55 | if [ "${1^^}" == "STOP" ]; then
56 | if [ -f "$BANDSCAN_PID" ]; then
57 | echo "Stopping bandscan"
58 | kill "$(cat "$BANDSCAN_PID")"
59 | rm -f "$BANDSCAN_PID"
60 | fi
61 | fi
62 |
--------------------------------------------------------------------------------
/addons/scripts/check-sdr.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | cd || exit
3 | echo "Checking SDR..."
4 | if ! SoapySDRUtil --probe="$SATNOGS_SOAPY_RX_DEVICE" >/dev/null 2>&1; then
5 | echo "SDR Error, restarting."
6 | sleep 5
7 | exit 1
8 | fi
9 | echo "SDR OK."
10 | exec "$@"
--------------------------------------------------------------------------------
/addons/scripts/direwolf.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | if [[ ! "${DIREWOLF_ENABLE^^}" =~ (TRUE|YES|1) ]]; then exit; fi
3 | # exit if pipeline fails or unset variables
4 | set -eu
5 |
6 | # default values
7 | : "${DIREWOLF_FREQ:=144800000}"
8 | : "${DIREWOLF_CONF:=/etc/direwolf.conf}"
9 | : "${SATNOGS_PPM_ERROR:=0}"
10 | : "${SATNOGS_RF_GAIN:=0}"
11 | : "${SATNOGS_APP_PATH:=/tmp/.satnogs}"
12 | : "${SDR_BIN:=rx_fm}"
13 | : "${DIREWOLF_BIN:=direwolf}"
14 | : "${DIREWOLF_SAMPLERATE:=48000}"
15 | DIREWOLF_PID="$SATNOGS_APP_PATH/direwolf.pid"
16 |
17 | if [ "${1^^}" == "START" ]; then
18 | echo "Starting direwolf"
19 | $SDR_BIN -d "$SATNOGS_SOAPY_RX_DEVICE" -a "$SATNOGS_ANTENNA" -p "$SATNOGS_PPM_ERROR" -g "$SATNOGS_RF_GAIN" -f "$DIREWOLF_FREQ" -s "$DIREWOLF_SAMPLERATE" - \
20 | | $DIREWOLF_BIN -c "$DIREWOLF_CONF" -r "$DIREWOLF_SAMPLERATE" -D 1 -t 0 &
21 | echo $! > "$DIREWOLF_PID"
22 | fi
23 |
24 | if [ "${1^^}" == "STOP" ]; then
25 | if [ -f "$DIREWOLF_PID" ]; then
26 | echo "Stopping direwolf"
27 | kill "$(cat "$DIREWOLF_PID")"
28 | killall "$SDR_BIN"
29 | rm -f "$DIREWOLF_PID"
30 | fi
31 | fi
32 |
--------------------------------------------------------------------------------
/addons/scripts/find_samp_rate.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python3
2 | from sys import argv
3 |
4 | # This script takes two arguments: {{BAUD}} {{SCRIPT_NAME}}
5 | # and tries to figure out the IQ sample rate
6 |
7 |
8 | # from satnogs_gr-satellites/find_samp_rate.py
9 | def find_samp_rate(baudrate, script="", sps=4, audio_samp_rate=48000):
10 | try:
11 | baudrate = int(float(baudrate))
12 | except ValueError:
13 | baudrate = 9600
14 | if baudrate < 1:
15 | baudrate = 9600
16 | if "_bpsk" in script:
17 | return find_decimation(baudrate, 2, audio_samp_rate, sps) * baudrate
18 | elif "_fsk" in script:
19 | return max(4, find_decimation(baudrate, 2, audio_samp_rate)) * baudrate
20 | elif "_sstv" in script:
21 | return 4 * 4160 * 4
22 | elif "_qubik" in script:
23 | return max(4, find_decimation(baudrate, 2, audio_samp_rate)) * baudrate
24 | elif "_apt" in script:
25 | return 4 * 4160 * 4
26 | elif "_ssb" in script:
27 | return find_decimation(baudrate, 2, audio_samp_rate, sps) * baudrate
28 | else: # cw, fm, afsk, etc...
29 | return audio_samp_rate
30 |
31 |
32 | # from gr-satnogs/python/utils.py
33 | def find_decimation(baudrate, min_decimation=4, audio_samp_rate=48e3, multiple=2):
34 | while min_decimation * baudrate < audio_samp_rate:
35 | min_decimation = min_decimation + 1
36 | if min_decimation % multiple:
37 | min_decimation = min_decimation + multiple - min_decimation % multiple
38 | return min_decimation
39 |
40 |
41 | if __name__ == "__main__":
42 | if len(argv) == 2:
43 | print(find_samp_rate(argv[1]))
44 | elif len(argv) == 3:
45 | print(find_samp_rate(argv[1], argv[2]))
46 | else:
47 | print(f"Usage: {argv[0]} [script_name]")
48 |
--------------------------------------------------------------------------------
/addons/scripts/gpio.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python3
2 | import argparse
3 | from mcp2221 import MCP2221, find_devices
4 | from mcp2221.enums import *
5 | from mcp2221.exceptions import *
6 |
7 | # Hook the gpios to a 4x relay board
8 | # GPIO functions
9 | # gp0: LNA Disable, LNA powered by NC contact
10 | # gp1: Antenna select, off = < 410MHz, on = > 410MHz
11 | # gp2: PA Enabled
12 | # gp3: ROT Disable, Logic powered by NC contact
13 |
14 | # udev rules needed:
15 | # in /etc/udev/rules.d/99-mcp.rules
16 | # SUBSYSTEM=="usb", ATTRS{idVendor}=="04d8", ATTR{idProduct}=="00dd", MODE="0660", GROUP="plugdev"
17 |
18 |
19 | def set_outputs(arg: dict):
20 | try:
21 | mcp = MCP2221(find_devices()[0])
22 | except Exception as e:
23 | print(f'Failed to initialize MCP2221: {e}')
24 | return
25 |
26 | try:
27 | if 'lna' in arg:
28 | if int(arg['lna']) == 0:
29 | print('LNA disable')
30 | mcp.gpio0_value = True
31 | else:
32 | print('LNA enable')
33 | mcp.gpio0_value = False
34 |
35 | if 'freq' in arg:
36 | if int(arg['freq']) > 410000000:
37 | print('Set antenna to UHF')
38 | mcp.gpio1_value = True
39 | else:
40 | print('Set antenna to VHF')
41 | mcp.gpio1_value = False
42 |
43 | if 'pa' in arg:
44 | if int(arg['pa']) == 0:
45 | print('PA disable')
46 | mcp.gpio2_value = False
47 | else:
48 | print('PA enable')
49 | mcp.gpio2_value = True
50 |
51 | if 'rot' in arg:
52 | if int(arg['rot']) == 0:
53 | print('ROT disable')
54 | mcp.gpio3_value = True
55 | else:
56 | print('ROT enable')
57 | mcp.gpio3_value = False
58 |
59 | if 'init' in arg:
60 | print('Setting device defaults')
61 | mcp.set_default_memory_target(MemoryType.Flash)
62 |
63 | mcp.gpio0_write_function(GPIO0Function.GPIO)
64 | mcp.gpio_write_powerup_direction(0, GPIODirection.Output)
65 | mcp.gpio0_powerup_value = False
66 | mcp.gpio_write_powerup_value(0, False)
67 |
68 | mcp.gpio1_write_function(GPIO1Function.GPIO)
69 | mcp.gpio_write_powerup_direction(0, GPIODirection.Output)
70 | mcp.gpio1_powerup_value = False
71 | mcp.gpio_write_powerup_value(0, False)
72 |
73 | mcp.gpio2_write_function(GPIO2Function.GPIO)
74 | mcp.gpio_write_powerup_direction(0, GPIODirection.Output)
75 | mcp.gpio2_powerup_value = False
76 | mcp.gpio_write_powerup_value(0, False)
77 |
78 | mcp.gpio3_write_function(GPIO3Function.GPIO)
79 | mcp.gpio_write_powerup_direction(0, GPIODirection.Output)
80 | mcp.gpio3_powerup_value = False
81 | mcp.gpio_write_powerup_value(0, False)
82 |
83 | except (FailedCommandException, IOException, InvalidParameterException, InvalidReturnValueWarning) as e:
84 | print(f'MCP2221 exception {e}')
85 |
86 |
87 | if __name__ == "__main__":
88 | parser = argparse.ArgumentParser(argument_default=argparse.SUPPRESS)
89 | parser.add_argument('-f', type=int, dest='freq', help='Select antenna based on frequency [Hz]')
90 | parser.add_argument('-l', type=int, dest='lna', choices=(0, 1), help='LNA enable')
91 | parser.add_argument('-p', type=int, dest='pa', choices=(0, 1), help='PA enable')
92 | parser.add_argument('-r', type=int, dest='rot', choices=(0, 1), help='ROT enable')
93 | parser.add_argument('-i', action='store_true', dest='init', help='Program defaults to device')
94 | args, oth = parser.parse_known_args()
95 | if len(oth) > 0:
96 | print(f'Warning: unknown arguments passed {oth}')
97 | set_outputs(vars(args))
98 |
--------------------------------------------------------------------------------
/addons/scripts/grsat.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python3
2 | import logging
3 | from base64 import b64encode
4 | from datetime import datetime, timedelta
5 | from json import loads, dump, JSONDecodeError
6 | from os import getenv, unlink, kill, path
7 | from struct import unpack
8 | from subprocess import Popen, DEVNULL
9 | from sys import argv
10 |
11 | try:
12 | from imagedecode import ImageDecode
13 | except ImportError:
14 | HAS_IMAGEDECODE = False
15 |
16 | class ImageDecode:
17 | pass
18 |
19 | else:
20 | HAS_IMAGEDECODE = True
21 |
22 | logging.basicConfig(
23 | format="%(name)s - %(levelname)s - %(message)s",
24 | level=getattr(
25 | logging, getenv("GRSAT_LOG_LEVEL", getenv("SATNOGS_LOG_LEVEL", "WARNING"))
26 | ),
27 | )
28 | LOGGER = logging.getLogger("grsat")
29 |
30 |
31 | class GrSat(object):
32 | def __init__(
33 | self,
34 | cmd="",
35 | obs_id="0",
36 | freq="0",
37 | tle="",
38 | timestamp="",
39 | baud="",
40 | script="",
41 | ):
42 | self.cmd = cmd
43 | try:
44 | self.obs_id = int(obs_id)
45 | except ValueError:
46 | self.obs_id = 0
47 | try:
48 | self.freq = float(freq)
49 | except ValueError:
50 | self.freq = 0
51 | try:
52 | self.tle = loads(tle)
53 | except JSONDecodeError:
54 | self.tle = None
55 | try:
56 | self.timestamp = datetime.strptime(timestamp, "%Y-%m-%dT%H-%M-%S")
57 | except ValueError:
58 | self.timestamp = datetime.utcnow()
59 | self.baud = baud # can be "None"
60 | self.script_name = script
61 |
62 | self.udp_port = getenv("UDP_DUMP_PORT", "57356")
63 | self.udp_host = getenv("UDP_DUMP_HOST", "")
64 | self.station_id = getenv("SATNOGS_STATION_ID", "0")
65 | self.tmp = getenv("SATNOGS_APP_PATH", "/tmp/.satnogs")
66 | self.data = getenv("SATNOGS_OUTPUT_PATH", "/tmp/.satnogs/data")
67 | try:
68 | self.zmq_port = int(getenv("GRSAT_ZMQ_PORT"))
69 | except (ValueError, TypeError):
70 | self.zmq_port = 0
71 | self.app = getenv("GRSAT_APP", "gr_satellites")
72 | self.keep_logs = getenv("GRSAT_KEEPLOGS", "False").lower() in [
73 | "true",
74 | "1",
75 | "yes",
76 | ]
77 |
78 | self.kiss_file = f"{self.tmp}/grsat_{self.obs_id}.kiss"
79 | self.log_file = f"{self.tmp}/grsat_{self.obs_id}.log"
80 | self.pid_file = f"{self.tmp}/grsat_{self.station_id}.pid"
81 | if self.tle is not None:
82 | self.norad = int(self.tle["tle2"].split()[1])
83 | self.sat_name = self.tle["tle0"] # may start with '0 ' or not
84 | else:
85 | self.norad = 0
86 | self.sat_name = ""
87 | self.samp_rate = self.find_samp_rate(self.baud, self.script_name)
88 |
89 | def main(self):
90 | LOGGER.info(
91 | f"Observation: {self.obs_id}, Norad: {self.norad}, Name: {self.sat_name}, "
92 | f"Script: {self.script_name}, Baud: {self.baud}, Freq: {self.freq/1e6:.3f} MHz"
93 | )
94 | if len(self.udp_host) == 0:
95 | LOGGER.warning("UDP_DUMP_HOST not set, no data will be sent to the demod")
96 | if "start" in self.cmd:
97 | self.start_gr_satellites()
98 | elif "stop" in self.cmd:
99 | self.stop_gr_satellites()
100 | else:
101 | LOGGER.error("Unknown command, use start or stop")
102 |
103 | def start_gr_satellites(self):
104 | LOGGER.info(f"Starting gr_satellites at {self.samp_rate} sps")
105 | gr_app = [
106 | self.app,
107 | str(self.norad),
108 | "--samp_rate",
109 | str(self.samp_rate),
110 | "--iq",
111 | "--udp",
112 | "--udp_raw",
113 | "--udp_port",
114 | str(self.udp_port),
115 | "--start_time",
116 | self.timestamp.strftime("%Y-%m-%dT%H:%M:%S"),
117 | "--kiss_out",
118 | self.kiss_file,
119 | "--ignore_unknown_args",
120 | "--satcfg",
121 | ]
122 | if 0 < self.zmq_port <= 65535:
123 | gr_app.extend(["--zmq_pub", f"tcp://0.0.0.0:{str(self.zmq_port)}"])
124 |
125 | LOGGER.debug(" ".join(gr_app))
126 | try:
127 | if self.keep_logs:
128 | logfile = open(self.log_file, "w")
129 | else:
130 | logfile = DEVNULL
131 | s = Popen(gr_app, stdout=logfile, stderr=logfile)
132 | with open(self.pid_file, "w") as pf:
133 | pf.write(str(s.pid))
134 | except (FileNotFoundError, TypeError, OSError) as e:
135 | LOGGER.warning(f"Unable to launch {self.app}: {e}")
136 |
137 | def stop_gr_satellites(self):
138 | try:
139 | with open(self.pid_file, "r") as pf:
140 | kill(int(pf.readline()), 15)
141 | unlink(self.pid_file)
142 | LOGGER.info("Stopped gr_satellites")
143 | except (FileNotFoundError, ProcessLookupError, OSError):
144 | LOGGER.info("No gr_satellites running")
145 |
146 | if path.isfile(self.kiss_file):
147 | self.kiss_to_json()
148 | if HAS_IMAGEDECODE:
149 | ImageDecode(
150 | self.kiss_file, self.norad, f"{self.data}/data_{str(self.obs_id)}_"
151 | )
152 | # run other scripts here
153 | if not self.keep_logs or path.getsize(self.kiss_file) == 0:
154 | unlink(self.kiss_file)
155 |
156 | if path.isfile(self.log_file) and (
157 | not self.keep_logs or path.getsize(self.log_file) == 0
158 | ):
159 | unlink(self.log_file)
160 |
161 | @staticmethod # from satnogs-open-flowgraph/satnogs_wrapper.py
162 | def parse_kiss_file(infile):
163 | ts = datetime.now() # MUST be overwritten by timestamps in file
164 | for row in infile.read().split(b"\xC0"):
165 | if len(row) == 9 and row[0] == 9: # timestamp frame
166 | ts = datetime(1970, 1, 1) + timedelta(
167 | seconds=unpack(">Q", row[1:])[0] / 1000
168 | )
169 | if len(row) > 0 and row[0] == 0: # data frame
170 | yield ts, row[1:].replace(b"\xdb\xdc", b"\xc0").replace(
171 | b"\xdb\xdd", b"\xdb"
172 | )
173 |
174 | def kiss_to_json(self):
175 | with open(self.kiss_file, "rb") as kf:
176 | LOGGER.info("Processing kiss file")
177 | dp = f"{self.data}/data_{str(self.obs_id)}_"
178 | num_frames = 0
179 | for ts, frame in self.parse_kiss_file(kf):
180 | if len(frame) == 0:
181 | continue
182 | datafile = f'{dp}{ts.strftime("%Y-%m-%dT%H-%M-%S_g")}'
183 | ext = 0
184 | while True:
185 | if path.isfile(f"{datafile}{ext}"):
186 | ext += 1
187 | else:
188 | datafile += str(ext)
189 | break
190 | data = {
191 | "decoder_name": "gr-satellites",
192 | "pdu": b64encode(frame).decode(),
193 | }
194 | with open(datafile, "w") as df:
195 | dump(data, df, default=str)
196 | num_frames += 1
197 | LOGGER.debug(f"{datafile} len {len(frame)}")
198 | LOGGER.info(f"Total frames: {num_frames}")
199 |
200 | @classmethod # from satnogs_gr-satellites/find_samp_rate.py
201 | def find_samp_rate(cls, baudrate, script="", sps=4, audio_samp_rate=48000):
202 | try:
203 | baudrate = int(float(baudrate))
204 | except ValueError:
205 | baudrate = 9600
206 | if baudrate < 1:
207 | baudrate = 9600
208 |
209 | if "_bpsk" in script:
210 | return cls.find_decimation(baudrate, 2, audio_samp_rate, sps) * baudrate
211 | elif "_fsk" in script:
212 | return max(4, cls.find_decimation(baudrate, 2, audio_samp_rate)) * baudrate
213 | elif "_sstv" in script:
214 | return 4 * 4160 * 4
215 | elif "_qubik" in script:
216 | return max(4, cls.find_decimation(baudrate, 2, audio_samp_rate)) * baudrate
217 | elif "_apt" in script:
218 | return 4 * 4160 * 4
219 | elif "_ssb" in script:
220 | return cls.find_decimation(baudrate, 2, audio_samp_rate, sps) * baudrate
221 | else: # cw, fm, afsk, etc...
222 | return audio_samp_rate
223 |
224 | @staticmethod # from gr-satnogs/python/utils.py
225 | def find_decimation(baudrate, min_decimation=4, audio_samp_rate=48e3, multiple=2):
226 | while min_decimation * baudrate < audio_samp_rate:
227 | min_decimation = min_decimation + 1
228 | if min_decimation % multiple:
229 | min_decimation = min_decimation + multiple - min_decimation % multiple
230 | return min_decimation
231 |
232 |
233 | if __name__ == "__main__":
234 | if len(argv) != 8:
235 | LOGGER.error(
236 | "Wrong number of arguments, expected: "
237 | " {{ID}} {{FREQ}} {{TLE}} {{TIMESTAMP}} {{BAUD}} {{SCRIPT_NAME}}"
238 | )
239 | exit(0)
240 | GrSat(argv[1], argv[2], argv[3], argv[4], argv[5], argv[6], argv[7]).main()
241 |
--------------------------------------------------------------------------------
/addons/scripts/imagedecode.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python3
2 | import logging
3 | from datetime import datetime, timedelta
4 | from io import BytesIO
5 | from os import path, getenv
6 | from pathlib import Path
7 | from struct import unpack
8 | from subprocess import Popen, DEVNULL
9 | from sys import argv
10 |
11 | logging.basicConfig(
12 | format="%(name)s - %(levelname)s - %(message)s",
13 | level=getattr(
14 | logging, getenv("GRSAT_LOG_LEVEL", getenv("SATNOGS_LOG_LEVEL", "WARNING"))
15 | ),
16 | )
17 | LOGGER = logging.getLogger("imagedecode")
18 |
19 |
20 | class ImageDecode(object):
21 | def __init__(self, frame_file=None, norad_id=None, image_file=None):
22 | self.frame_file = frame_file
23 | try:
24 | self.norad_id = int(norad_id)
25 | except (ValueError, TypeError):
26 | self.norad_id = None
27 | self.image_file = image_file
28 | self.frames = []
29 | self.imagedata = BytesIO()
30 | if frame_file is None:
31 | self.image_name = ""
32 | self.image_ts = ""
33 | elif image_file is None:
34 | self.image_name = path.splitext(frame_file)[0]
35 | self.image_ts = ""
36 | else:
37 | self.image_name = image_file
38 | self.image_ts = datetime.utcnow().strftime("%Y-%m-%dT%H-%M-%S")
39 | self.image_ext = ".jpg"
40 | if self.norad_id is not None:
41 | self.main()
42 |
43 | def main(self):
44 | if self.norad_id in StratosatDecode.supported_norad: # Geoscan, StratoSat
45 | StratosatDecode(self.frame_file, self.norad_id, self.image_file)
46 | elif self.norad_id in Cas5aDecode.supported_norad: # CAS-5A
47 | Cas5aDecode(self.frame_file, self.norad_id, self.image_file)
48 | elif self.norad_id in SirenDecode.supported_norad: # Siren
49 | SirenDecode(self.frame_file, self.norad_id, self.image_file)
50 | elif self.norad_id in Lucky7Decode.supported_norad: # Lucky-7
51 | Lucky7Decode(self.frame_file, self.norad_id, self.image_file)
52 | elif self.norad_id in SharjahsatDecode.supported_norad: # Sharjahsat-1
53 | SharjahsatDecode(self.frame_file, self.norad_id, self.image_file)
54 | elif self.norad_id in ExternalDecode.supported_norad: # JY1Sat
55 | ExternalDecode(self.frame_file, self.norad_id, self.image_file)
56 | else:
57 | LOGGER.debug(f"No image decoder found for {self.norad_id}")
58 |
59 | def parse_file(self):
60 | try:
61 | with open(self.frame_file, "r") as f:
62 | return self.parse_hex_file(f)
63 | except UnicodeDecodeError:
64 | with open(self.frame_file, "rb") as f:
65 | return self.parse_kiss_file(f)
66 |
67 | def parse_hex_file(self, hex_file):
68 | self.frames = []
69 | for row in hex_file:
70 | if "|" not in row:
71 | LOGGER.debug(f"Bad hex file row, missing '|' separator")
72 | continue
73 | data = row.split("|")
74 | if len(data) == 2 or len(data) == 4: # satnogs db export old/new
75 | self.frames.append(
76 | (
77 | datetime.strptime(data[0].strip(), "%Y-%m-%d %H:%M:%S"),
78 | data[1].strip(),
79 | )
80 | )
81 | elif len(data) == 3: # getkiss+
82 | self.frames.append(
83 | (
84 | datetime.strptime(data[0].strip(), "%Y-%m-%d %H:%M:%S.%f"),
85 | data[2].strip(),
86 | )
87 | )
88 | else:
89 | LOGGER.debug(f"Unknown hex line format")
90 |
91 | def parse_kiss_file(self, infile):
92 | self.frames = []
93 | ts = datetime.utcnow() # MUST be overwritten by timestamps in file
94 | for row in infile.read().split(b"\xC0"):
95 | if len(row) == 9 and row[0] == 9: # timestamp frame
96 | ts = datetime(1970, 1, 1) + timedelta(
97 | seconds=unpack(">Q", row[1:])[0] / 1000
98 | )
99 | if len(row) > 0 and row[0] == 0: # data frame
100 | self.frames.append(
101 | (
102 | ts,
103 | row[1:]
104 | .replace(b"\xdb\xdc", b"\xc0")
105 | .replace(b"\xdb\xdd", b"\xdb")
106 | .hex(bytes_per_sep=2),
107 | )
108 | )
109 |
110 | def write_image(self):
111 | if self.imagedata.getbuffer().nbytes == 0:
112 | LOGGER.warning(f"No image data found in {self.frame_file}")
113 | return
114 | image_file = f"{self.image_name}{self.image_ts}{self.image_ext}"
115 | LOGGER.info(f"Writing image to: {image_file}")
116 | with open(image_file, "wb") as f:
117 | f.write(self.imagedata.getbuffer())
118 |
119 |
120 | class StratosatDecode(ImageDecode):
121 | supported_norad = [53385, 57167]
122 |
123 | def __init__(self, frame_file, norad_id, image_file):
124 | super().__init__(frame_file, norad_id, image_file)
125 |
126 | def main(self):
127 | self.parse_file()
128 | self.imagedata.seek(0)
129 | self.imagedata.truncate()
130 | cmd_match = "0200" # default to Stratosat TK-1, 0100 Geoscan-Edelveis
131 | offset = 0
132 | hr = False
133 | for ts, row in self.frames: # find start frame, memory offset, detect lr/hr
134 | if len(row) != 128:
135 | continue
136 | if row[16:22].upper() == "FFD8FF":
137 | offset = int((row[14:16] + row[12:14] + row[10:12]), 16)
138 | hr = row[6:10].upper() == "2098"
139 | if hr:
140 | offset = 0
141 | cmd_match = row[0:4].upper()
142 | break
143 | LOGGER.debug(f"Stratosat: cmd_match={cmd_match}, offset={offset}, hr={hr}")
144 | for ts, row in self.frames:
145 | if len(row) != 128:
146 | continue
147 | cmd = row[0:4]
148 | addr = int((row[14:16] + row[12:14] + row[10:12]), 16) - offset
149 | dlen = (int(row[4:6], 16) + 2) * 2
150 | payload = row[16:dlen]
151 | if cmd == cmd_match and addr >= 0:
152 | self.imagedata.seek(addr)
153 | self.imagedata.write(bytes.fromhex(payload))
154 | self.write_image()
155 |
156 |
157 | class Cas5aDecode(ImageDecode):
158 | supported_norad = [54684]
159 |
160 | def __init__(self, frame_file, norad_id, image_file):
161 | super().__init__(frame_file, norad_id, image_file)
162 |
163 | def main(self):
164 | self.parse_file()
165 | num_images = 0
166 | for pid in set(self.get_photo_ids()):
167 | self.parse_frames(pid)
168 | self.image_ext = f"_{num_images}.jpg"
169 | self.write_image()
170 | num_images += 1
171 |
172 | def parse_frames(self, pid):
173 | self.imagedata.seek(0)
174 | self.imagedata.truncate()
175 | dlen = 240 # assumed maxed out frames to multiply by sequence number
176 | hlen = 32 # header length
177 | for ts, row in self.frames:
178 | if len(row) < 64:
179 | continue
180 | if pid != row[46:64] or int(row[32:34], 16) != 3:
181 | continue
182 | ftot = int(row[34:38], 16)
183 | fseq = int(row[38:42], 16)
184 | flen = int(row[42:46], 16) * 2 + hlen
185 | if fseq <= ftot and flen <= len(row):
186 | self.imagedata.seek((fseq - 1) * dlen)
187 | self.imagedata.write(bytes.fromhex(row[64:flen]))
188 |
189 | def get_photo_ids(self):
190 | pids = set()
191 | for ts, row in self.frames:
192 | if len(row) < 64:
193 | continue
194 | if (
195 | int(row[32:34], 16) != 3
196 | or int(row[46:48], 16) < 22 # year
197 | or int(row[46:48], 16) > 25 # year
198 | or int(row[48:50], 16) > 12 # month
199 | or int(row[50:52], 16) > 31 # day
200 | or int(row[52:54], 16) > 24 # hour
201 | or int(row[54:56], 16) > 60 # minute
202 | or int(row[56:58], 16) > 60 # second
203 | ): # sanity check
204 | continue
205 | pids.add(row[46:64])
206 | return pids
207 |
208 |
209 | class SirenDecode(ImageDecode):
210 | supported_norad = [53384]
211 |
212 | def __init__(self, frame_file, norad_id, image_file):
213 | super().__init__(frame_file, norad_id, image_file)
214 |
215 | def main(self):
216 | self.parse_file()
217 | self.imagedata.seek(0)
218 | self.imagedata.truncate()
219 | cmd_match = "240C"
220 | offset = 0
221 | for ts, row in self.frames: # find start frame, memory offset, detect lr/hr
222 | if len(row) < 64:
223 | continue
224 | if row[58:64].upper() == "FFD8FF":
225 | offset = int((row[52:54] + row[50:52]), 16)
226 | break
227 | LOGGER.debug(f"Siren: cmd_match={cmd_match}, offset={offset}")
228 | for ts, row in self.frames:
229 | if len(row) < 64:
230 | continue
231 | cmd = row[32:36]
232 | addr = int((row[56:58] + row[54:56] + row[52:54] + row[50:52]), 16) - offset
233 | payload = row[58:]
234 | if cmd == cmd_match and addr >= 0:
235 | self.imagedata.seek(addr)
236 | self.imagedata.write(bytes.fromhex(payload))
237 | self.write_image()
238 |
239 |
240 | class Lucky7Decode(ImageDecode): # WIP
241 | supported_norad = [44406]
242 |
243 | def __init__(self, frame_file, norad_id, image_file):
244 | super().__init__(frame_file, norad_id, image_file)
245 |
246 | def main(self):
247 | self.parse_file()
248 | num_images = 0
249 | for pid in set(self.get_packet_ids()):
250 | self.parse_frames(pid)
251 | self.image_ext = f"_{num_images}.jpg"
252 | self.write_image()
253 | num_images += 1
254 |
255 | def get_packet_ids(self):
256 | pids = []
257 | offset = 49152 # 0xC000
258 | for row in self.frames:
259 | if len(row) < 70:
260 | continue
261 | oid = int(row[0:2], 16)
262 | obc = int(row[2:6], 16)
263 | packets = int(row[10:14], 16)
264 | if (oid == 128 or oid == 0) and obc >= offset:
265 | pids.append(packets)
266 | return pids
267 |
268 | def parse_frames(self, pid):
269 | offset = 49152 # 0xC000
270 | for row in self.frames:
271 | if len(row) < 70:
272 | continue
273 | oid = int(row[0:2], 16)
274 | obc = int(row[2:6], 16)
275 | # mcu = int(row[6:10], 16)
276 | packets = int(row[10:14], 16)
277 | payload = row[14:70]
278 | # print(f'ID {oid:4}, OBC {obc:5}, MCU {mcu:5}, packets {packets:5}: {row[0:14]} {payload}')
279 | if (oid == 128 or oid == 0) and obc >= offset and packets == pid:
280 | self.imagedata.seek((obc - offset) * 28)
281 | self.imagedata.write(bytes.fromhex(payload))
282 |
283 |
284 | class SharjahsatDecode(ImageDecode): # WIP
285 | supported_norad = [55104]
286 |
287 | def __init__(self, frame_file, norad_id, image_file):
288 | super().__init__(frame_file, norad_id, image_file)
289 |
290 | def main(self):
291 | self.parse_file()
292 | self.imagedata.seek(0)
293 | self.imagedata.truncate()
294 | lastframe = 0
295 | dsize = 246
296 | for row in self.frames:
297 | if len(row) < 64:
298 | continue
299 | if "FFD8FF" in row[52:58]:
300 | lastframe = int(row[46:48] + row[44:46], 16) # it's actually 32bit
301 | dsize = int(row[42:44], 16) # usually 246
302 | print(f"dsize {dsize}, lastframe {lastframe}")
303 | break
304 | for row in self.frames:
305 | if len(row) < 64:
306 | continue
307 | did = bytes.fromhex(row[32:40])
308 | dt = row[40:42]
309 | dlen = int(row[42:44], 16)
310 | addr = int(row[46:48] + row[44:46], 16) # it's actually 32bit
311 | # header = row[0:52]
312 | payload = row[52:]
313 | # print(f'{call} dt:{dt} dl:{dlen} a:{addr} {header} {payload}')
314 | if did == b"ESER" and dt == "41":
315 | # if dlen != 246:
316 | # print(f"dsize {dlen}, addr {addr}\t{row}")
317 | self.imagedata.seek(dsize * (lastframe - addr))
318 | self.imagedata.write(bytes.fromhex(payload))
319 | self.write_image()
320 |
321 |
322 | class ExternalDecode(ImageDecode):
323 | supported_norad = [43803]
324 |
325 | def __init__(self, frame_file, norad_id, image_file):
326 | super().__init__(frame_file, norad_id, image_file)
327 |
328 | def main(self):
329 | if self.norad_id == self.supported_norad[0]:
330 | self.jy1sat_ssdv()
331 |
332 | def jy1sat_ssdv(self):
333 | LOGGER.info(f"Running jy1sat_ssdv")
334 | try:
335 | Popen(
336 | ["jy1sat_ssdv", self.frame_file, self.image_name],
337 | stdout=DEVNULL,
338 | stderr=DEVNULL,
339 | )
340 | except FileNotFoundError:
341 | LOGGER.error(f"Did not find executable jy1sat_ssdv")
342 | for f in Path(self.image_name).glob("*.ssdv"):
343 | f.unlink(missing_ok=True)
344 |
345 |
346 | if __name__ == "__main__":
347 | LOGGER.setLevel(logging.INFO)
348 | if len(argv) == 3:
349 | ImageDecode(argv[1], argv[2])
350 | elif len(argv) == 4:
351 | ImageDecode(argv[1], argv[2], argv[3])
352 | else:
353 | print(
354 | f"Usage: {argv[0]} [output_prefix]\n"
355 | f"Frame file can be KISS, SatNOGS data export or GetKISS+"
356 | )
357 |
--------------------------------------------------------------------------------
/addons/scripts/iq_dump_rename.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # suggested variables to set in config
3 | # ENABLE_IQ_DUMP="True"
4 | # IQ_DUMP_FILENAME="/srv/iq"
5 | # IQ_DUMP_RENAME="True"
6 | # IQ_DUMP_COMPRESS="True"
7 |
8 | if [[ "${ENABLE_IQ_DUMP^^}" =~ (TRUE|YES|1) ]] && [[ "${IQ_DUMP_RENAME^^}" =~ (TRUE|YES|1) ]]; then
9 | SAMP=$(find_samp_rate.py "$5" "$6")
10 | NAME="${IQ_DUMP_FILENAME}_${1}_${SAMP}.raw"
11 | mv "${IQ_DUMP_FILENAME}" "${NAME}"
12 | if [[ "${IQ_DUMP_COMPRESS^^}" =~ (TRUE|YES|1) ]]; then
13 | zstd --no-progress --rm -f "${NAME}"
14 | fi
15 | fi
16 |
--------------------------------------------------------------------------------
/addons/scripts/liveupdate-satyaml.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | cd || exit
3 | git clone -b maint-3.8 --depth 1 https://github.com/daniestevez/gr-satellites.git
4 | cp gr-satellites/python/satyaml/* /usr/lib/python3/dist-packages/satellites/satyaml/
5 | rm -rf gr-satellites /tmp/.satnogs/grsat_list.*
6 | exec "$@"
7 |
8 |
--------------------------------------------------------------------------------
/addons/scripts/meminfo.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python3
2 | import psutil
3 | import sys
4 |
5 | if len(sys.argv) != 2:
6 | print('supply pid to connect')
7 | exit(-1)
8 | p = psutil.Process(int(sys.argv[1]))
9 | print(p.memory_info())
10 | for i in p.memory_maps():
11 | print(i)
12 |
--------------------------------------------------------------------------------
/addons/scripts/meteor.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # exit if pipeline fails or unset variables
3 | set -eu
4 |
5 | # Launch with: {command} {{ID}} {{FREQ}} {{TLE}} {{TIMESTAMP}} {{BAUD}} {{SCRIPT_NAME}}
6 | CMD="$1" # $1 [start|stop]
7 | ID="$2" # $2 observation ID
8 | #FREQ="$3" # $3 frequency
9 | TLE="$4" # $4 used tle's
10 | DATE="$5" # $5 timestamp Y-m-dTH-M-S
11 | BAUD="$6" # $6 baudrate
12 | SCRIPT="$7" # $7 script name, satnogs_bpsk.py
13 |
14 | # default values
15 | : "${METEOR_NORAD:=57166}"
16 | : "${UDP_DUMP_PORT:=57356}"
17 | : "${SATNOGS_APP_PATH:=/tmp/.satnogs}"
18 | : "${SATNOGS_OUTPUT_PATH:=/tmp/.satnogs/data}"
19 |
20 | PRG="Meteor demod+decode"
21 | METEOR_PID="$SATNOGS_APP_PATH/meteor_$SATNOGS_STATION_ID.pid"
22 | IMAGE="$SATNOGS_OUTPUT_PATH/data_${ID}_${DATE}.png"
23 | SATNAME=$(echo "$TLE" | jq .tle0 | sed -e 's/ /_/g' | sed -e 's/[^A-Za-z0-9._-]//g')
24 | NORAD=$(echo "$TLE" | jq .tle2 | awk '{print $2}')
25 |
26 | if [ "${CMD^^}" == "START" ]; then
27 | if [ -z ${METEOR_NORAD+x} ] || [[ ${METEOR_NORAD} =~ ${NORAD} ]]; then
28 | echo "$PRG: $ID, Norad: $NORAD, Name: $SATNAME, Script: $SCRIPT"
29 | if [ -z "$UDP_DUMP_HOST" ]; then
30 | echo "Warning: UDP_DUMP_HOST not set, no data will be sent to the demod"
31 | fi
32 | SAMP=$(find_samp_rate.py "$BAUD" "$SCRIPT")
33 | if [ -z "$SAMP" ]; then
34 | SAMP=144000
35 | echo "WARNING: find_samp_rate.py did not return valid sample rate!"
36 | fi
37 | SYMRATE=$((${BAUD%.*} * 2))
38 | if [ ${SYMRATE} == 80000 ]; then
39 | INTERLACE="--int"
40 | else
41 | INTERLACE=""
42 | fi
43 | ( udp2ishort.py -p "$UDP_DUMP_PORT" & echo $! > "$METEOR_PID" ) | \
44 | meteor_demod --batch --quiet -O 8 -f 128 -s "$SAMP" -r "$SYMRATE" -m oqpsk --bps 16 --stdout - | \
45 | meteor_decode --batch --quiet "$INTERLACE" --diff -a 65,65,64 -o "$IMAGE" - &
46 | fi
47 | fi
48 |
49 | if [ "${CMD^^}" == "STOP" ]; then
50 | if [ -f "$METEOR_PID" ]; then
51 | kill "$(cat "$METEOR_PID")"
52 | rm -f "$METEOR_PID"
53 | fi
54 | fi
55 |
--------------------------------------------------------------------------------
/addons/scripts/rotor-park.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | if [[ ! "${ROT_PARK^^}" =~ (TRUE|YES|1) ]]; then exit; fi
3 | # exit if pipeline fails or unset variables
4 | set -eu
5 | ROTCTL=${SATNOGS_ROT_PORT/:/ }
6 | echo "Parking rotor: $ROTCTL"
7 | echo "P 180 90" | nc -w 1 $ROTCTL
8 |
--------------------------------------------------------------------------------
/addons/scripts/satdump.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | if [[ ! "${SATDUMP_ENABLE^^}" =~ (TRUE|YES|1) ]]; then exit; fi
3 | set -eu
4 |
5 | # {command} {{ID}} {{FREQ}} {{TLE}} {{TIMESTAMP}} {{BAUD}} {{SCRIPT_NAME}}
6 | CMD="$1" # $1 [start|stop]
7 | ID="$2" # $2 observation ID
8 | FREQ="$3" # $3 frequency
9 | TLE="$4" # $4 used tle's
10 | DATE="$5" # $5 timestamp Y-m-dTH-M-S
11 | BAUD="$6" # $6 baudrate
12 | SCRIPT="$7" # $7 script name, satnogs_bpsk.py
13 |
14 | PRG="SatDump:"
15 | : "${SATNOGS_APP_PATH:=/tmp/.satnogs}"
16 | : "${SATNOGS_OUTPUT_PATH:=/tmp/.satnogs/data/}"
17 | : "${UDP_DUMP_PORT:=57356}"
18 | : "${SATDUMP_KEEPLOGS:=no}"
19 | BIN=$(command -v satdump)
20 | LOG="SATNOGS_APP_PATH/satdump_$ID.log"
21 | OUT="SATNOGS_APP_PATH/satdump_$ID"
22 | PID="SATNOGS_APP_PATH/satdump_$SATNOGS_STATION_ID.pid"
23 |
24 | SATNAME=$(echo "$TLE" | jq .tle0 | sed -e 's/ /_/g' | sed -e 's/[^A-Za-z0-9._-]//g')
25 | NORAD=$(echo "$TLE" | jq .tle2 | awk '{print $2}')
26 |
27 | if [ "${CMD^^}" == "START" ]; then
28 | if [ -z "$UDP_DUMP_HOST" ]; then
29 | echo "$PRG WARNING! UDP_DUMP_HOST not set, no data will be sent to the demod"
30 | fi
31 | SAMP=$(find_samp_rate.py "$BAUD" "$SCRIPT")
32 | if [ -z "$SAMP" ]; then
33 | SAMP=66560
34 | echo "$PRG WARNING! find_samp_rate.py did not return valid sample rate!"
35 | fi
36 | OPT=""
37 | case "$NORAD" in
38 | "25338") # NOAA 15
39 | OPT="live noaa_apt $OUT --source udp_source --port $UDP_DUMP_PORT --satellite_number 15 --samplerate $SAMP"
40 | ;;
41 | "28654") # NOAA 18
42 | OPT="live noaa_apt $OUT --source udp_source --port $UDP_DUMP_PORT --satellite_number 18 --samplerate $SAMP"
43 | ;;
44 | "33591") # NOAA 19
45 | OPT="live noaa_apt $OUT --source udp_source --port $UDP_DUMP_PORT --satellite_number 19 --samplerate $SAMP"
46 | ;;
47 | esac
48 |
49 | if [ -n "$OPT" ]; then
50 | mkdir -p "$OUT"
51 | echo "$PRG running at $SAMP sps on $SATNAME"
52 | $BIN $OPT > "$LOG" 2>> "$LOG" &
53 | echo $! > "$PID"
54 | fi
55 | fi
56 |
57 | if [ "${CMD^^}" == "STOP" ]; then
58 | if [ -f "$PID" ]; then
59 | echo "$PRG Stopping observation $ID"
60 | kill "$(cat "$PID")"
61 | rm -f "$PID"
62 | fi
63 |
64 | if [ -s "$OUT" ]; then
65 | echo "$PRG processing data to network"
66 | # find images, rename/move to ${SATNOGS_OUTPUT_PATH}/data__YYYY-MM-DDTHH-MM-SS.png
67 | ls "$OUT"
68 | if [ ! "${SATDUMP_KEEPLOGS^^}" == "YES" ]; then
69 | rm -rf "$OUT"
70 | fi
71 | fi
72 |
73 | if [ ! -s "$LOG" ] || [ ! "${SATDUMP_KEEPLOGS^^}" == "YES" ]; then
74 | rm -f "$LOG"
75 | else
76 | echo "$PRG Keeping logs, you need to purge them manually."
77 | fi
78 | fi
79 |
--------------------------------------------------------------------------------
/addons/scripts/satnogs-post:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # SATNOGS_POST_OBSERVATION_SCRIPT="satnogs-post {{ID}} {{FREQ}} {{TLE}} {{TIMESTAMP}} {{BAUD}} {{SCRIPT_NAME}}"
3 |
4 | grsat.py stop "$@"
5 | satdump.sh stop "$@"
6 | meteor.sh stop "$@"
7 | iq_dump_rename.sh "$@"
8 | bandscan.sh start
9 | direwolf.sh start
10 | rotor-park.sh
11 |
--------------------------------------------------------------------------------
/addons/scripts/satnogs-pre:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # SATNOGS_PRE_OBSERVATION_SCRIPT="satnogs-pre {{ID}} {{FREQ}} {{TLE}} {{TIMESTAMP}} {{BAUD}} {{SCRIPT_NAME}}"
3 |
4 | bandscan.sh stop
5 | direwolf.sh stop
6 | grsat.py start "$@"
7 | satdump.sh start "$@"
8 | meteor.sh start "$@"
9 | if [[ "${GPIO_ENABLE^^}" =~ (TRUE|YES|1) ]]; then
10 | gpio.py -f "${2}"
11 | fi
12 |
--------------------------------------------------------------------------------
/addons/scripts/sdrplay.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | cd || exit
3 | sdrplay_apiService &
4 | exec "$@"
--------------------------------------------------------------------------------
/addons/scripts/test-flowgraph.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | if [ -f /.env ]; then
4 | source /.env
5 | fi
6 |
7 | if [ -z "${RX_FREQ}" ]; then
8 | RX_FREQ="435000000"
9 | fi
10 |
11 | if [ -z "${SATNOGS_PPM_ERROR}" ]; then
12 | SATNOGS_PPM_ERROR="0"
13 | fi
14 |
15 | BIN="satnogs_fm.py"
16 | ARGS="--soapy-rx-device=${SATNOGS_SOAPY_RX_DEVICE} \
17 | --samp-rate-rx=${SATNOGS_RX_SAMP_RATE} \
18 | --rx-freq=${RX_FREQ} \
19 | --file-path=test.ogg \
20 | --waterfall-file-path=test.dat \
21 | --decoded-data-file-path=test_data \
22 | --gain=${SATNOGS_RF_GAIN} \
23 | --antenna=${SATNOGS_ANTENNA} \
24 | --ppm=${SATNOGS_PPM_ERROR} \
25 | --rigctl-host=${SATNOGS_RIG_IP} \
26 | --rigctl-port=${SATNOGS_RIG_PORT}"
27 |
28 | echo "Running rx at ${RX_FREQ}, press Ctrl-C to terminate."
29 | ${BIN} ${ARGS}
30 | echo "Generating waterfall..."
31 | wf2png.py test
32 |
33 |
--------------------------------------------------------------------------------
/addons/scripts/wf2png.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python3
2 | import sys
3 |
4 | from satnogsclient.waterfall import EmptyArrayError, Waterfall
5 |
6 | if len(sys.argv) > 1:
7 | try:
8 | waterfall = Waterfall('{}.dat'.format(sys.argv[1]))
9 | waterfall.plot('{}.png'.format(sys.argv[1]))
10 | except FileNotFoundError:
11 | print('No waterfall data file found')
12 | except (EmptyArrayError, IndexError):
13 | print('Waterfall data array is empty')
14 |
15 | else:
16 | print("useage: {0} \nexample: {0} test\nwill read test.dat and create test.png".
17 | format(sys.argv[0]))
18 |
--------------------------------------------------------------------------------
/lsf/.gitignore:
--------------------------------------------------------------------------------
1 | station.env
2 |
3 |
--------------------------------------------------------------------------------
/lsf/10-satnogs.rules:
--------------------------------------------------------------------------------
1 | # Airspy HF and Airspy
2 | SUBSYSTEMS=="usb", ATTR{idVendor}=="03eb", ATTR{idProduct}=="800c", MODE="0660", GROUP="plugdev"
3 | SUBSYSTEMS=="usb", ATTR{idVendor}=="1d50", ATTR{idProduct}=="60a1", MODE="0660", GROUP="plugdev"
4 |
5 | # Funcube Dongle
6 | SUBSYSTEMS=="usb", ATTRS{idVendor}=="04d8", ATTRS{idProduct}=="fb31", MODE="0660", GROUP="plugdev"
7 |
8 | # HackRF Jawbreaker, One and rad1o
9 | SUBSYSTEMS=="usb", ATTR{idVendor}=="1d50", ATTR{idProduct}=="604b", MODE="0660", GROUP="plugdev"
10 | SUBSYSTEMS=="usb", ATTR{idVendor}=="1d50", ATTR{idProduct}=="6089", MODE="0660", GROUP="plugdev"
11 | SUBSYSTEMS=="usb", ATTR{idVendor}=="1d50", ATTR{idProduct}=="cc15", MODE="0660", GROUP="plugdev"
12 | SUBSYSTEMS=="usb", ATTR{idVendor}=="1fc9", ATTR{idProduct}=="000c", MODE="0660", GROUP="plugdev"
13 | KERNEL=="sd?", SUBSYSTEM=="block", ENV{ID_VENDOR_ID}=="1fc9", ENV{ID_MODEL_ID}=="0042", MODE="0660", GROUP="plugdev"
14 | KERNEL=="sd?", SUBSYSTEM=="block", ENV{ID_VENDOR_ID}=="1fc9", ENV{ID_MODEL_ID}=="0082", MODE="0660", GROUP="plugdev"
15 |
16 | # original RTL2832U vid/pid (hama nano, for example)
17 | SUBSYSTEMS=="usb", ATTRS{idVendor}=="0bda", ATTRS{idProduct}=="2832", MODE:="0660", GROUP="plugdev"
18 |
19 | # RTL2832U OEM vid/pid, e.g. ezcap EzTV668 (E4000), Newsky TV28T (E4000/R820T) etc.
20 | SUBSYSTEMS=="usb", ATTRS{idVendor}=="0bda", ATTRS{idProduct}=="2838", MODE:="0660", GROUP="plugdev"
21 |
22 | # DigitalNow Quad DVB-T PCI-E card (4x FC0012?)
23 | SUBSYSTEMS=="usb", ATTRS{idVendor}=="0413", ATTRS{idProduct}=="6680", MODE:="0660", GROUP="plugdev"
24 |
25 | # Leadtek WinFast DTV Dongle mini D (FC0012)
26 | SUBSYSTEMS=="usb", ATTRS{idVendor}=="0413", ATTRS{idProduct}=="6f0f", MODE:="0660", GROUP="plugdev"
27 |
28 | # Genius TVGo DVB-T03 USB dongle (Ver. B)
29 | SUBSYSTEMS=="usb", ATTRS{idVendor}=="0458", ATTRS{idProduct}=="707f", MODE:="0660", GROUP="plugdev"
30 |
31 | # Terratec Cinergy T Stick Black (rev 1) (FC0012)
32 | SUBSYSTEMS=="usb", ATTRS{idVendor}=="0ccd", ATTRS{idProduct}=="00a9", MODE:="0660", GROUP="plugdev"
33 |
34 | # Terratec NOXON rev 1 (FC0013)
35 | SUBSYSTEMS=="usb", ATTRS{idVendor}=="0ccd", ATTRS{idProduct}=="00b3", MODE:="0660", GROUP="plugdev"
36 |
37 | # Terratec Deutschlandradio DAB Stick (FC0013)
38 | SUBSYSTEMS=="usb", ATTRS{idVendor}=="0ccd", ATTRS{idProduct}=="00b4", MODE:="0660", GROUP="plugdev"
39 |
40 | # Terratec NOXON DAB Stick - Radio Energy (FC0013)
41 | SUBSYSTEMS=="usb", ATTRS{idVendor}=="0ccd", ATTRS{idProduct}=="00b5", MODE:="0660", GROUP="plugdev"
42 |
43 | # Terratec Media Broadcast DAB Stick (FC0013)
44 | SUBSYSTEMS=="usb", ATTRS{idVendor}=="0ccd", ATTRS{idProduct}=="00b7", MODE:="0660", GROUP="plugdev"
45 |
46 | # Terratec BR DAB Stick (FC0013)
47 | SUBSYSTEMS=="usb", ATTRS{idVendor}=="0ccd", ATTRS{idProduct}=="00b8", MODE:="0660", GROUP="plugdev"
48 |
49 | # Terratec WDR DAB Stick (FC0013)
50 | SUBSYSTEMS=="usb", ATTRS{idVendor}=="0ccd", ATTRS{idProduct}=="00b9", MODE:="0660", GROUP="plugdev"
51 |
52 | # Terratec MuellerVerlag DAB Stick (FC0013)
53 | SUBSYSTEMS=="usb", ATTRS{idVendor}=="0ccd", ATTRS{idProduct}=="00c0", MODE:="0660", GROUP="plugdev"
54 |
55 | # Terratec Fraunhofer DAB Stick (FC0013)
56 | SUBSYSTEMS=="usb", ATTRS{idVendor}=="0ccd", ATTRS{idProduct}=="00c6", MODE:="0660", GROUP="plugdev"
57 |
58 | # Terratec Cinergy T Stick RC (Rev.3) (E4000)
59 | SUBSYSTEMS=="usb", ATTRS{idVendor}=="0ccd", ATTRS{idProduct}=="00d3", MODE:="0660", GROUP="plugdev"
60 |
61 | # Terratec T Stick PLUS (E4000)
62 | SUBSYSTEMS=="usb", ATTRS{idVendor}=="0ccd", ATTRS{idProduct}=="00d7", MODE:="0660", GROUP="plugdev"
63 |
64 | # Terratec NOXON rev 2 (E4000)
65 | SUBSYSTEMS=="usb", ATTRS{idVendor}=="0ccd", ATTRS{idProduct}=="00e0", MODE:="0660", GROUP="plugdev"
66 |
67 | # PixelView PV-DT235U(RN) (FC0012)
68 | SUBSYSTEMS=="usb", ATTRS{idVendor}=="1554", ATTRS{idProduct}=="5020", MODE:="0660", GROUP="plugdev"
69 |
70 | # Astrometa DVB-T/DVB-T2 (R828D)
71 | SUBSYSTEMS=="usb", ATTRS{idVendor}=="15f4", ATTRS{idProduct}=="0131", MODE:="0660", GROUP="plugdev"
72 |
73 | # HanfTek DAB+FM+DVB-T
74 | SUBSYSTEMS=="usb", ATTRS{idVendor}=="15f4", ATTRS{idProduct}=="0133", MODE:="0660", GROUP="plugdev"
75 |
76 | # Compro Videomate U620F (E4000)
77 | SUBSYSTEMS=="usb", ATTRS{idVendor}=="185b", ATTRS{idProduct}=="0620", MODE:="0660", GROUP="plugdev"
78 |
79 | # Compro Videomate U650F (E4000)
80 | SUBSYSTEMS=="usb", ATTRS{idVendor}=="185b", ATTRS{idProduct}=="0650", MODE:="0660", GROUP="plugdev"
81 |
82 | # Compro Videomate U680F (E4000)
83 | SUBSYSTEMS=="usb", ATTRS{idVendor}=="185b", ATTRS{idProduct}=="0680", MODE:="0660", GROUP="plugdev"
84 |
85 | # GIGABYTE GT-U7300 (FC0012)
86 | SUBSYSTEMS=="usb", ATTRS{idVendor}=="1b80", ATTRS{idProduct}=="d393", MODE:="0660" , GROUP="plugdev"
87 |
88 | # DIKOM USB-DVBT HD
89 | SUBSYSTEMS=="usb", ATTRS{idVendor}=="1b80", ATTRS{idProduct}=="d394", MODE:="0660", GROUP="plugdev"
90 |
91 | # Peak 102569AGPK (FC0012)
92 | SUBSYSTEMS=="usb", ATTRS{idVendor}=="1b80", ATTRS{idProduct}=="d395", MODE:="0660", GROUP="plugdev"
93 |
94 | # KWorld KW-UB450-T USB DVB-T Pico TV (TUA9001)
95 | SUBSYSTEMS=="usb", ATTRS{idVendor}=="1b80", ATTRS{idProduct}=="d397", MODE:="0660", GROUP="plugdev"
96 |
97 | # Zaapa ZT-MINDVBZP (FC0012)
98 | SUBSYSTEMS=="usb", ATTRS{idVendor}=="1b80", ATTRS{idProduct}=="d398", MODE:="0660", GROUP="plugdev"
99 |
100 | # SVEON STV20 DVB-T USB & FM (FC0012)
101 | SUBSYSTEMS=="usb", ATTRS{idVendor}=="1b80", ATTRS{idProduct}=="d39d", MODE:="0660", GROUP="plugdev"
102 |
103 | # Twintech UT-40 (FC0013)
104 | SUBSYSTEMS=="usb", ATTRS{idVendor}=="1b80", ATTRS{idProduct}=="d3a4", MODE:="0660", GROUP="plugdev"
105 |
106 | # ASUS U3100MINI_PLUS_V2 (FC0013)
107 | SUBSYSTEMS=="usb", ATTRS{idVendor}=="1b80", ATTRS{idProduct}=="d3a8", MODE:="0660", GROUP="plugdev"
108 |
109 | # SVEON STV27 DVB-T USB & FM (FC0013)
110 | SUBSYSTEMS=="usb", ATTRS{idVendor}=="1b80", ATTRS{idProduct}=="d3af", MODE:="0660", GROUP="plugdev"
111 |
112 | # SVEON STV21 DVB-T USB & FM
113 | SUBSYSTEMS=="usb", ATTRS{idVendor}=="1b80", ATTRS{idProduct}=="d3b0", MODE:="0660", GROUP="plugdev"
114 |
115 | # Dexatek DK DVB-T Dongle (Logilink VG0002A) (FC2580)
116 | SUBSYSTEMS=="usb", ATTRS{idVendor}=="1d19", ATTRS{idProduct}=="1101", MODE:="0660", GROUP="plugdev"
117 |
118 | # Dexatek DK DVB-T Dongle (MSI DigiVox mini II V3.0)
119 | SUBSYSTEMS=="usb", ATTRS{idVendor}=="1d19", ATTRS{idProduct}=="1102", MODE:="0660", GROUP="plugdev"
120 |
121 | # Dexatek DK 5217 DVB-T Dongle (FC2580)
122 | SUBSYSTEMS=="usb", ATTRS{idVendor}=="1d19", ATTRS{idProduct}=="1103", MODE:="0660", GROUP="plugdev"
123 |
124 | # MSI DigiVox Micro HD (FC2580)
125 | SUBSYSTEMS=="usb", ATTRS{idVendor}=="1d19", ATTRS{idProduct}=="1104", MODE:="0660", GROUP="plugdev"
126 |
127 | # Sweex DVB-T USB (FC0012)
128 | SUBSYSTEMS=="usb", ATTRS{idVendor}=="1f4d", ATTRS{idProduct}=="a803", MODE:="0660", GROUP="plugdev"
129 |
130 | # GTek T803 (FC0012)
131 | SUBSYSTEMS=="usb", ATTRS{idVendor}=="1f4d", ATTRS{idProduct}=="b803", MODE:="0660", GROUP="plugdev"
132 |
133 | # Lifeview LV5TDeluxe (FC0012)
134 | SUBSYSTEMS=="usb", ATTRS{idVendor}=="1f4d", ATTRS{idProduct}=="c803", MODE:="0660", GROUP="plugdev"
135 |
136 | # MyGica TD312 (FC0012)
137 | SUBSYSTEMS=="usb", ATTRS{idVendor}=="1f4d", ATTRS{idProduct}=="d286", MODE:="0660", GROUP="plugdev"
138 |
139 | # PROlectrix DV107669 (FC0012)
140 | SUBSYSTEMS=="usb", ATTRS{idVendor}=="1f4d", ATTRS{idProduct}=="d803", MODE:="0660", GROUP="plugdev"
141 |
142 | # SDRPlay
143 | SUBSYSTEMS=="usb", ATTRS{idVendor}=="1df7", ATTRS{idProduct}=="2500", MODE:="0660", GROUP="plugdev"
144 | SUBSYSTEMS=="usb", ATTRS{idVendor}=="1df7", ATTRS{idProduct}=="3000", MODE:="0660", GROUP="plugdev"
145 | SUBSYSTEMS=="usb", ATTRS{idVendor}=="1df7", ATTRS{idProduct}=="3010", MODE:="0660", GROUP="plugdev"
146 | SUBSYSTEMS=="usb", ATTRS{idVendor}=="1df7", ATTRS{idProduct}=="3020", MODE:="0660", GROUP="plugdev"
147 | SUBSYSTEMS=="usb", ATTRS{idVendor}=="1df7", ATTRS{idProduct}=="3030", MODE:="0660", GROUP="plugdev"
148 | SUBSYSTEMS=="usb", ATTRS{idVendor}=="1df7", ATTRS{idProduct}=="3050", MODE:="0660", GROUP="plugdev"
149 |
150 | # USRP1, B100 and B200
151 | SUBSYSTEMS=="usb", ATTRS{idVendor}=="fffe", ATTRS{idProduct}=="0002", MODE:="0660", GROUP="plugdev"
152 | SUBSYSTEMS=="usb", ATTRS{idVendor}=="2500", ATTRS{idProduct}=="0002", MODE:="0660", GROUP="plugdev"
153 | SUBSYSTEMS=="usb", ATTRS{idVendor}=="2500", ATTRS{idProduct}=="0020", MODE:="0660", GROUP="plugdev"
154 | SUBSYSTEMS=="usb", ATTRS{idVendor}=="2500", ATTRS{idProduct}=="0021", MODE:="0660", GROUP="plugdev"
155 | SUBSYSTEMS=="usb", ATTRS{idVendor}=="2500", ATTRS{idProduct}=="0022", MODE:="0660", GROUP="plugdev"
156 | SUBSYSTEMS=="usb", ATTRS{idVendor}=="3923", ATTRS{idProduct}=="7813", MODE:="0660", GROUP="plugdev"
157 | SUBSYSTEMS=="usb", ATTRS{idVendor}=="3923", ATTRS{idProduct}=="7814", MODE:="0660", GROUP="plugdev"
158 |
159 | # AFEDRI SDR
160 | SUBSYSTEMS=="usb", ATTRS{idVendor}=="255d", ATTRS{idProduct}=="0006", MODE="0660", GROUP="plugdev"
161 | SUBSYSTEMS=="usb", ATTRS{idVendor}=="255d", ATTRS{idProduct}=="0002", MODE="0660", GROUP="plugdev"
162 |
163 | # LimeSDR
164 | SUBSYSTEM=="usb", ATTR{idVendor}=="04b4", ATTR{idProduct}=="8613", MODE="0660", GROUP="plugdev", SYMLINK+="stream-%k"
165 | SUBSYSTEM=="usb", ATTR{idVendor}=="04b4", ATTR{idProduct}=="00f1", MODE="0660", GROUP="plugdev", SYMLINK+="stream-%k"
166 | SUBSYSTEM=="usb", ATTR{idVendor}=="0403", ATTR{idProduct}=="601f", MODE="0660", GROUP="plugdev", SYMLINK+="stream-%k"
167 | SUBSYSTEM=="usb", ATTR{idVendor}=="1d50", ATTR{idProduct}=="6108", MODE="0660", GROUP="plugdev", SYMLINK+="stream-%k"
168 | SUBSYSTEM=="xillybus", MODE="0660", GROUP="plugdev"
169 | SUBSYSTEM=="tty", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6001", MODE="0660", GROUP="plugdev"
170 |
171 | # PlutoSDR
172 | SUBSYSTEM=="usb", ATTRS{idVendor}=="0456", ATTRS{idProduct}=="b672", MODE="0660", GROUP="plugdev"
173 | SUBSYSTEM=="usb", ATTRS{idVendor}=="0456", ATTRS{idProduct}=="b673", MODE="0660", GROUP="plugdev"
174 | SUBSYSTEM=="usb", ATTRS{idVendor}=="0456", ATTRS{idProduct}=="b674", MODE="0660", GROUP="plugdev"
175 | SUBSYSTEM=="usb", ATTRS{idVendor}=="0456", ATTRS{idProduct}=="b675", MODE="0660", GROUP="plugdev"
176 | SUBSYSTEM=="usb", ATTRS{idVendor}=="2fa2", ATTRS{idProduct}=="5a02", MODE="0660", GROUP="plugdev"
177 | SUBSYSTEM=="usb", ATTRS{idVendor}=="2fa2", ATTRS{idProduct}=="5a32", MODE="0660", GROUP="plugdev"
178 | SUBSYSTEM=="usb", ATTRS{idVendor}=="0456", ATTRS{idProduct}=="b672", ENV{ID_MM_DEVICE_IGNORE}="1"
179 | SUBSYSTEM=="usb", ATTRS{idVendor}=="0456", ATTRS{idProduct}=="b673", ENV{ID_MM_DEVICE_IGNORE}="1"
180 | SUBSYSTEM=="usb", ATTRS{idVendor}=="2fa2", ATTRS{idProduct}=="5a02", ENV{ID_MM_DEVICE_IGNORE}="1
181 |
--------------------------------------------------------------------------------
/lsf/LSF-GUIDE.md:
--------------------------------------------------------------------------------
1 | # Guide for LSF satnogs-client with docker compose
2 |
3 | ## Intro
4 | This is aimed for those who want to try out the client in docker and thinks it's a bit too complicated.
5 | I will try to explain the basic concepts and how to get up and running.
6 | My preferred distro is Debian 11 (bullseye) and this guide will be tailored for it, but there should only be small differences to others.
7 |
8 | ## Basic description of Docker
9 | [Official overview](https://docs.docker.com/get-started/overview/)
10 |
11 | ***Images*** are usually hosted on a registry, for example hub.docker.com, from where you can pull them to your system.
12 | They are the complete software bundled to run an application, in this case a debian image and a lot of packages installed that is required for satnogs-client.
13 | ***Container*** is the running instance of an image and is basically an isolated environment where you run the app.
14 | They are always start fresh from the image and can be modified, but it's non-persistent so after a stop any changes are lost.
15 | ***Volumes*** is either a persistent storage for containers or bind-mounted to your host for configuration or storage.
16 |
17 | ***Compose*** This is the main difference from the [old guide](../GUIDE.md), where everything is controlled with the [docker-compose](docker-compose.yml).
18 | In this file all the different services (essentially containers) are specified and all it's settings and relationships between them.
19 | The containers exist on a separate network in this configuration, so rigctld runs in its own container and the satnogs-client talks to it over this network.
20 | What this means is that you don't need a bunch of scripts to start/stop/update everything.
21 | It also means that you don't run several services in the same container.
22 | By default, it creates a stack that is named after the directory the compose file is located in.
23 |
24 | ***Stack*** In this context, is the resulting containers, network, volumes etc. that is created and controlled with compose.
25 |
26 | # Getting satnogs-client up and running
27 | ## Host system
28 | You will need to install the udev rules and blacklists on the host to make sure the devices get the proper permissions.
29 | Additional software such as SoapySDR is not needed on the host, but can certainly be installed or if you already have a working ansible install etc.
30 | Make sure to keep the host clock synchronized, this is absolutely essential and easily solved with ntp.
31 | ```shell
32 | sudo apt install ntp
33 | ```
34 |
35 | The individual sdr packages comes with udev rules and blacklists, but to simplify this and make the permissions the coherent we have compiled a custom list to accomplish this.
36 | It uses the `plugdev` group and mode `0660` on all the devices.
37 | Do note that any installed packages on the host, like rtl-sdr will possibly conflict with these, ymmv.
38 | Basically just copy the [10-satnogs.rules](10-satnogs.rules) to `/etc/udev/rules.d/` and [satnogs-blacklist.conf](satnogs-blacklist.conf) to `/etc/modprobe.d/`
39 | (these are located in the `lsf` directory under this repo)
40 | ```shell
41 | sudo cp 10-satnogs.rules /etc/udev/rules.d/
42 | sudo cp satnogs-blacklist.conf /etc/modprobe.d/
43 | ```
44 | Reboot is the simplest way to apply these, manually doing `rmmod` and `sudo udevadm control --reload-rules && sudo udevadm trigger` also possible.
45 |
46 | ### Docker install
47 | See the [docker installation](#install-dockerio) at the bottom of this page.
48 |
49 | ## Configuration
50 |
51 | Start with creating a directory with a name representing the station, this will be shown in several places in the resulting stack.
52 | It is also separates multiple stations running on the same host.
53 | ```shell
54 | mkdir -p station-351
55 | cd station-351
56 | wget https://github.com/kng/satnogs-client-docker/raw/main/lsf/docker-compose.yml
57 | wget -O station.env https://github.com/kng/satnogs-client-docker/raw/main/lsf/station.env-dist
58 | ```
59 |
60 | The file `station.env` contains all the station variables (earlier in /etc/default/satnogs-client), some of the variables that is important to the function of the stack is located in the compose file.
61 | Use your favourite editor to configure this:
62 | ```shell
63 | nano station.env
64 | ```
65 | Make sure to populate all the lines that are not commented out as these are the important ones.
66 | Also note that the values should not be escaped with quotes or ticks.
67 |
68 | User guide for satnogs-client [configuration](https://docs.satnogs.org/projects/satnogs-client/en/stable/userguide.html#environment-variables).
69 |
70 | ## Bringing the stack up
71 |
72 | The `docker-compose` (on some systems it's `docker compose` without the hyphen) is the program controlling the creation, updating, building and termination of the stack.
73 | The basic commands you will use is `docker-compose up -d` and `docker-compose down`.
74 | When you edit the compose file or configuration it will try to figure out what needs to be done to bring the stack in sync of what has changed.
75 | For example editing the SDR gain, it will recreate and restart the client but not rigctld.
76 |
77 | Starting the stack (and updating after changed config):
78 | ```shell
79 | docker-compose up -d
80 | ```
81 |
82 | Stopping the stack:
83 | ```shell
84 | docker-compose down
85 | ```
86 |
87 | Updating the images and bringing the stack up:
88 | ```shell
89 | docker-compose pull
90 | docker-compose up -d
91 | ```
92 |
93 | Over time there will be old images accumulating, these can be removed with `docker image prune -af`
94 |
95 | ## Monitoring and maintenance
96 |
97 | Inside each container, the logs are output to stdout, which makes them visible from outside the container in the logs.
98 | Starting to monitor the running stack:
99 | ```shell
100 | docker-compose logs -f
101 | ```
102 |
103 | If you want to run commands inside the containers, this can be done with the following command:
104 | ````shell
105 | docker-compose exec satnogs_client bash
106 | ````
107 | The container can be any of the running services, not possible in stopped container thou. Exit with Ctrl-D or typing `exit`.
108 |
109 | # Additional services, experimental and addons
110 | In the [maxed](docker-compose.maxed) yml there's some additional services that can be run, for example rotator and auto-scheduler.
111 | These can be copied in to the [docker-compose.yml](docker-compose.yml) to be activated, do note additions in the section `environment:` in the service satnogs_client needs to be added as well.
112 |
113 | ## Experimental
114 | In the past, the experimental setting switched the station software over to bleeding edge, but the drawback was that you could not go back to stable if there were issues.
115 | This is no longer the case, as these are separated in images and they can easily be switched between as often you like.
116 |
117 | Editing the [docker-compose.yml](docker-compose.yml) and going down to the satnogs_client service, the `image:` key specifies the image used.
118 | In this case simply comment out the stable image and uncomment the unstable, or change to any other tag that might be available in the future.
119 | ````yaml
120 | satnogs_client:
121 | #image: registry.gitlab.com/librespacefoundation/satnogs/satnogs-client/satnogs-client:master # LSF stable docker image
122 | image: registry.gitlab.com/librespacefoundation/satnogs/satnogs-client/satnogs-client:master-unstable # LSF experimental docker image
123 | ````
124 | The available tags you can use is listed on [gitlab registry](https://gitlab.com/librespacefoundation/satnogs/satnogs-client/container_registry/3553292) and on [dockerhub](https://hub.docker.com/r/librespace/satnogs-client/tags), two tags are available today: master and master-unstable.
125 |
Recreate the container with the usual `docker-compose up -d`
126 |
127 | ## Addons
128 | The addons image is documented [here](../addons/README.md), there is a lot more functionality than just the gr-satellites integration.
129 | The gr-satellites integration and addons can be activated by changing the `image:` in the service satnogs_client as seen in the commented lines below the default image.
130 | Two images exist today, `:lsf-addons` which is bases on the stable `:master`, and `:lsf-dev-addons` which is based on experimental `:master-unstable`.
131 | Some additional settings is needed to activate its functionality, simply remove the comment (#) in front of the following lines in `station.env`:
132 | ```
133 | SATNOGS_PRE_OBSERVATION_SCRIPT=satnogs-pre {{ID}} {{FREQ}} {{TLE}} {{TIMESTAMP}} {{BAUD}} {{SCRIPT_NAME}}
134 | SATNOGS_POST_OBSERVATION_SCRIPT=satnogs-post {{ID}} {{FREQ}} {{TLE}} {{TIMESTAMP}} {{BAUD}} {{SCRIPT_NAME}}
135 | UDP_DUMP_HOST=0.0.0.0
136 | ```
137 |
138 | Please note that the -pre/-post scripts need to exist in the image, else observations will fail, so make sure to comment out the above lines if you go back to the default image.
139 |
140 | There is a lot more functionality in the addons, please check out the [repo](https://github.com/kng/satnogs-client-docker/tree/main/addons) for the latest information.
141 |
142 | ## Development and building
143 | TODO, building images, choosing own repos etc.
144 |
145 | ## Multiple stations on one host
146 | TODO, separating the directories by station name, adressning the rtl-sdr by ID.
147 |
148 | # Install Docker.io
149 | If you are using Debian 12 bookworm the installation should be pretty straightforward as the packages are new enough.
150 | ```shell
151 | sudo apt install docker.io apparmor docker-compose
152 | sudo adduser $(whoami) docker
153 | ```
154 |
155 | In Debian 11 bullseye there is a docker package, but compose is too old, so we need to install it from backports:
156 | ```shell
157 | sudo apt install docker.io apparmor
158 | sudo apt -t bullseye-backports install docker-compose
159 | sudo adduser $(whoami) docker
160 | ```
161 | Re-login for the group permission to take effect.
162 |
163 | The reason for using backports is the version of compose in bullseye is 1.25 and lacks cgroup support, the backport is version 1.27
164 |
If your dist doesn't have backports, enable with this, and try the installation of docker-compose again:
165 | ```shell
166 | echo "deb http://deb.debian.org/debian bullseye-backports main contrib non-free" | sudo tee /etc/apt/sources.list.d/backports.list
167 | sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 648ACFD622F3D138 0E98404D386FA1D9
168 | sudo apt update
169 | ```
170 | If you cannot get a good compose version with your dist, please follow [the official guide](https://docs.docker.com/compose/install/linux/#install-the-plugin-manually).
171 | I made a small script to fetch the latest compose and buildx ([YMMV](https://www.urbandictionary.com/define.php?term=ymmv)) [update-docker-cli.sh](../update-docker-cli.sh):
172 | ```shell
173 | wget https://github.com/kng/satnogs-client-docker/raw/main/addons/update-docker-cli.sh
174 | chmod 0755 update-docker-cli.sh
175 | ./update-docker-cli.sh
176 | ```
177 |
178 | ## Recommended install: [Portainer](https://docs.portainer.io/start/install/server/docker/linux)
179 |
180 | ```shell
181 | docker volume create portainer_data
182 | docker run -d \
183 | -p 8000:8000 \
184 | -p 9443:9443 \
185 | --name portainer \
186 | --restart=always \
187 | -v /var/run/docker.sock:/var/run/docker.sock \
188 | -v portainer_data:/data \
189 | portainer/portainer-ce:latest
190 | ```
191 | Then browse to https://127.0.0.1:9443 (change to the correct host on the network) and follow the instruction, use local socket in the "Get started" section.
192 |
193 |
194 | # For reference: Install Docker Engine (docker.com)
195 |
196 | Refer to [docker installation](https://docs.docker.com/engine/install/debian/) on how to get the latest installed on your system.
197 | Short version, ymmv: Base image: Rasperry Pi OS 64bit or 32bit Lite (bullseye):
198 | ```shell
199 | # already installed: ca-certificates curl lsb-release
200 | # optional: tmux uidmap
201 | sudo apt update
202 | sudo apt upgrade -y
203 | sudo apt install -y ca-certificates curl gnupg lsb-release git
204 |
205 | curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /etc/apt/trusted.gpg.d/docker.gpg
206 | echo "deb https://download.docker.com/linux/debian $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
207 |
208 | sudo apt update
209 | sudo apt install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin
210 |
211 | # add user to docker group, avoid needing sudo, re-login to apply
212 | sudo adduser $(whoami) docker
213 | ```
214 |
--------------------------------------------------------------------------------
/lsf/README.md:
--------------------------------------------------------------------------------
1 | # LSF dockerized SatNOGS client
2 |
3 | Please see the [GUIDE](LSF-GUIDE.md) on how to use this.
4 |
--------------------------------------------------------------------------------
/lsf/docker-compose.maxed:
--------------------------------------------------------------------------------
1 | version: '3.8'
2 | services:
3 |
4 | rigctld:
5 | image: librespace/hamlib:latest
6 | user: '999'
7 | read_only: true
8 | environment:
9 | MODEL: '1'
10 | restart: 'unless-stopped'
11 | command: 'rigctld'
12 |
13 | rotctld:
14 | image: librespace/hamlib:latest
15 | user: '999'
16 | read_only: true
17 | environment:
18 | MODEL: '1'
19 | SET_CONF: 'min_az=0,max_az=360,min_el=0,max_el=180'
20 | device_cgroup_rules:
21 | - 'c 188:* rwm'
22 | #devices:
23 | # - '/dev/serial/by-id/usb-Silicon_Labs_CP2102_USB_to_UART_Bridge_Controller_05670031BD0A-if00-port0:/dev/rot0'
24 | # - '/dev/ttyUSB1:/dev/rot0'
25 | restart: 'unless-stopped'
26 | command: 'rotctld'
27 | stop_grace_period: 1s
28 |
29 | gpsd:
30 | image: librespace/satnogs-client:master # Use the same as satnogs_client service
31 | user: '999'
32 | read_only: true
33 | command: 'gpsd -b -N -G /dev/gps0'
34 | device_cgroup_rules:
35 | - 'c 188:* rwm'
36 | #devices:
37 | # - '/dev/serial/by-id/usb-Prolific_Technology_Inc._USB-Serial_Controller_D-if00-port0:/dev/gps0'
38 | # - '/dev/ttyUSB0:/dev/gps0'
39 | restart: 'unless-stopped'
40 | stop_grace_period: 1s
41 |
42 | satnogs_client:
43 | image: librespace/satnogs-client:master # LSF stable docker image
44 | #image: librespace/satnogs-client:master-unstable # LSF experimental docker image
45 | #image: knegge/satnogs-client:lsf-addons # LSF stable + gr-satellites and addons
46 | #image: knegge/satnogs-client:lsf-dev-addons # LSF unstable + gr-satellites and addons
47 | user: '999'
48 | read_only: true
49 | init: true # init is needed when lauching processes in the background
50 | env_file:
51 | - ./station.env
52 | environment:
53 | SATNOGS_RIG_IP: 'rigctld'
54 | SATNOGS_RIG_PORT: '4532'
55 | SATNOGS_ROT_MODEL: 'ROT_MODEL_NETROTCTL'
56 | SATNOGS_ROT_PORT: 'rotctld:4533'
57 | SATNOGS_GPSD_HOST: 'gpsd' # enable GPS in station.env
58 | SATNOGS_GPSD_PORT: '2947'
59 | command: 'satnogs-client' # default
60 | device_cgroup_rules:
61 | - 'c 189:* rwm'
62 | devices:
63 | - '/dev/bus/usb'
64 | volumes:
65 | - type: 'tmpfs'
66 | target: '/tmp'
67 | - type: 'volume'
68 | source: 'satnogs-client'
69 | target: '/var/lib/satnogs-client'
70 | restart: 'unless-stopped'
71 | stop_grace_period: 1s
72 |
73 | auto-scheduler:
74 | # image: librespace/satnogs-auto-scheduler:master
75 | image: registry.gitlab.com/librespacefoundation/satnogs/satnogs-auto-scheduler/satnogs-auto-scheduler:master
76 | user: '999'
77 | command: 'bash -c "while true; do sleep 30; schedule_single_station.py -s $$SATNOGS_STATION_ID $$AUTO_SCHEDULER_EXTRA; sleep 3600; done"'
78 | read_only: true
79 | env_file:
80 | - ./station.env
81 | environment:
82 | CACHE_DIR: '/var/lib/satnogs-client/.cache/auto-scheduler'
83 | depends_on:
84 | - satnogs_client
85 | volumes:
86 | - type: 'tmpfs'
87 | target: '/tmp'
88 | - type: 'volume'
89 | source: 'satnogs-client'
90 | target: '/var/lib/satnogs-client'
91 | restart: unless-stopped # du not use with exiting client as this will just loop
92 | stop_grace_period: 1s
93 |
94 | volumes:
95 | satnogs-client: # persistent named volume for the station
96 |
--------------------------------------------------------------------------------
/lsf/docker-compose.yml:
--------------------------------------------------------------------------------
1 | version: '3.8'
2 | services:
3 |
4 | rigctld:
5 | image: librespace/hamlib:latest
6 | user: '999'
7 | read_only: true
8 | environment:
9 | MODEL: '1'
10 | restart: 'unless-stopped'
11 | command: 'rigctld'
12 |
13 | satnogs_client:
14 | image: librespace/satnogs-client:master # LSF stable docker image
15 | #image: librespace/satnogs-client:master-unstable # LSF experimental docker image
16 | #image: librespace/satnogs-client:lsf-addons # LSF stable + gr-satellites and addons
17 | #image: librespace/satnogs-client:lsf-dev-addons # LSF unstable + gr-satellites and addons
18 | user: '999'
19 | read_only: true
20 | init: true # init is needed when launching processes in the background
21 | env_file:
22 | - ./station.env
23 | environment:
24 | SATNOGS_RIG_IP: 'rigctld'
25 | SATNOGS_RIG_PORT: '4532'
26 | command: 'satnogs-client' # default
27 | device_cgroup_rules:
28 | - 'c 189:* rwm'
29 | devices:
30 | - '/dev/bus/usb'
31 | volumes:
32 | - type: 'tmpfs'
33 | target: '/tmp'
34 | - type: 'volume'
35 | source: 'satnogs-client'
36 | target: '/var/lib/satnogs-client'
37 | restart: 'unless-stopped'
38 | stop_grace_period: 1s
39 |
40 | volumes:
41 | satnogs-client: # persistent named volume for the station
42 |
--------------------------------------------------------------------------------
/lsf/notes.txt:
--------------------------------------------------------------------------------
1 | The docker-compose available in debian bullseye is currently version 1.25, which is too low for the cgroup rules.
2 | install 1.27 via: sudo apt install docker-compose/bullseye-backports
3 | or run install script update-docker-cli.sh in this repo.
4 |
5 | init is required when using gr_satellites etc, otherwise ends up with defunct processes.
6 |
7 | named volume for persitant varstate data between compose down/up instead of creating new ones every time.
8 |
--------------------------------------------------------------------------------
/lsf/satnogs-blacklist.conf:
--------------------------------------------------------------------------------
1 | # MiriSDR
2 | blacklist msi001
3 | blacklist msi2500
4 |
5 | # RTL-SDR
6 | blacklist dvb_usb_rtl28xxu
7 |
8 | # Airspy
9 | blacklist airspy
10 |
11 | # blacklist the v4l hackrf kernel module from the libhackrf0 package
12 | blacklist hackrf
13 |
--------------------------------------------------------------------------------
/lsf/station.env-dist:
--------------------------------------------------------------------------------
1 | SATNOGS_API_TOKEN=
2 | #SATNOGS_DB_API_TOKEN=
3 | #SATNOGS_ARTIFACTS_API_TOKEN=
4 | #SATNOGS_ARTIFACTS_ENABLED=True
5 | SATNOGS_SOAPY_RX_DEVICE=driver=rtlsdr
6 | SATNOGS_ANTENNA=RX
7 | SATNOGS_RX_SAMP_RATE=2.048e6
8 | SATNOGS_PPM_ERROR=0
9 | SATNOGS_RF_GAIN=
10 | SATNOGS_STATION_ELEV=
11 | SATNOGS_STATION_ID=
12 | SATNOGS_STATION_LAT=
13 | SATNOGS_STATION_LON=
14 |
15 | #SATNOGS_LOG_LEVEL=INFO
16 | #SATNOGS_PRE_OBSERVATION_SCRIPT=satnogs-pre {{ID}} {{FREQ}} {{TLE}} {{TIMESTAMP}} {{BAUD}} {{SCRIPT_NAME}}
17 | #SATNOGS_POST_OBSERVATION_SCRIPT=satnogs-post {{ID}} {{FREQ}} {{TLE}} {{TIMESTAMP}} {{BAUD}} {{SCRIPT_NAME}}
18 | #UDP_DUMP_HOST=0.0.0.0
19 |
20 | #SATNOGS_GPSD_CLIENT_ENABLED=True
21 | #SATNOGS_GPSD_TIMEOUT=30
22 | #AUTO_SCHEDULER_EXTRA=-P prio.txt -d 1.2
23 | #GRSAT_KEEPLOGS=True
24 | #DIREWOLF_ENABLE=True
25 | #DIREWOLF_CONF=/var/lib/satnogs-client/direwolf.conf
26 | #ENABLE_IQ_DUMP=True
27 | #IQ_DUMP_FILENAME=/tmp/iq
28 | #IQ_DUMP_RENAME=True
--------------------------------------------------------------------------------
/sa2kng/Dockerfile:
--------------------------------------------------------------------------------
1 | ARG GNURADIO_IMAGE_TAG=3.8.2.0-satnogs
2 | ARG REPO_ROOT=librespace
3 | FROM ${REPO_ROOT}/gnuradio:${GNURADIO_IMAGE_TAG} AS builder
4 |
5 | ARG DEBIAN_FRONTEND=noninteractive
6 | ENV TZ=Etc/UTC
7 |
8 | WORKDIR /usr/local/src/
9 | COPY packages.builder .
10 | RUN apt -y update && \
11 | apt -y upgrade && \
12 | xargs -a packages.builder apt install --no-install-recommends -qy
13 |
14 | ARG GRSATNOGS_URL=https://gitlab.com/librespacefoundation/satnogs/gr-satnogs.git
15 | ARG GRSATNOGS_BRANCH=v2.3.5.0
16 | ARG GRSATNOGS_VER=2.3.5.0-1
17 | ARG FLOWGRAPHS_URL=https://gitlab.com/librespacefoundation/satnogs/satnogs-flowgraphs.git
18 | ARG FLOWGRAPHS_BRANCH=1.5
19 | ARG FLOWGRAPHS_VER=1.5-1
20 | ARG GRSOAPY_URL=https://gitlab.com/librespacefoundation/gr-soapy.git
21 | ARG GRSOAPY_BRANCH=v2.1.3.1
22 | ARG GRSOAPY_VER=2.1.3.1-1
23 | ARG CLIENT_URL=https://gitlab.com/librespacefoundation/satnogs/satnogs-client.git
24 | ARG CLIENT_BRANCH=1.9.2
25 | ARG CLIENT_VER=1.9.2
26 |
27 | RUN git clone --depth 1 --branch "$GRSATNOGS_BRANCH" "$GRSATNOGS_URL"
28 | RUN git clone --depth 1 --branch "$FLOWGRAPHS_BRANCH" "$FLOWGRAPHS_URL"
29 | RUN git clone --depth 1 --branch "$GRSOAPY_BRANCH" "$GRSOAPY_URL"
30 | RUN git clone --depth 1 --branch "$CLIENT_BRANCH" "$CLIENT_URL"
31 |
32 | ARG CMAKE_BUILD_PARALLEL_LEVEL
33 |
34 | ARG RTLSDR_URL
35 | ARG RTLSDR_BRANCH=master
36 | ARG RTLSDR_VER=0.6.0-3satnogs1
37 | RUN if [ -n "$RTLSDR_URL" ]; then \
38 | git clone --depth 1 --branch "$RTLSDR_BRANCH" "$RTLSDR_URL" rtl-sdr && \
39 | cd rtl-sdr && \
40 | dch -m -b --distribution unstable -v $RTLSDR_VER Upstream master && \
41 | DEB_BUILD_OPTIONS=noautodbgsym dpkg-buildpackage -b -us -uc && \
42 | dpkg -i ../rtl-sdr_*.deb ../librtlsdr0_*.deb ;\
43 | fi
44 |
45 | RUN cd gr-soapy && \
46 | dch -m -b --distribution unstable -v $GRSOAPY_VER Upstream master && \
47 | DEB_BUILD_OPTIONS=noautodbgsym dpkg-buildpackage -b -us -uc && \
48 | dpkg -i ../gr-soapy_*.deb ../libgnuradio-soapy_*.deb
49 |
50 | RUN cd gr-satnogs && \
51 | dch -m -b --distribution unstable -v $GRSATNOGS_VER Upstream master && \
52 | DEB_BUILD_OPTIONS=noautodbgsym dpkg-buildpackage -b -us -uc && \
53 | dpkg -i ../gr-satnogs_*.deb ../libgnuradio-satnogs_*.deb
54 |
55 | RUN cd satnogs-flowgraphs && \
56 | dch -m -b --distribution unstable -v $FLOWGRAPHS_VER Upstream master && \
57 | DEB_BUILD_OPTIONS=noautodbgsym dpkg-buildpackage -b -us -uc && \
58 | dpkg -i ../satnogs-flowgraphs_*.deb
59 |
60 | ARG UHD_URL
61 | RUN if [ -n "$UHD_URL" ]; then \
62 | dget -q -u "$UHD_URL" &&\
63 | cd uhd-* &&\
64 | DEB_BUILD_OPTIONS=noautodbgsym dpkg-buildpackage -b -us -uc --build=binary &&\
65 | cd .. &&\
66 | rm -f libuhd*dpdk* libuhd-dev* uhd-doc* &&\
67 | dpkg -i uhd-host_*.deb libuhd*.deb ;\
68 | fi
69 |
70 | RUN --mount=type=cache,id=debs,target=/debs \
71 | mkdir -p /debs/$(dpkg --print-architecture)/ && \
72 | rm -f /debs/$(dpkg --print-architecture)/* && \
73 | cp *.deb /debs/$(dpkg --print-architecture)/
74 |
75 | ARG MPLSETUPCFG=/etc/mplsetup.cfg
76 | RUN --mount=type=cache,id=wheels,target=/wheels \
77 | printf "[libs]\nsystem_freetype = true" > $MPLSETUPCFG && \
78 | printf "[global]\nextra-index-url=https://www.piwheels.org/simple" > /etc/pip.conf && \
79 | rm -f /wheels/satnogs* && \
80 | pip3 install --upgrade pip setuptools wheel ujson --find-links=/wheels --prefer-binary && \
81 | pip3 wheel -w /wheels --find-links=/wheels --prefer-binary \
82 | -r ./satnogs-client/requirements.txt \
83 | ./satnogs-client
84 |
85 |
86 | ARG GNURADIO_IMAGE_TAG=satnogs
87 | ARG REPO_ROOT=librespace
88 | FROM ${REPO_ROOT}/gnuradio:${GNURADIO_IMAGE_TAG} AS runner
89 | LABEL org.opencontainers.image.authors="Daniel Ekman "
90 |
91 | ARG DEBIAN_FRONTEND=noninteractive
92 | ENV TZ=Etc/UTC
93 |
94 | # make this depend on builder
95 | COPY --from=builder /etc/pip.conf /etc
96 |
97 | # Install deb packages from builder and optional repo
98 | ARG OBS_REPO
99 | COPY packages.client /usr/local/src/
100 | RUN --mount=type=cache,id=debs,target=/debs \
101 | if [ -n "${OBS_REPO}" ]; then \
102 | echo "deb ${OBS_REPO} /" > /etc/apt/sources.list.d/obs_repo.list &&\
103 | apt-key adv --fetch-keys "${OBS_REPO}/Release.key"; \
104 | fi &&\
105 | apt -y update && \
106 | apt -y upgrade && \
107 | xargs -a /usr/local/src/packages.client apt install -qy python3-pip && \
108 | apt install -qy --allow-downgrades /debs/$(dpkg --print-architecture)/*.deb && \
109 | apt -y autoremove && \
110 | rm -rf /var/lib/apt/lists/*
111 |
112 | # Install python packages from builder
113 | RUN --mount=type=cache,id=wheels,target=/wheels \
114 | pip3 install --no-cache --find-links=/wheels --no-index satnogs-client
115 |
116 | ARG SATNOGS_CLIENT_UID=999
117 | ARG SATNOGS_CLIENT_VARSTATEDIR=/var/lib/satnogs-client
118 |
119 | # Add unprivileged system user
120 | RUN groupadd -r -g ${SATNOGS_CLIENT_UID} satnogs-client \
121 | && useradd -r -u ${SATNOGS_CLIENT_UID} \
122 | -g satnogs-client \
123 | -d ${SATNOGS_CLIENT_VARSTATEDIR} \
124 | -s /bin/false \
125 | -G audio,dialout,plugdev \
126 | satnogs-client
127 |
128 | # Create application varstate directory
129 | RUN install -d -o ${SATNOGS_CLIENT_UID} -g ${SATNOGS_CLIENT_UID} ${SATNOGS_CLIENT_VARSTATEDIR}
130 |
131 | # Restore permissions on satyaml dir
132 | RUN chown -R satnogs-client:satnogs-client /usr/lib/python3/dist-packages/satellites/satyaml
133 |
134 | ARG UHD_URL
135 | RUN if [ -n "$UHD_URL" ]; then \
136 | uhd_images_downloader -q ;\
137 | fi
138 |
139 | WORKDIR $SATNOGS_CLIENT_VARSTATEDIR
140 |
141 |
--------------------------------------------------------------------------------
/sa2kng/Dockerfile.obs:
--------------------------------------------------------------------------------
1 | ARG IMAGE_TAG=master
2 | ARG REPO_ROOT=librespace
3 | FROM ${REPO_ROOT}/satnogs-client:${IMAGE_TAG}
4 |
5 | ARG OBS_REPO=http://download.opensuse.org/repositories/home:/librespace:/satnogs-unstable/Debian_11/
6 | RUN echo "deb ${OBS_REPO} /" > /etc/apt/sources.list.d/obs_repo.list &&\
7 | apt-key adv --fetch-keys "${OBS_REPO}Release.key" &&\
8 | apt -y update &&\
9 | apt -y upgrade &&\
10 | apt -y autoremove &&\
11 | rm -r /var/lib/apt/lists/*
12 | RUN chown -R satnogs-client:satnogs-client /usr/lib/python3/dist-packages/satellites/satyaml
13 |
--------------------------------------------------------------------------------
/sa2kng/README.md:
--------------------------------------------------------------------------------
1 | # The SA2KNG collection of branches
2 |
3 | ## Intro
4 | This is intended to be a collection image of my work that has not yet been merged into upstream.
5 | It is based on the [gnuradio](https://gitlab.com/librespacefoundation/docker-gnuradio) image and critical packages are rebuilt and installed.
6 | The current list of repos is set in [build.sh](build.sh) and consists of gr-satnogs, gr-soapy, satnogs-flowgraphs and satnogs-client.
7 |
8 | ## Building
9 | To build the image, run: `./build.sh`
10 | To build the addons on top of that, run `./build-addons.sh`
11 | These will build and tag the images `knegge/satnogs-client:sa2kng` and `knegge/satnogs-client:sa2kng-addons` respectively, this can be changed in the build scripts.
12 |
13 | To use these, refer to the main [LSF-GUIDE](../lsf/LSF-GUIDE.md). Change the image tag under `satnogs_client:` service in the `docker-compose.yml`.
14 |
--------------------------------------------------------------------------------
/sa2kng/build-addons.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | export DOCKER_BUILDKIT=1
3 | TAG="sa2kng-addons"
4 | REPO_ROOT="knegge"
5 | SATNOGS_IMAGE_TAG="sa2kng"
6 |
7 | ARGS=" --build-arg SATNOGS_IMAGE_TAG=${SATNOGS_IMAGE_TAG}"
8 | ARGS+=" --build-arg REPO_ROOT=${REPO_ROOT}"
9 | #ARGS+=" --build-arg CMAKE_BUILD_PARALLEL_LEVEL=8"
10 |
11 | docker build \
12 | -t ${REPO_ROOT}/satnogs-client:${TAG} \
13 | ${ARGS} \
14 | ../addons "$@"
15 |
--------------------------------------------------------------------------------
/sa2kng/build-obs.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | # Base image repo and tag
4 | REPO_ROOT="knegge"
5 | IMAGE_TAG="lsf-addons"
6 |
7 | # Resulting image tag
8 | TAG="obs"
9 |
10 | ARGS=" --build-arg IMAGE_TAG=${IMAGE_TAG}"
11 | ARGS+=" --build-arg REPO_ROOT=${REPO_ROOT}"
12 | ARGS+=" --build-arg OBS_REPO=https://download.opensuse.org/repositories/home:/knegge:/branches:/home:/librespace:/satnogs-unstable/Debian_11/"
13 |
14 | docker build \
15 | -t ${REPO_ROOT}/satnogs-client:${TAG} \
16 | -f Dockerfile.obs \
17 | ${ARGS} \
18 | . "$@"
19 |
--------------------------------------------------------------------------------
/sa2kng/build.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | export DOCKER_BUILDKIT=1
3 | TAG="sa2kng"
4 | REPO_ROOT="knegge"
5 | GNURADIO_IMAGE_TAG="3.8.2.0-satnogs"
6 |
7 | ARGS=" --build-arg GNURADIO_IMAGE_TAG=${GNURADIO_IMAGE_TAG}"
8 | ARGS+=" --build-arg GRSATNOGS_URL=https://gitlab.com/knegge/gr-satnogs.git"
9 | ARGS+=" --build-arg GRSATNOGS_BRANCH=${TAG}"
10 | ARGS+=" --build-arg GRSATNOGS_VER=2.3.5.0+2+${TAG}"
11 | ARGS+=" --build-arg GRSOAPY_URL=https://gitlab.com/knegge/gr-soapy.git"
12 | ARGS+=" --build-arg GRSOAPY_BRANCH=${TAG}"
13 | ARGS+=" --build-arg GRSOAPY_VER=2.1.3.1+2+${TAG}"
14 | ARGS+=" --build-arg FLOWGRAPHS_URL=https://gitlab.com/knegge/satnogs-flowgraphs.git"
15 | ARGS+=" --build-arg FLOWGRAPHS_BRANCH=${TAG}"
16 | ARGS+=" --build-arg FLOWGRAPHS_VER=1.5+2+${TAG}"
17 | ARGS+=" --build-arg CLIENT_URL=https://gitlab.com/knegge/satnogs-client.git"
18 | ARGS+=" --build-arg CLIENT_BRANCH=${TAG}"
19 | #ARGS+=" --build-arg RTLSDR_URL=https://github.com/osmocom/rtl-sdr.git"
20 | #ARGS+=" --build-arg RTLSDR_BRANCH=master"
21 | #ARGS+=" --build-arg RTLSDR_VER=0.6.0+2+${TAG}"
22 | #ARGS+=" --build-arg UHD_URL=http://archive.ubuntu.com/ubuntu/pool/universe/u/uhd/uhd_4.1.0.5-3.dsc"
23 | #ARGS+=" --build-arg OBS_REPO=https://download.opensuse.org/repositories/home:/knegge:/branches:/home:/librespace:/satnogs-unstable/Debian_11/"
24 | #ARGS+=" --build-arg REPO_ROOT=${REPO_ROOT}"
25 | #ARGS+=" --build-arg CMAKE_BUILD_PARALLEL_LEVEL=8"
26 |
27 | docker build \
28 | -t ${REPO_ROOT}/satnogs-client:${TAG} \
29 | ${ARGS} \
30 | . "$@"
31 |
--------------------------------------------------------------------------------
/sa2kng/packages.builder:
--------------------------------------------------------------------------------
1 | build-essential
2 | cmake
3 | debhelper
4 | devscripts
5 | dh-python
6 | doxygen
7 | doxygen-latex
8 | gfortran
9 | git
10 | gnuradio-dev
11 | libboost-date-time-dev
12 | libboost-dev
13 | libboost-filesystem-dev
14 | libboost-program-options-dev
15 | libboost-python-dev
16 | libboost-regex-dev
17 | libboost-serialization-dev
18 | libboost-system-dev
19 | libboost-test-dev
20 | libboost-thread-dev
21 | libconfig++-dev
22 | libdistro-info-perl
23 | libdpdk-dev
24 | libfreetype6-dev
25 | libgmp-dev
26 | libgps-dev
27 | libhdf5-103
28 | libhdf5-dev
29 | libitpp-dev
30 | libncurses5-dev
31 | liborc-0.4-dev
32 | liborc-0.4-dev-bin
33 | libpng++-dev
34 | libsoapysdr-dev
35 | libudev-dev
36 | libusb-1.0-0-dev
37 | libvorbis-dev
38 | ninja-build
39 | nlohmann-json3-dev
40 | pkg-config
41 | python3-all
42 | python3-dev
43 | python3-gps
44 | python3-libhamlib2
45 | python3-pip
46 | python3-six
47 | python3-soapysdr
48 | python3-virtualenv
49 | swig
50 | unzip
51 | virtualenv
52 |
--------------------------------------------------------------------------------
/sa2kng/packages.client:
--------------------------------------------------------------------------------
1 | git
2 | gnupg
3 | gnuradio
4 | jq
5 | libhamlib-utils
6 | libhdf5-103
7 | libitpp8v5
8 | libpng16-16
9 | lsb-release
10 | python3-construct
11 | python3-gps
12 | python3-libhamlib2
13 | python3-pil
14 | python3-pip
15 | python3-requests
16 | python3-six
17 | python3-soapysdr
18 | python3-virtualenv
19 | rtl-sdr
20 | soapysdr-module-all
21 | soapysdr-tools
22 | unzip
23 | virtualenv
24 | vorbis-tools
25 | wget
26 |
--------------------------------------------------------------------------------
/update-docker-cli.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | set -eu
3 | DOCKER_CONFIG=${DOCKER_CONFIG:-$HOME/.docker}
4 | BUILDX_VER=$(git ls-remote --sort -v:refname --tags https://github.com/docker/buildx.git|head -n 1|sed 's/^.*tags\///g'|sed 's/[^[:alnum:]+._-]//g')
5 | COMPOSE_VER=$(git ls-remote --sort -v:refname --tags https://github.com/docker/compose.git|head -n 1|sed 's/^.*tags\///g'|sed 's/[^[:alnum:]+._-]//g')
6 |
7 |
8 | case $(dpkg --print-architecture) in
9 | arm64)
10 | BUILDX_URL="https://github.com/docker/buildx/releases/download/$BUILDX_VER/buildx-$BUILDX_VER.linux-arm64"
11 | COMPOSE_URL="https://github.com/docker/compose/releases/download/$COMPOSE_VER/docker-compose-linux-aarch64"
12 | ;;
13 | armhf)
14 | BUILDX_URL="https://github.com/docker/buildx/releases/download/$BUILDX_VER/buildx-$BUILDX_VER.linux-arm-v7"
15 | COMPOSE_URL="https://github.com/docker/compose/releases/download/$COMPOSE_VER/docker-compose-linux-armv7"
16 | ;;
17 | amd64)
18 | BUILDX_URL="https://github.com/docker/buildx/releases/download/$BUILDX_VER/buildx-$BUILDX_VER.linux-amd64"
19 | COMPOSE_URL="https://github.com/docker/compose/releases/download/$COMPOSE_VER/docker-compose-linux-x86_64"
20 | ;;
21 | *)
22 | echo "Unknown architecture, exiting."
23 | exit 1
24 | ;;
25 | esac
26 |
27 | echo "Updating docker compose to $COMPOSE_VER and buildx to $BUILDX_VER in $DOCKER_CONFIG ..."
28 | mkdir -p "$DOCKER_CONFIG/cli-plugins"
29 | rm -f "$DOCKER_CONFIG/cli-plugins/docker-buildx" "$DOCKER_CONFIG/cli-plugins/docker-compose"
30 |
31 | curl --progress-bar -SL "$BUILDX_URL" -o "$DOCKER_CONFIG/cli-plugins/docker-buildx"
32 | curl --progress-bar -SL "$COMPOSE_URL" -o "$DOCKER_CONFIG/cli-plugins/docker-compose"
33 |
34 | chmod 0755 "$DOCKER_CONFIG/cli-plugins/docker-buildx" "$DOCKER_CONFIG/cli-plugins/docker-compose"
35 |
36 | docker buildx version
37 | docker compose version
38 |
--------------------------------------------------------------------------------