cropinghigh / stdcdec

Open-source inmarsat-C cli decoder, based on inmarsatc library.
GNU General Public License v3.0
15 stars 6 forks source link

(Question/Help) Receiver and Demod setup #4

Closed alphafox02 closed 2 years ago

alphafox02 commented 2 years ago

I’ve previously been successful in receiving data using a wine appimage and scytale-c at least as far as the demod piece and data getting over to the UI - however due to a think sql and wine issues the actual messages were not parsed/displayed.

It appears with this project I can replace all of that. I just maybe need a little better understanding of the low/high/center freq settings and if that somehow correlates to what I have set in gqrx. You’ll see in this picture I’m using SDR++, but I was also using gqrx and sending over udp to your application. I’ve just gotten started so I’m sure I’m not doing something right, so far I’ve not seen any indication of information being passed between windows. Any help with initial setup would be much appreciated.

393820E9-B743-492A-8EF7-34AA40AE2820

cropinghigh commented 2 years ago

My demodulator's frequency adjusting is quite bad, so center frequency setting needs to be precise enough. Low/high frequencies is just bounds, where demodulator will be able to move in search of the signal. And, as far as i know, inmarsat signal on 1537... does not contain any messages, only service data. To see it, add "--print-all-packets" to the parser arguments. To check decoding results(raw frames), add "--verbose" to decoder arguments. SDR++ module version of demodulator is under development currently.

alphafox02 commented 2 years ago

I'll give it another try this weekend. I believe I had a different center freq plugged in when I had GQRX. In both cases, it's cutoff in the image, I had print all packets and verbose on, didn't see anything come up. For the center freq, can I define it in more detail then just "1537"? I'll have to look at the source code again and see what the argument is accepting.

That's great to hear about a potential SDR++ module in the works. I'm wanting to put your application in DragonOS.

cropinghigh commented 2 years ago

I think you've understood "center frequency" wrong. It is not the actual signal frequency in MHz, but center frequency of the signal in the audio band in Hz

alphafox02 commented 2 years ago

I for sure did, thank you for putting me on the right track.

alphafox02 commented 2 years ago

I used scytale-c to help me figure out the audio center freq, was in the 1800s. Receiving messages now and maybe this should be a separate ticket, but I'll see if it does it again. So far it's happened maybe a few time to the parser window with --print-all-packets and --verbose on.

  unknown1Hex: 
      0000�0�

terminate called after throwing an instance of 'nlohmann::detail::type_error' what(): [json.exception.type_error.316] invalid UTF-8 byte at index 9: 0x8A Aborted (core dumped)

cropinghigh commented 2 years ago

Can you please send a full stack trace?

alphafox02 commented 2 years ago

Sure, do I need to compile the program differently to provide the full trace? Besides what I pasted there was just the actual parsed message. I’ll set it up and let it run again this weekend.

Edit: Will running it with gdb help?

alphafox02 commented 2 years ago

Compiled normal, but ran with gdb

`packet:
type: Individual Poll (a3) frameNumber: 118a timestamp: Sat Jul 23 06:46:39 2022 decodingStage: partial packetLength: 28 payload: no packetVars: lesId: 21 lesName: 21, Unknown mesId: 6133311 sat: 0 satName: Atlantic Ocean Region West (AOR-W) shortMessage: POLESTAR
unknown1Hex: 00 0 0@0�0�

terminate called after throwing an instance of 'nlohmann::detail::type_error' what(): [json.exception.type_error.316] invalid UTF-8 byte at index 9: 0x8A

Program received signal SIGABRT, Aborted. __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50 50 ../sysdeps/unix/sysv/linux/raise.c: No such file or directory. `

alphafox02 commented 2 years ago

I'm not sure how to build with debugging symbols in cpp, I tried going in to /stdcdec/build/CMakeFiles/stdc_parser.dir and adding a -g to the flags.txt file and rebuilding but I'm not sure if that's right.

cropinghigh commented 2 years ago

Use -DCMAKE_BUILD_TYPE=Debug in cmake options, this will add debugging symbols. In gdb, after SIGABRT, enter "bt" and give me results.

alphafox02 commented 2 years ago

Program received signal SIGABRT, Aborted. __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50 50 ../sysdeps/unix/sysv/linux/raise.c: No such file or directory. (gdb) bt

0 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50

1 0x00007ffff7b88859 in __GI_abort () at abort.c:79

2 0x00007ffff7e11911 in ?? () from /lib/x86_64-linux-gnu/libstdc++.so.6

3 0x00007ffff7e1d38c in ?? () from /lib/x86_64-linux-gnu/libstdc++.so.6

4 0x00007ffff7e1d3f7 in std::terminate() () from /lib/x86_64-linux-gnu/libstdc++.so.6

5 0x00007ffff7e1d6a9 in __cxa_throw () from /lib/x86_64-linux-gnu/libstdc++.so.6

6 0x00005555555713ee in nlohmann::detail::serializer<nlohmann::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits, std::allocator >, bool, long, unsigned long, double, std::allocator, nlohmann::adl_serializer, std::vector<unsigned char, std::allocator > > >::dump_escaped (this=0x7fffffffd520,

s="0\000\060\t0_0\000\060\212\060@", ensure_ascii=false) at /home/dragon/stdcdec/json.hpp:15939

7 0x000055555556e238 in nlohmann::detail::serializer<nlohmann::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits, std::allocator >, bool, long, unsigned long, double, std::allocator, nlohmann::adl_serializer, std::vector<unsigned char, std::allocator > > >::dump (this=0x7fffffffd520,

val=..., pretty_print=false, ensure_ascii=false, indent_step=0, current_indent=0)
at /home/dragon/stdcdec/json.hpp:15676

8 0x000055555556dd94 in nlohmann::detail::serializer<nlohmann::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits, std::allocator >, bool, long, unsigned long, double, std::allocator, nlohmann::adl_serializer, std::vector<unsigned char, std::allocator > > >::dump (this=0x7fffffffd520,

val=..., pretty_print=false, ensure_ascii=false, indent_step=0, current_indent=0)
at /home/dragon/stdcdec/json.hpp:15606

9 0x000055555556dc1f in nlohmann::detail::serializer<nlohmann::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits, std::allocator >, bool, long, unsigned long, double, std::allocator, nlohmann::adl_serializer, std::vector<unsigned char, std::allocator > > >::dump (this=0x7fffffffd520,

val=..., pretty_print=false, ensure_ascii=false, indent_step=0, current_indent=0)
at /home/dragon/stdcdec/json.hpp:15596

10 0x000055555556b81d in nlohmann::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits, std::allocator >, bool, long, unsigned long, double, std::allocator, nlohmann::adl_serializer, std::vector<unsigned char, std::allocator > >::dump (this=0x7fffffffd810, indent=-1, indent_char=32 ' ',

ensure_ascii=false, error_handler=nlohmann::detail::error_handler_t::strict)
at /home/dragon/stdcdec/json.hpp:18673

11 0x0000555555566f6c in main (argc=5, argv=0x7fffffffdfb8) at /home/dragon/stdcdec/stdc_parser.cpp:544

(gdb)

cropinghigh commented 2 years ago

1990653 this should fix it

alphafox02 commented 2 years ago

Excellent, I’ll rebuild and retest shorty. One other question, then I should probably close this ticket. What’s the best way to determine audio center freq? Now I’m using scytale-c to cheat and find what it says is good, but there must be some better way that I just am not understanding yet.

cropinghigh commented 2 years ago

Unfortunately, currently only ways are to use external software with audio FFT or to look at the frequency receiver tuned to and actual signal center frequency and substract them to get audio center freq.

alphafox02 commented 2 years ago

I think I have a good solution with SigDigger. I can use it to feed your demod tool and it gives me the audio offset! 6C5C4967-3BB5-4D44-AA0B-BD40E69A585D