Skip to content

Commit

Permalink
Naming changes for rp -> modem (#5)
Browse files Browse the repository at this point in the history
* Changed names, resolves #1

* Corrected user name in README

* Update CMakeLists.txt

bump version to 1.1.1
  • Loading branch information
kuehnhammer authored Oct 21, 2021
1 parent d8346da commit c9fba14
Show file tree
Hide file tree
Showing 31 changed files with 144 additions and 189 deletions.
2 changes: 1 addition & 1 deletion ATTRIBUTION_NOTICE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
OBECA Receive Process uses the following open source software:
5G-MAG RT Modem uses the following open source software:

- srsLTE - Open Source LTE by Software Radio Systems (SRS)
available at https://github.com/srsLTE/srsLTE
Expand Down
23 changes: 11 additions & 12 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.16)

project (rp VERSION 1.1.0)
project (modem VERSION 1.1.1)

include(CTest)
include(FindPkgConfig)
Expand Down Expand Up @@ -45,12 +45,11 @@ link_directories(

set(CMAKE_CXX_CLANG_TIDY clang-tidy --format-style=google --checks=clang-diagnostic-*,clang-analyzer-*,-*,bugprone*,modernize*,performance*)

add_executable(rp src/main.cpp src/SdrReader.cpp src/Phy.cpp
add_executable(modem src/main.cpp src/SdrReader.cpp src/Phy.cpp
src/CasFrameProcessor.cpp src/MbsfnFrameProcessor.cpp src/Rrc.cpp
src/Gw.cpp src/RestHandler.cpp src/MeasurementFileWriter.cpp)
add_test(rp_test rp --config=./ofr-lrp.conf)

target_link_libraries( rp
target_link_libraries( modem
LINK_PUBLIC
spdlog::spdlog
srslte_phy
Expand All @@ -69,18 +68,18 @@ target_link_libraries( rp
)


install(TARGETS rp DESTINATION bin LIBRARY DESTINATION lib)
install(FILES supporting_files/rp.service DESTINATION /usr/lib/systemd/system)
install(FILES supporting_files/obeca.conf DESTINATION /etc)
install(FILES supporting_files/obeca DESTINATION /etc/default)
install(FILES supporting_files/pre_rp.sh DESTINATION /usr/share/obeca
install(TARGETS modem)
install(FILES supporting_files/5gmag-rt-modem.service DESTINATION /usr/lib/systemd/system)
install(FILES supporting_files/5gmag-rt.conf DESTINATION /etc)
install(FILES supporting_files/5gmag-rt DESTINATION /etc/default)
install(FILES supporting_files/pre_modem.sh DESTINATION /usr/share/5gmag-rt
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
)
install(FILES supporting_files/rp_measurements DESTINATION /etc/logrotate.d)
install(FILES supporting_files/modem_measurements DESTINATION /etc/logrotate.d)

SET(CPACK_GENERATOR "DEB")
SET(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON)
SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "Austrian Broadcasting Services <[email protected]>")
SET(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${CMAKE_SOURCE_DIR}/debian/conffiles;${CMAKE_SOURCE_DIR}/debian/postinst;${CMAKE_SOURCE_DIR}/debian/rp.service;")
SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "5G-MAG Reference Tools <[email protected]>")
SET(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${CMAKE_SOURCE_DIR}/debian/conffiles;${CMAKE_SOURCE_DIR}/debian/postinst;")

INCLUDE(CPack)
2 changes: 1 addition & 1 deletion Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ DOXYFILE_ENCODING = UTF-8
# title of most generated pages and in a few other places.
# The default value is: My Project.

PROJECT_NAME = "OBECA Receive Process"
PROJECT_NAME = "5G-MAG Reference Tools - MBMS Modem"

# The PROJECT_NUMBER tag can be used to enter a project or revision number. This
# could be handy for archiving the generated documentation or if some version
Expand Down
26 changes: 13 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# Installation guide

Installation of OBECA consists of 4 simple steps:
Installation of 5gmag-rt-modem consists of 4 simple steps:
1. Install dependencies
2. Install SDR drivers
3. Building the Receive Process
4. Post installation configuration

## Step 1: Install dependencies

Your system needs to have some dependencies before installing OBECA. Please install them by running the commands below:
Your system needs to have some dependencies before installing 5gmag-rt-modem. Please install them by running the commands below:

````
sudo apt update
Expand All @@ -21,7 +21,7 @@ sudo pip3 install cpplint

### 2.1 Installing SDR drivers

OBECA uses SoapySDR to interface with SDR hardware. Please install the library, the dev headers and the module that matches your hardware.
5gmag-rt-modem uses SoapySDR to interface with SDR hardware. Please install the library, the dev headers and the module that matches your hardware.
````
sudo apt install libsoapysdr-dev soapysdr-tools
````
Expand Down Expand Up @@ -55,12 +55,12 @@ sudo bladeRF-install-firmware

#### Other SDRs

While we've only tested with Lime- and Blade-SDRs, Soapy supports a wide range of SDR devices, which should therefore also be usable with OBECA if they support the high bandwidth/sample rates required for FeMBMS decoding.
While we've only tested with Lime- and Blade-SDRs, Soapy supports a wide range of SDR devices, which should therefore also be usable with 5gmag-rt-modem if they support the high bandwidth/sample rates required for FeMBMS decoding.
You can find more info on device support at https://github.com/pothosware/SoapySDR/wiki

Running ``apt search soapysdr-module`` lists all available modules.

If you successfully (or unsuccessfully) try OBECA with another SDR, please let us know!
If you successfully (or unsuccessfully) try 5gmag-rt-modem with another SDR, please let us know!

### 2.2 Checking SoapySDR installation

Expand Down Expand Up @@ -135,18 +135,18 @@ Alternatively, to configure a debug build:
The application installs a systemd unit and some helper scripts for setting up the TUN network interface and multicast routing.

## Step 4: Post installation configuration
### 4.1 Adding ofr user
Create an user named "ofr" for correct pre-configuration of receive process: `` sudo useradd ofr ``
### 4.1 Adding fivegmag-rt user
Create a user named "fivegmag-rt" for correct pre-configuration of receive process: `` sudo useradd fivegmag-rt ``

### 4.2 Enabling Receive Process daemon for correct pre-configuring
For correct pre-configuring of the Receive Process at a system startup, it has to be run through systemd once:
````
sudo systemctl start rp
sudo systemctl stop rp
sudo systemctl start 5gmag-rt-modem
sudo systemctl stop 5gmag-rt-modem
````
To enable automatic startup at every boot type in:
````
sudo systemctl enable rp
sudo systemctl enable 5gmag-rt-modem
````

### 4.3 Configuring the reverse path filter
Expand Down Expand Up @@ -176,8 +176,8 @@ net.ipv4.conf.all.rp_filter = 0
net.ipv4.conf.default.rp_filter = 0
````

### 4.4 Set superuser rights for rp (optional)
### 4.4 Set superuser rights for 5gmag-rt-modem (optional)
To allow the application to run at realtime scheduling without superuser privileges, set its capabilites
accordingly. Alternatively, you can run it with superuser rights (``sudo ./rp``).
accordingly. Alternatively, you can run it with superuser rights (``sudo ./modem``).

`` sudo setcap 'cap_sys_nice=eip' ./rp ``
`` sudo setcap 'cap_sys_nice=eip' ./modem ``
4 changes: 2 additions & 2 deletions debian/conffiles
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
/etc/rp.conf
/etc/default/obeca
/etc/5gmag-rt.conf
/etc/default/5gmag-rt

6 changes: 3 additions & 3 deletions debian/postinst
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh

set -e
sudo setcap 'cap_sys_nice=eip' /usr/bin/rp
sudo systemctl enable rp
sudo systemctl restart rp
sudo setcap 'cap_sys_nice=eip' /usr/bin/modem
sudo systemctl enable 5gmag-rt-modem
sudo systemctl restart 5gmag-rt-modem
6 changes: 3 additions & 3 deletions include/Version.h.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#define VERSION_MAJOR @rp_VERSION_MAJOR@
#define VERSION_MINOR @rp_VERSION_MINOR@
#define VERSION_PATCH @rp_VERSION_PATCH@
#define VERSION_MAJOR @modem_VERSION_MAJOR@
#define VERSION_MINOR @modem_VERSION_MINOR@
#define VERSION_PATCH @modem_VERSION_PATCH@
4 changes: 2 additions & 2 deletions src/CasFrameProcessor.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// OBECA - Open Broadcast Edge Cache Appliance
// Receive Process
// 5G-MAG Reference Tools
// MBMS Modem Process
//
// Copyright (C) 2021 Klaus Kühnhammer (Österreichische Rundfunksender GmbH & Co KG)
//
Expand Down
4 changes: 2 additions & 2 deletions src/CasFrameProcessor.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// OBECA - Open Broadcast Edge Cache Appliance
// Receive Process
// 5G-MAG Reference Tools
// MBMS Modem Process
//
// Copyright (C) 2021 Klaus Kühnhammer (Österreichische Rundfunksender GmbH & Co KG)
//
Expand Down
10 changes: 5 additions & 5 deletions src/Gw.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// OBECA - Open Broadcast Edge Cache Appliance
// Receive Process
// 5G-MAG Reference Tools
// MBMS Modem Process
//
// Copyright (C) 2021 Klaus Kühnhammer (Österreichische Rundfunksender GmbH & Co KG)
//
Expand Down Expand Up @@ -108,9 +108,9 @@ void Gw::init() {
_tun_fd = -1;
}

std::string dev_name = "rp_tun";
if (nullptr != std::getenv("RP_TUN_INTERFACE")) {
dev_name = std::getenv("RP_TUN_INTERFACE");
std::string dev_name = "mbms_modem_tun";
if (nullptr != std::getenv("MODEM_TUN_INTERFACE")) {
dev_name = std::getenv("MODEM_TUN_INTERFACE");
}

memset(&ifr, 0, sizeof(ifr));
Expand Down
4 changes: 2 additions & 2 deletions src/Gw.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// OBECA - Open Broadcast Edge Cache Appliance
// Receive Process
// 5G-MAG Reference Tools
// MBMS Modem Process
//
// Copyright (C) 2021 Klaus Kühnhammer (Österreichische Rundfunksender GmbH & Co KG)
//
Expand Down
4 changes: 2 additions & 2 deletions src/MbsfnFrameProcessor.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// OBECA - Open Broadcast Edge Cache Appliance
// Receive Process
// 5G-MAG Reference Tools
// MBMS Modem Process
//
// Copyright (C) 2021 Klaus Kühnhammer (Österreichische Rundfunksender GmbH & Co KG)
//
Expand Down
4 changes: 2 additions & 2 deletions src/MbsfnFrameProcessor.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// OBECA - Open Broadcast Edge Cache Appliance
// Receive Process
// 5G-MAG Reference Tools
// MBMS Modem Process
//
// Copyright (C) 2021 Klaus Kühnhammer (Österreichische Rundfunksender GmbH & Co KG)
//
Expand Down
14 changes: 7 additions & 7 deletions src/MeasurementFileWriter.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// OBECA - Open Broadcast Edge Cache Appliance
// Receive Process
// 5G-MAG Reference Tools
// MBMS Modem Process
//
// Copyright (C) 2021 Klaus Kühnhammer (Österreichische Rundfunksender GmbH & Co KG)
//
Expand Down Expand Up @@ -37,14 +37,14 @@ const uint32_t kMaxTimestringSize = 80;
MeasurementFileWriter::MeasurementFileWriter(const libconfig::Config& cfg)
: _cfg(cfg) {
bool gps_enabled = false;
_cfg.lookupValue("rp.measurement_file.gpsd.enabled", gps_enabled);
_cfg.lookupValue("modem.measurement_file.gpsd.enabled", gps_enabled);

if (gps_enabled) {
std::string host = "localhost";
_cfg.lookupValue("rp.measurement_file.gpsd.host", host);
_cfg.lookupValue("modem.measurement_file.gpsd.host", host);

std::string port = DEFAULT_GPSD_PORT;
_cfg.lookupValue("rp.measurement_file.gpsd.port", port);
_cfg.lookupValue("modem.measurement_file.gpsd.port", port);

_gps = std::make_unique<gpsmm>(host.c_str(), port.c_str());

Expand Down Expand Up @@ -120,8 +120,8 @@ void MeasurementFileWriter::WriteLogValues(
}
}

std::string file_loc = "/tmp/rp_measurements.csv";
_cfg.lookupValue("rp.measurement_file.file_path", file_loc);
std::string file_loc = "/tmp/modem_measurements.csv";
_cfg.lookupValue("modem.measurement_file.file_path", file_loc);
std::ofstream file;
file.open(file_loc, std::ios_base::app);
file << line << std::endl;
Expand Down
4 changes: 2 additions & 2 deletions src/MeasurementFileWriter.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// OBECA - Open Broadcast Edge Cache Appliance
// Receive Process
// 5G-MAG Reference Tools
// MBMS Modem Process
//
// Copyright (C) 2021 Klaus Kühnhammer (Österreichische Rundfunksender GmbH & Co KG)
//
Expand Down
6 changes: 3 additions & 3 deletions src/Phy.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// OBECA - Open Broadcast Edge Cache Appliance
// Receive Process
// 5G-MAG Reference Tools
// MBMS Modem Process
//
// Copyright (C) 2021 Klaus Kühnhammer (Österreichische Rundfunksender GmbH & Co KG)
//
Expand Down Expand Up @@ -240,7 +240,7 @@ void Phy::set_mbsfn_config(const srslte::mcch_msg_t& mcch) {
for (uint32_t j = 0; j < _mcch.pmch_info_list[i].nof_mbms_session_info; j++) {
mtch_info_t mtch_info;
mtch_info.lcid = _mcch.pmch_info_list[i].mbms_session_info_list[j].lc_ch_id;
char tmgi[20];
char tmgi[20]; // NOLINT
/* acc to TS24.008 10.5.6.13:
* MCC 1,2,3: 901 -> 9, 0, 1
* MNC 3,1,2: 56 -> (F), 5, 6
Expand Down
4 changes: 2 additions & 2 deletions src/Phy.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// OBECA - Open Broadcast Edge Cache Appliance
// Receive Process
// 5G-MAG Reference Tools
// MBMS Modem Process
//
// Copyright (C) 2021 Klaus Kühnhammer (Österreichische Rundfunksender GmbH & Co KG)
//
Expand Down
16 changes: 8 additions & 8 deletions src/RestHandler.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// OBECA - Open Broadcast Edge Cache Appliance
// Receive Process
// 5G-MAG Reference Tools
// MBMS Modem Process
//
// Copyright (C) 2021 Klaus Kühnhammer (Österreichische Rundfunksender GmbH & Co KG)
//
Expand Down Expand Up @@ -45,22 +45,22 @@ RestHandler::RestHandler(const libconfig::Config& cfg, const std::string& url,
if (url.rfind("https", 0) == 0) {
server_config.set_ssl_context_callback(
[&](boost::asio::ssl::context& ctx) {
std::string cert_file = "/usr/share/obeca/cert.pem";
cfg.lookupValue("rp.restful_api.cert", cert_file);
std::string cert_file = "/usr/share/5gmag-rt/cert.pem";
cfg.lookupValue("modem.restful_api.cert", cert_file);

std::string key_file = "/usr/share/obeca/key.pem";
cfg.lookupValue("rp.restful_api.key", key_file);
std::string key_file = "/usr/share/5gmag-rt/key.pem";
cfg.lookupValue("modem.restful_api.key", key_file);

ctx.set_options(boost::asio::ssl::context::default_workarounds);
ctx.use_certificate_chain_file(cert_file);
ctx.use_private_key_file(key_file, boost::asio::ssl::context::pem);
});
}

cfg.lookupValue("rp.restful_api.api_key.enabled", _require_bearer_token);
cfg.lookupValue("modem.restful_api.api_key.enabled", _require_bearer_token);
if (_require_bearer_token) {
_api_key = "106cd60-76c8-4c37-944c-df21aa690c1e";
cfg.lookupValue("rp.restful_api.api_key.key", _api_key);
cfg.lookupValue("modem.restful_api.api_key.key", _api_key);
}

_listener = std::make_unique<http_listener>(
Expand Down
4 changes: 2 additions & 2 deletions src/RestHandler.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// OBECA - Open Broadcast Edge Cache Appliance
// Receive Process
// 5G-MAG Reference Tools
// MBMS Modem Process
//
// Copyright (C) 2021 Klaus Kühnhammer (Österreichische Rundfunksender GmbH & Co KG)
//
Expand Down
4 changes: 2 additions & 2 deletions src/Rrc.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// OBECA - Open Broadcast Edge Cache Appliance
// Receive Process
// 5G-MAG Reference Tools
// MBMS Modem Process
//
// Copyright (C) 2021 Klaus Kühnhammer (Österreichische Rundfunksender GmbH & Co KG)
//
Expand Down
4 changes: 2 additions & 2 deletions src/Rrc.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// OBECA - Open Broadcast Edge Cache Appliance
// Receive Process
// 5G-MAG Reference Tools
// MBMS Modem Process
//
// Copyright (C) 2021 Klaus Kühnhammer (Österreichische Rundfunksender GmbH & Co KG)
//
Expand Down
8 changes: 4 additions & 4 deletions src/SdrReader.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// OBECA - Open Broadcast Edge Cache Appliance
// Receive Process
// 5G-MAG Reference Tools
// MBMS Modem Process
//
// Copyright (C) 2021 Klaus Kühnhammer (Österreichische Rundfunksender GmbH & Co KG)
//
Expand Down Expand Up @@ -94,7 +94,7 @@ auto SdrReader::init(const std::string& device_args, const char* sample_file,
}
}

_cfg.lookupValue("rp.sdr.ringbuffer_size_ms", _buffer_ms);
_cfg.lookupValue("modem.sdr.ringbuffer_size_ms", _buffer_ms);
unsigned int buffer_size = 16384/*15360*/ * _buffer_ms;
// at 10MHz BW / 15.36Mhz sample rate
int error = 0;
Expand Down Expand Up @@ -201,7 +201,7 @@ void SdrReader::start() {
_readerThread = std::thread{&SdrReader::read, this};
struct sched_param thread_param = {};
thread_param.sched_priority = 50;
_cfg.lookupValue("rp.sdr.reader_thread_priority_rt", thread_param.sched_priority);
_cfg.lookupValue("modem.sdr.reader_thread_priority_rt", thread_param.sched_priority);

spdlog::debug("Launching sample reader thread with realtime scheduling priority {}", thread_param.sched_priority);

Expand Down
4 changes: 2 additions & 2 deletions src/SdrReader.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// OBECA - Open Broadcast Edge Cache Appliance
// Receive Process
// 5G-MAG Reference Tools
// MBMS Modem Process
//
// Copyright (C) 2021 Klaus Kühnhammer (Österreichische Rundfunksender GmbH & Co KG)
//
Expand Down
Loading

0 comments on commit c9fba14

Please sign in to comment.