Commit Graph

1137 Commits

Author SHA1 Message Date
Vasil Velichkov 6eea94f7de Fix grcc compilation with python3 by adding local subdirs to __path__
As the directory structure in the repository is different then the one
after the package gets installed we need to add those subdirectories to
the __path__ otherwise python3 is not able to load the modules using the
relative import syntax and grcc compilation and some unit tests fail.

Mofiy __path__ only when the CMAKE_BINARY_DIR environment variable is
present.

Revert "grgsm_livemon: Set cell_allocation to [0]"

This reverts commit 013d4c258c6ad31c2581f0caa4eee3aa609fd9de.

Change-Id: I223fd6181e8e36027039301186b671712a597ff8
2021-05-03 07:14:00 +02:00
Vasil Velichkov 783a1f7b56 Remove the RTLD_GLOBAL hack
It was removed from gnuradio back in 2014
39f14138ac

Change-Id: I1604ad5b9eefe3d4a2228b2a09e2069962844c97
2021-05-03 07:14:00 +02:00
Vasil Velichkov 5e0ea65121 travis: gnuradio-companion 3.8 does not have --version parameter
And currently grgsm, gr-osmosdr and gr-iqbal are installed in
/usr/local/lib/python3/dist-packages/ which is not in the default python
search path.

Change-Id: I7e00c84a4b72e9fa1dcf5ac453882f1733724ac0
2021-05-03 07:14:00 +02:00
Vasil Velichkov 9feb7da807 grgsm_decode: Print frequency or ARFCN message on stderr
For some yet unknown reasons in travis on Debian testing and Kali rolling
the message gets printed after the burst and decode.sh and decrypt.sh
tests fails because of this.

Instead of filtering this messages in the tests I think it is better
such messages to be printed on the standard error output

Change-Id: Ib18be898cac74769cabf1b748e40e21d23f08e98
2021-05-03 07:14:00 +02:00
Vasil Velichkov fc10d03390 grgsm_livemon: Specify localhost as string
Traceback (most recent call last):
  File "/home/vasko/gr38/lib/python3.7/dist-packages/gnuradio/grc/core/FlowGraph.py", line 216, in renew_namespace
    value = eval(parameter_block.params['value'].to_code(), namespace)
  File "<string>", line 1, in <module>
NameError: name 'localhost' is not defined

Change-Id: I6bae2fb1f09038cb0cd3410533d3b3fdc79ed354
2021-05-03 07:14:00 +02:00
Vasil Velichkov 88c2925d46 grgsm_livemon: Set cell_allocation to [0]
Gnuradio 3.8 does not like cell_allocation: '[arfcn.downlink2arfcn(fc)]'
and the Receiver block does not work with an empty cell allocation array

gnuradio.grc.core.platform:["Param - Cell allocation(cell_allocation):\n\tExpression None is invalid for type'float_vector'."]

Change-Id: Iae6de844509b13bdf834c9c7443382b1ab3b0a28
2021-05-03 07:14:00 +02:00
Vasil Velichkov 165288c464 grgsm_livemon: Fix UDP client and server blocks
During the convertion to YAML the block types was changed
from TCP to UDP

Change-Id: I542d7c36c30dc8179fa0ee84fc87e134cd2ba9f5
2021-05-03 07:14:00 +02:00
Vasil Velichkov cb1109851c grgsm_livemon: Change the type of several parameters to string
It seems gnuradio 3.8 does not like parameters with type None and does
not put them as command line arguments

Change-Id: Id67e37e826aa1cc14640d57207a92def682f11e3
2021-05-03 07:14:00 +02:00
Vasil Velichkov f8f25b8694 grgsm_livemon: Disable PPS sync
Because of the following error when used with USRP B100

[INFO] [MULTI_USRP]     1) catch time transition at pps edge
Traceback (most recent call last):
  File "./grgsm_livemon.py", line 365, in <module>
    main()
  File "./grgsm_livemon.py", line 343, in main
    tb = top_block_cls(fc=options.fc, gain=options.gain, osr=options.osr, ppm=options.ppm, samp_rate=options.samp_rate, shiftoff=options.shiftoff)
  File "./grgsm_livemon.py", line 114, in __init__
    self.rtlsdr_source_0.set_time_unknown_pps(osmosdr.time_spec_t())
  File "/home/vasko/gr38/lib/python3.7/dist-packages/osmosdr/osmosdr_swig.py", line 2543, in set_time_unknown_pps
    return _osmosdr_swig.source_sptr_set_time_unknown_pps(self, time_spec)
RuntimeError: RuntimeError: Board 0 may not be getting a PPS signal!
No PPS detected within the time interval.
See the application notes for your device.

Change-Id: Iee6124bdb2441666a53ac9ee5239894aea61dfde
2021-05-03 07:14:00 +02:00
Vasil Velichkov c00008fa7b travis: Manually install gr-iqbal and gr-osmosdr
Currently these two packages still depends on gnuradio 3.8 in debian
testing and kali rolling.

Change-Id: I4f956577293c48d803b8b45d06ba508792501274
2021-05-03 07:14:00 +02:00
Vasil Velichkov fc99ad4258 travis: Install only python3 packages
Change-Id: I3548fa7340afc63557cc65a7a396ecf96c607806
2021-05-03 07:14:00 +02:00
Vasil Velichkov 386dddb620 Convert grgsm_livemon and grgsm_livemon_headless to YAML
Convert by opening them in gnuradio-companion 3.8.0.0 (Python 3.7.4)
and then File -> Save As under different name without any other
modifications

Change-Id: I73023fc66d1ffd6c714a0610962c005395dc126b
2021-05-03 07:14:00 +02:00
Vasil Velichkov 46c90bec99 Various python3 related changes
- Use relative import for grgsm's modules
- Convert map to list
- Remove the hier_block.py workaround as as gnuradio 3.7 is no longer
  supported in this branch

Change-Id: I5ca8fd340823996e8c444aaf18ddacd85c92ab1c
2021-05-03 07:14:00 +02:00
Vasil Velichkov 333027f406 travis: Test only on distributions with gnuradio 3.8
Change-Id: I05706496687bff2dc4e9a111d8ecd4f878b53c12
2021-05-03 07:14:00 +02:00
Vasil Velichkov 14ea82d227 Migrate grc blocks from xml to yaml
Convert the blocks using cmdline_converter.py script from
c861a840e3/cmdline_converter.py

Change-Id: Iee5c611a2e100bd2fdf487611a867dc937d8c292
2021-05-03 07:14:00 +02:00
Vasil Velichkov 1789ae28ee GNU Radio 3.8 support
https://wiki.gnuradio.org/index.php/GNU_Radio_3.8_OOT_Module_Porting_Guide

Change-Id: I23dd638c8c48ed0a4b50559ce33fbd5e60b7dcbc
2021-05-03 07:14:00 +02:00
Vasil Velichkov fa184a9447 Fix uplink sub_slot and sub_types assignment in the sdcch4 and bcch_ccch demappers blocks
Add support for RACH bursts although they are not yet supported in the
receiver and control channel decoder blocks.

3GPP TS 45.002 version 15.1.0 Release 15
Table 3 : Mapping of logical channels onto physical channels (see subclauses 6.3, 6.4, 6.5)
Figure 8a: TDMA frame mapping for FCCH + SCH + BCCH + CCCH

Fixes the following tests:
qa_gsm_bcch_ccch_demapper.test_uplink
qa_gsm_bcch_ccch_sdcch4_demapper.test_uplink

Change-Id: Ia6b3070c1085bcdda6d98fd94a89c6e0982e2aec
2019-07-29 21:12:24 +03:00
Vasil Velichkov c895bf2f22 Fix uplink sub_slot assignment in the sdcch8 demapper block
3GPP TS 45.002 version 15.1.0 Release 15
Table 4 : Mapping of logical channels onto physical channels (see subclauses 6.3, 6.4, 6.5)

Fixes qa_gsm_sdcch8_demapper.test_uplink test

Change-Id: I29e9055805c8478010c51ceb40f86ba3aed5ecab
2019-07-29 21:12:24 +03:00
Vasil Velichkov 4954ae6fbf Fix sub_slot assignment in the universal_ctrl_chans_demapper block
3GPP TS 45.002 version 15.1.0 Release 15
Table 3 : Mapping of logical channels onto physical channels (see subclauses 6.3, 6.4, 6.5)
Table 4 : Mapping of logical channels onto physical channels (see subclauses 6.3, 6.4, 6.5)

Fixes the following tests:
qa_gsm_bcch_ccch_sdcch4_demapper.test_downlink
qa_gsm_sdcch8_demapper.test_downlink

Change-Id: Idc63407694fd1f7be962ab630d4e8c13b4a5d348
2019-07-29 21:12:24 +03:00
Vasil Velichkov ff88ba41ec Add control channels demappers tests
3GPP TS 45.002 version 15.1.0 Release 15
Table 3 : Mapping of logical channels onto physical channels (see subclauses 6.3, 6.4, 6.5)
Table 4 : Mapping of logical channels onto physical channels (see subclauses 6.3, 6.4, 6.5)
Figure 8a: TDMA frame mapping for FCCH + SCH + BCCH + CCCH
Figure 8b: TDMA frame mapping for FCCH + SCH + BCCH + CCCH + SDCCH/4(0...3) + SACCH/4(0...3)

Five of the six tests currently fail and are marked with
@unittest.expectedFailure. Fixes in subsequent commits.

Change-Id: I33b0948832a0c2506bffd389cc134c3236c74d27
2019-07-29 21:09:07 +03:00
Vasil Velichkov 54580d148d Filter out SoapyAudio devices
When gr-osmosdr is compiled with SoapySDR support and SoapyAudio is
installed the audio device is picked as a first choice when detecting
devices but grgsm tools are not able to work with audio devices. So in
such cases the user has to always specify the correct SDR device in the
args parameter which is a bit inconvenient.

When args is not specified call osmosdr.device_find to get all devices
and filter out unspported ones like SoapyAudio devices. When args is
specifed just try to create osmosdr.source with whatever value has been
specified.

Add -l and --list-devices command line option that prints information
about all detected devices.

Example commands:
  grgsm_capture --list-devices
  grgsm_capture --list-devices --args=nofake
  grgsm_capture --args=uhd,type=b210 -a 111 capture.cfile
  grgsm_livemon --args=rtl
  grgsm_livemon --args=uhd,type=b210

Change-Id: Ib84081041ca6c2bc18b9da0c32bac9d3ecef65ca
2019-05-03 00:20:34 +03:00
Vasil Velichkov 61e42c849d grgsm_capture: Fix device arguments
We need a space between numchan=1 and the rest of the device arguments
otherwise when --args is specified it fails with RuntimeError: bad lexical cast

$ grgsm_capture --args=soapy

Traceback (most recent call last):
  File "/usr/local/bin/grgsm_capture", line 179, in <module>
    device_args=options.device_args)
  File "/usr/local/bin/grgsm_capture", line 57, in __init__
    osmosdr.source(args="numchan=1" + device_args )
  File "/usr/local/lib64/python2.7/site-packages/osmosdr/osmosdr_swig.py", line 1170, in make
    return _osmosdr_swig.source_make(*args, **kwargs)
RuntimeError: bad lexical cast: source type value could not be interpreted as target

Change-Id: I2d1bcee835b695c91a5c44ec78a40b2d969f611c
2019-05-02 11:55:39 +00:00
Vasil Velichkov 61a3ca6cb4 Improve the TCH/H decoder logs
- Change "6,90 kbit/s" to "5.9 kbit/s"
  A typo reported in github ptrkrysik/gr-gsm#456
- Comment out the "Error! frame_nr:" message as it turns out to confuse
  users more then it actually helps debugging.
- When voice-boundary detection is enabled write the name of decoded
  control channel messages

Change-Id: I697ef944f30c4cabb62c888317dd3a7f8dcd5611
2019-05-02 12:59:20 +02:00
Piotr Krysik aaac615715 Improve slightly interface of plotting so it's easier to use it
Change-Id: Ia70ab45a8beb81512a9f83e316ad2d2bc385ef19
2019-04-01 09:43:26 +02:00
Vasil Velichkov c5bb436cda Fix the TCH/H decoder and demapper XML definitions
- The second argument of tch_h_decoder constructor is a string that
  accepts the value of MultiRate configuration element and not an enum
  like the tch_f_decoder decoder.
- Make the demapper's burst sink required.
- Make all parameters visible.
- Rename the TCH/H Channel parameter to Sub-channel number.
- Add the qa_tch_h_decoder test in the CMakeLists.txt
- Fix several typos

Change-Id: I92d4f49955c634df7d76f17cfb58d7106846c1bd
2019-03-19 17:36:28 +02:00
Piotr Krysik 81ba56f59d Major simplification and some argument changes in grgsm_capture
grmgs_capture tried to do too many things for a simple recorder.
It was simplified by removing the receiver and ability to
save data to bursts files.

All other stuff that is not necessary for recording signal to disk was
also removed:
-setters/getters,
-storing of parameters that never will be changed.

The 'fc' parameter name was changed to 'freq' to follow GNU Radio
guidelines.

The 'shiftoff' parameter was removed.

'bb_gain' and 'if_gain' parameters were added.

Variables specific to some of SDR's like:
-gains at different stages,
-bandwidth (not all devices can set it),
-antennas (some devices have just one, some not),
were moved to separate options group.

What is left to be exposed is:
-dc_offset_mode,
-iq_balance_mode,
-gain_mode.

Change-Id: I092a43eaddb09a99c6cc05fde13f0ae94d9e0251
2019-03-01 17:03:15 +00:00
Vasil Velichkov 57431ed50c grgsm_livemon: Use the osr variable in all blocks
In the GSM input adaptor and GSM Receiver blocks the osr was hardcoded
to 4 and cannot be changed using the command line parameter.

Change-Id: I4e85b898f05db636f18fdea6e5fee4fed6e0382a
2019-02-25 23:43:00 +02:00
Vasil Velichkov 2f0c096e30 MacOS fixes
- Include grgsm/endian.h in tch_h_decoder_impl.cc
- Revert 0ed39fbf93 as linking with
  boost_thread is needed

Fixes GH-444

Change-Id: I00884962295082cff3eb64fa21e9f73437be0001
2019-02-05 14:28:37 +00:00
Vadim Yanitskiy ca25d141f5 apps/grgsm_trx: introduce initial LMS driver support
Change-Id: Ie983b10d1814906b6e659213f865e58d0f5c08e4
2019-01-26 10:58:25 +07:00
Vadim Yanitskiy a53dd193dc apps/grgsm_trx: add RadioInterface driver selection argument
Change-Id: Ic11f878c176bad16b057f25725ab0cfecc01782f
2019-01-22 16:44:30 +07:00
Vadim Yanitskiy b6f6f471d9 trx/radio_if.py: print type of RadioInterface
Change-Id: I6c1ba8546caec122cd1ea0ed87656f691abec068
2019-01-22 16:44:24 +07:00
Vadim Yanitskiy 3120ba7017 python/trx: fork RadioInterfaceUHD from RadioInterface
Change-Id: I1644a3f6b8da0d5f2a1a133058269e5383948fda
2019-01-22 16:43:48 +07:00
Vadim Yanitskiy 404842da11 trx/ctrl_if.py: use relative import for UDPLink
Change-Id: If4b00f6332461d3c37cde5a1f724906ca3d3a30f
2019-01-22 14:41:30 +07:00
Vadim Yanitskiy 5823a419e9 trx/radio_if.py: update clock_offset_control in set_rx_freq()
Change-Id: I065bf664f775099c90c123c9ff75f262a73bf1be
2019-01-19 11:29:35 +07:00
Vadim Yanitskiy 8bd9e15c66 trx/radio_if.py: do not print anything if freq. shift is 0
Change-Id: I100ce2ab8effc00e164e13253894445bdc816f06
2019-01-19 11:29:35 +07:00
Vadim Yanitskiy 180a037a41 python/trx: introduce and use Transceiver class
Change-Id: I6dc88edbb69a68746cc8e01206dc86f7ea2fa80f
2019-01-19 11:29:35 +07:00
Vadim Yanitskiy baebe451cd trx/ctrl_if_bb.py: reset transceiver on POWEROFF
Change-Id: I1e7f74c56388a431794a0b32b8a9537c360f5d33
2019-01-19 11:29:28 +07:00
Vadim Yanitskiy b7a272e3f0 trx/radio_if.py: introduce a new @property 'ready'
Change-Id: I513da0f45c6a608d15fbd0e8eafe14d6af8833d7
2019-01-19 10:24:31 +07:00
Vadim Yanitskiy 1fe28253b9 trx/radio_if.py: do not init both rx_freq and tx_freq
Change-Id: I9f251958ec90141d144fdb027aff20182131a1d1
2019-01-19 10:24:05 +07:00
Vadim Yanitskiy 7da82f458f python/trx: get rid of FakePM class
Change-Id: Ie96eb9735ecaa3329135c7be976ffd277a2f64f4
2019-01-19 09:32:36 +07:00
Vadim Yanitskiy 435d7557e8 apps/grgsm_trx: move init code from run() to __init__()
Change-Id: I1bcc9c8a2d37d156bbec93be3838200f6c4a80c2
2019-01-19 09:02:12 +07:00
Vadim Yanitskiy f237f1a978 python/trx: use CamelCase naming for basic classes
Change-Id: Ica9c56d01191dda38e63b51caba2ec8c63b671c9
2019-01-16 17:11:55 +07:00
Vadim Yanitskiy bd4daec11c trx/radio_if.py: use existing 'dict_toggle_sign' block
Change-Id: Ifa616644a858f493b9f8706663f9e7fed717f3d0
2019-01-16 17:11:55 +07:00
Vadim Yanitskiy a1a871ee37 python/trx: rename 'change_sign_of_dict_elements' to 'dict_toggle_sign'
The old name was quite long, resulting into cumbersome imports:

  from change_sign_of_dict_elements import change_sign_of_dict_elements

let's use a shorter variant:

  from dict_toggle_sign import dict_toggle_sign

Change-Id: Ie75e1d6e5e74c7c1cf34154633c1472e4b85dbb6
2019-01-16 17:11:55 +07:00
Vadim Yanitskiy ace92ae2c5 python/trx/__init__.py: cosmetic: add missing new line
Change-Id: I379b321866bd892a52b0c272ed50c670da380a17
2019-01-16 17:11:55 +07:00
Vasil Velichkov 06321a39e0 Improve voice boundary detection
Decode Alerting and Progress messages and if the in-band information
flag is set start decoding the voice
2018-12-29 00:52:05 +01:00
Vasil Velichkov 6ade8b8f19 Add TCH/H decoder tests 2018-12-29 00:52:05 +01:00
Vasil Velichkov 7f259fdb68 Add TCH/H decoder block with AMR multirate support
Add new TCHH channel mode
Add two new optional arguments

    -m CHAN_MODE, --mode=CHAN_MODE
                        Channel mode. Valid options are 'BCCH' (Non-combined
                        C0), 'BCCH_SDCCH4'(Combined C0), 'SDCCH8' (Stand-alone
                        control channel) 'TCHF' (Traffic Channel, Full rate),
                        'TCHH' (Traffic Channel, Half rate)

    --sub-channel=TCH_H_CHANNEL
                        TCH/H sub-channel. [default=0]
    --multi-rate=MULTI_RATE
                        The MultiRrate configuration element from the
                        Assigment Command message. Example: 28111a40. See 3GPP
                        TS 44.018 - 10.5.2.21aa MultiRate configuration

Example:
    grgsm_decode -m TCHH --sub-channel 0 --multi-rate 2811 -o voice.amr ...
2018-12-29 00:52:05 +01:00
Vasil Velichkov 0ccec373b3 Add tests for the TCH/F and TCH/H Demappers 2018-12-29 00:52:05 +01:00
Vasil Velichkov 1828a315a8 Move HR demapping into a separate block 2018-12-29 00:52:05 +01:00