Commit Graph

1136 Commits

Author SHA1 Message Date
Piotr Krysik 89dc99016e misc_utils/resampler: Add offsets of tags at the input
This change is done to make keeping track of sample counter
at the input of the resampler easier from blocks connected
to its output. Each tag leaving the resampler has accompanying
"original_offset" tag with its offset before sample rate change.

Change-Id: Iea8ca4a092029f774406dced8a97a17810f21f62
2018-11-02 11:50:14 +01:00
Piotr Krysik acd7d71db4 misc_utils/resampler: Cosmetic changes
Change variables names to more readable.
Remove old comment.

Change-Id: Ibe22677cfc4b3e1a9fb900e5055cdce0a7656a92
2018-11-02 11:31:32 +01:00
Piotr Krysik 6a0fb1a415 misc_utils/resampler: Fix repetition of tags at the output
When tag appears at the last sample of the ouput buffer
it will be added again in the next run of the work function.

Here this issue was solved by changing the codition so the
tag appearing at the end of the output buffer is not added.

Change-Id: Ia4f0923e2071184879a023d0fe01026d8e9ccbda
2018-11-02 11:26:13 +01:00
Vasil Velichkov 00a9c400a8 grgsm_channelize: Add ichar data type
This is the output format of rtl_sdr and hackrf_transfer and this would
allow direct channelization without an additional post processing.

Change-Id: Ia489eca9ec7defc3a83946c42f1ae3f136efe4e8
2018-09-13 15:35:44 +02:00
Piotr Krysik d6e8bb744e apps/grgsm_trx: remove unnecessary checks of freq_offset
Checking if freq_offset is None doesn't make sense currently
as it's always set to a float value by argparse (to 0 by default).

Change-Id: Ie8bae1ccde60d07fc25e0b874afa5aaaac04d8a7
2018-09-13 15:35:44 +02:00
Piotr Krysik 11583adb9d trx/radio_if: add freq_offset parameter to constructor
Change-Id: Ie1db02b719a0fec478b8a8b8a95643fb10fdfce5
2018-09-13 15:35:44 +02:00
Vasil Velichkov 492f48c7d3 burst_file_source: Fix reading longer bursts
- Read bursts with pmt::deserialize directly from the std::filebuf
- Remove the unused unserialized variable
- Add tests

Since df978693 when the rx_time tags are present in the incomming stream
the gsm receiver adds fm_time to the burst's PMT and the bursts that
burst file sink writes becomes longer because of the additional field.

The burst file source block was expecting all burst to be 147 bytes long
and reading files with longer bursts was failing with an unhandled exception.

terminate called after throwing an instance of 'pmt::exception'
thread[thread-per-block[5]: <block dummy_burst_filter (2)>]: pmt_cdr: wrong_type : #f
  what():  pmt::deserialize: malformed input stream, tag value = : 115

Change-Id: I989b0d6a6b214088b7880e5cbf7bb6725492dbfc
2018-09-13 15:35:44 +02:00
Piotr Krysik 262bda10e6 apps/grgsm_trx: migrate from getopt to argparse
Change-Id: I24a17b4cd44db0ce95a19d7470f4f09f3c85a26d
2018-09-13 15:35:44 +02:00
Piotr Krysik 58659a4dee trx/radio_if.py: clarify magic numbers in sample rate calculation
Change-Id: I55f283113d0324a0236b7bbf13bce5718003b857
2018-09-13 15:35:44 +02:00
Vadim Yanitskiy 562125270b apps/grgsm_trx: fix inaccurate sample rate calculation
Change-Id: I0c309588fa0f7822abfb3919327639735db07679
2018-09-13 15:35:44 +02:00
Vasil Velichkov 9e46c4807d Format the output into ostringstream and then write it at once.
This fixes the garbled output when multiple printers are used in a
flowgraph.

closes #255
closes #420

Change-Id: I1012ed26371b4c67163545652f0a1ce0f576af9e
2018-09-13 15:35:44 +02:00
Vasil Velichkov 1e04c1fd9c grgsm_scanner: Add --debug option
When set the stdout and stderr won't be redirected to /dev/null which
will facilitate resolving issues

Change-Id: I11e99facb5a1ab9c9bfee3c314a91a74f98a2523
2018-09-13 15:35:44 +02:00
Piotr Krysik ba6fd0e776 Revert "grgsm_trx: Migrated argument parsing to argparse" that shouldn't be pushed
This reverts commit c62a3d9f55.
2018-09-13 15:35:44 +02:00
Piotr Krysik fcb64a8adf grgsm_trx: Migrated argument parsing to argparse
Argparse makes adding new parameters easier and
adds consistent way of handling default values of
parameters and printing of their help info.

Change-Id: Idf99fd7a581464aa2f77fe01e721dbd162686811
2018-09-13 15:35:44 +02:00
Vadim Yanitskiy 3f9abbdf92 apps/grgsm_trx: add baseband frequency shift feature
An ability to shift the baseband frequency would allow one to
run both base stations and (OsmocomBB-based) mobile stations on
any frequency (e.g. in 2.4 GHz WiFi band)!

This is achieved by adding a given frequency offset to the
result of "ARFCN -> RX/TX frequency" calculation.

Usage example:

  grgsm_trx --freq-offset -500M

Both RX (Downlink) and TX (Uplink) frequencies will be shifted
by 500 MHz back, e.g. tuning request to ARFCN 105 would result
in tuning the radio to 456.0 MHz (instead of 956.0 MHz).

Related: OS#3520 (https://osmocom.org/versions/136)
Change-Id: I42e397e47402a87f4141ef31b25eff4c8c1267e2
2018-09-13 15:35:44 +02:00
Piotr Krysik 22cd7c973f Changed submodule URLs to point to osmocom servers 2018-09-13 15:35:44 +02:00
Piotr Krysik 6d2f53826f Increasing version number
in order to correct wrongs of previous attempt

Change-Id: Ie067b48a9c67a13e928598ec722a7e27c464de8f
2018-09-13 15:35:44 +02:00
Piotr Krysik 80ec5ba599 New gr-gsm version
Change-Id: I72eafebe892692ad0db5ad149e14f2c59b41d3d2
2018-09-13 15:35:44 +02:00
Vadim Yanitskiy 641133e5d8 apps/grgsm_trx: print bind / remote address and port
Change-Id: If750d476f3972f1ab5c5b637438d14d40b1e3d87
2018-09-13 15:35:44 +02:00
Vadim Yanitskiy 216558454d apps/grgsm_trx: introduce bind address option
The new option (-b --bind-addr) allows one to specify the bind
address for both DATA and CTRL interfaces. By default, '0.0.0.0'
is used, so there are no restrictions for the L1 source address.

Change-Id: I3339f686b53db07cfd1bff9a516f4bdc28058cd9
2018-09-13 15:35:44 +02:00
Vadim Yanitskiy f94a51b64d gsm_trx_burst_if: allow to customize the bind address
Pleviously remote address for DATA interface was also used as the
bind address, what is definitely wrong. Let's change the API a bit
in order to allow one to specify a custom bind address.

Change-Id: I6e5f7b7119ac454217b8dd04f9ee0dd3b23972b6
2018-09-13 15:35:44 +02:00
Vadim Yanitskiy 053f9e53f0 trx/ctrl_if.py: send control responses to where commands are from
When we receive a control command, we should not simply send the
response to the default destination, but send it back to the exact
IP/prt from which the command originated.

This ensures correct routing of responses even in case multiple
programs are interfacing concurrently with a control socket.

Cherry-picked from: I24a0bba6eed059b101af95dac7d059f34dd715fc
Change-Id: I1f304ea887dc957d3ad53adb1e3c56ab27d8f196
2018-09-13 15:35:44 +02:00
Vadim Yanitskiy 8705f0e546 trx/udp_link.py: set SO_REUSEADDR socket option
Setting this option allows one to reuse existing connections,
for example, by injecting CTRL commands or DATA bursts
into existing connections.

Cherry-picked from: I0882c76affa9a668a12d10967081054d2b666ed1
Change-Id: I6d256683a7aa0419cd5bd0a3eaa97aefdf3254f9
2018-09-13 15:35:44 +02:00
Vadim Yanitskiy ed9d7282d4 trx/udp_link.py: close socket in destructor
Previously it was required to call the UDPLink.shutdown() method
manually in order to close a socket. Let's do it automatically
using the destructor of UDPLink.

Cherry-picked from: I59c3dc61ec58cd9effeb789947d28fd602ca91f4
Change-Id: Ief7aa21d1e50682a90616833b679741957193aae
2018-09-13 15:35:44 +02:00
Vadim Yanitskiy 4cedbb530e apps/grgsm_trx: use format string for help message
Instead of using the hard-coded default values in help message,
it makes sense to use a format string, and pass the actual
values when printing help.

Change-Id: Ib1bf0ef3ded86aa92faeb9b63eb286283f5c8c3d
2018-09-13 15:35:44 +02:00
Vadim Yanitskiy 3824bbaeb1 trx/radio_if.py: drop useless import of osmosdr
Change-Id: Iacd5ca118957e3ecf05df81f511b17bb9a8982b5
2018-09-13 15:35:44 +02:00
Vadim Yanitskiy 45457e959d trx/radio_if.py: reset UHD device time at startup
Some UHD devices, such as UmTRX, require one to manually reset the
hardware clock, otherwise the burst transmission doesn't work.

Change-Id: Idddc1387199bd22342ec5af25c8635e73352e315
2018-09-13 15:35:44 +02:00
Vadim Yanitskiy 07a2abb635 grgsm_trx: change default TRX port number to 6700
In order to avoid clashes with OsmoTRX, which may be also
running on the same host, let's use a different port range
starting from 6700 by default.

This idea was introduced as a result of OS#2984.

Change-Id: Iaf0c78733bfefcb0b0938abf6d316e27d03ecab4
2018-09-13 15:35:44 +02:00
Vadim Yanitskiy a609d2f9c9 apps/grgsm_trx: also print Piotr as a copyright holder
Despite the most part of Python code was written by Vadim, it's
heavily based on huge and impressive work done by Piotr. Let's
also print his credentials in the license header.

Change-Id: Icca7c679d84f99440ff502219f624e0f73112744
2018-09-13 15:35:44 +02:00
Piotr Krysik f0f7183cb7 tests: Fix Debian and Kali dockerfiles
Change-Id: I61d37cb6882a8ca7bbfc97412c52e745a2e5ec7c
2018-09-13 15:35:44 +02:00
Piotr Krysik 8d30757dc0 Keep the old mailing list for now
but change wiki address and installation description
addres to the new (osmocom) ones.
2018-09-13 15:35:44 +02:00
Harald Welte de798b38ca README.md: Turn URLs into hyperlinks (video, mailing list)
Change-Id: Iacf7c4b13b0e32ea7761b859f7422ab630c8616f
2018-09-13 15:35:44 +02:00
Harald Welte cd3b36f1d5 README.md: Change mailing list address to osmocom.org
Change-Id: Ie7b474138444f0ceea160f74df4b693030ea07a8
2018-09-13 15:35:44 +02:00
Piotr Krysik 6a64ce82f7 Simplify cmake checks related to libosmocore 2018-09-13 15:35:44 +02:00
Vasil Velichkov f9f7cbd56b Run tests with CTEST_OUTPUT_ON_FAILURE=1 2018-09-13 15:35:44 +02:00
Vasil Velichkov 9d211b3da3 Add LOCAL_OSMOCOM cmake option
When set the gr-gsm will be compiled and linked with the local copies of
the osmocom libraries.
2018-09-13 15:35:44 +02:00
Piotr Krysik bbc8af53e8 Placing grcc compilation utils in separate files
Avoiding increasing required cmake version with use of wrapper shell script.
2018-09-13 15:35:44 +02:00
Piotr Krysik ded359bf36 Separating libosmogsm from the rest 2018-09-13 15:35:44 +02:00
Vasil Velichkov 0658bd424d Check that pkg-config is available
It is needed to properly detect the grcc full path
See also 3f6ab15a7a
2018-09-13 15:35:44 +02:00
Vasil Velichkov b4a0acf9f5 Add DEBIAN_FRONTEND=noninteractive 2018-09-13 15:35:44 +02:00
Vasil Velichkov e9aaeb14cc Fix the parallel build with cmake 3.11
Copy UseSWIG.cmake from the gnuradio repository from commit
4433a7703fe3f5713c2200a0f7c11b13510f34cc

This macro is distributed in the Debian's gnuradio-dev package but it's
not available in Fedora/Centos gnuradio-devel package. The gnuradio's
version contains a fix for the parallel build 99a09af05fda6d0bab0cf3724a1c6bf453c71bc7
and some other improvements as well.
2018-09-13 15:35:44 +02:00
Vasil Velichkov c91b128c1d Add CentOS7 docker container 2018-09-13 15:35:44 +02:00
Vasil Velichkov f608e7c766 Add cmake options that enable/disable grcc compilation
To disable compilation of both grgsm_livemon and grgsm_livemon_headless
execute

  cmake -DENABLE_GRCC=OFF ..

To disable only one execute

  cmake -DENABLE_GRGSM_LIVEMON=OFF ..
  cmake -DENABLE_GRGSM_LIVEMON_HEADLESS=OFF ..
2018-09-13 15:35:44 +02:00
Piotr Krysik 3fbc96c5ea Changing tabs to spaces 2018-09-13 15:35:44 +02:00
Piotr Krysik 02454b32b9 Disabling installation of desktop files
Installation of dekstop files is causing problems with packaging - github issue #335.
Disabling it then.
2018-09-13 15:35:44 +02:00
Piotr Krysik 4a3a52c897 Commenting out a line causeing crash on HackRF 2018-09-13 15:35:44 +02:00
Piotr Krysik 6463dc7641 Freq hopping fixes 2018-06-18 14:43:50 +02:00
Piotr Krysik 4e4a92ea05 Added functions for arfcn conversions taken from libosmocore 2018-05-11 11:39:23 +02:00
Piotr Krysik 1a32fc42a0 Added block for doing hopping for mobile station transceiver 2018-05-11 11:38:07 +02:00
Piotr Krysik b7cce89e55 Distilled function to generate hopping from cx_channel hopper 2018-05-11 11:37:21 +02:00