Skip to content

Commit

Permalink
Updated config (#856)
Browse files Browse the repository at this point in the history
* Moved Config to separate file

* started to switch over to new lib

* Converted all of config over

* PLugins updated too

* Use column headers for the talkgroup file

* Updated the Channels file parsing

* Update CONFIGURE.md

* slight config update
  • Loading branch information
robotastic authored Nov 11, 2023
1 parent 606c2ed commit 47460b1
Show file tree
Hide file tree
Showing 21 changed files with 33,982 additions and 759 deletions.
23 changes: 20 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
# Project setup
########################################################################

cmake_minimum_required(VERSION 3.2)
cmake_minimum_required(VERSION 3.12)
project(Trunk-Recorder LANGUAGES CXX C VERSION "4.6.0")

configure_file(cmake.h.in "${PROJECT_BINARY_DIR}/cmake.h" @ONLY)
Expand Down Expand Up @@ -248,6 +248,7 @@ list(APPEND trunk_recorder_sources
trunk-recorder/recorders/p25_recorder_qpsk_demod.cc
trunk-recorder/recorders/p25_recorder_decode.cc
trunk-recorder/csv_helper.cc
trunk-recorder/config.cc
trunk-recorder/talkgroup.cc
trunk-recorder/talkgroups.cc
trunk-recorder/unit_tag.cc
Expand Down Expand Up @@ -280,6 +281,11 @@ list(APPEND trunk_recorder_sources
trunk-recorder/call.h
trunk-recorder/plugin_manager/plugin_api.h
)

list(APPEND 3p_headers
lib/nlohmann/json.hpp
lib/csv-parser/csv.hpp
)
set_source_files_properties(lib/lfsr/lfsr.cxx COMPILE_FLAGS "-w")


Expand All @@ -293,6 +299,15 @@ include(GNUInstallDirs)

add_subdirectory(lib/op25_repeater)

#set(JSON_Install OFF CACHE INTERNAL "")

#add_subdirectory(lib/nlohmann_json)

#include(FetchContent)

#FetchContent_Declare(json URL https://github.com/nlohmann/json/releases/download/v3.11.2/json.tar.xz)
#FetchContent_MakeAvailable(json)

#target_compile_options(
# imbe_vocoder PRIVATE
# "-w"
Expand All @@ -312,7 +327,7 @@ set_property(

set_target_properties(trunk_recorder_library PROPERTIES OUTPUT_NAME "trunk-recorder")
set_target_properties(trunk_recorder_library PROPERTIES PUBLIC_HEADER "${trunk_recorder_headers}")

set_target_properties(trunk_recorder_library PROPERTIES PRIVATE_HEADER "${3p_headers}")

# Weird - when I add LIBRARY before the DESTINATION, it installs in the /usr/local/lib dir on a mac
install(TARGETS trunk_recorder_library
Expand Down Expand Up @@ -340,7 +355,9 @@ add_subdirectory(plugins/simplestream)

add_executable(trunk-recorder trunk-recorder/main.cc) # ${trunk_recorder_sources})

target_link_libraries(trunk-recorder git trunk_recorder_library gnuradio-op25_repeater ${CMAKE_DL_LIBS} ssl crypto ${CURL_LIBRARIES} ${Boost_LIBRARIES} ${GNURADIO_PMT_LIBRARIES} ${GNURADIO_RUNTIME_LIBRARIES} ${GNURADIO_FILTER_LIBRARIES} ${GNURADIO_DIGITAL_LIBRARIES} ${GNURADIO_ANALOG_LIBRARIES} ${GNURADIO_AUDIO_LIBRARIES} ${GNURADIO_UHD_LIBRARIES} ${UHD_LIBRARIES} ${GNURADIO_BLOCKS_LIBRARIES} ${GNURADIO_OSMOSDR_LIBRARIES} ) # gRPC::grpc++_reflection protobuf::libprotobuf)
target_link_libraries(trunk-recorder git trunk_recorder_library gnuradio-op25_repeater ${CMAKE_DL_LIBS} ssl crypto ${CURL_LIBRARIES} ${Boost_LIBRARIES} ${GNURADIO_PMT_LIBRARIES} ${GNURADIO_RUNTIME_LIBRARIES} ${GNURADIO_FILTER_LIBRARIES} ${GNURADIO_DIGITAL_LIBRARIES} ${GNURADIO_ANALOG_LIBRARIES} ${GNURADIO_AUDIO_LIBRARIES} ${GNURADIO_UHD_LIBRARIES} ${UHD_LIBRARIES} ${GNURADIO_BLOCKS_LIBRARIES} ${GNURADIO_OSMOSDR_LIBRARIES} ) # gRPC::grpc++_reflection protobuf::libprotobuf)

#target_link_libraries(trunk-recorder PRIVATE nlohmann_json::nlohmann_json )

message(STATUS "All libraries:" ${GNURADIO_ALL_LIBRARIES})
if(NOT Gnuradio_VERSION VERSION_LESS "3.8")
Expand Down
45 changes: 35 additions & 10 deletions docs/CONFIGURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -411,35 +411,60 @@ The matching simplestream config to send audio from talkgroup 58918 to TCP port

This file provides info on the different talkgroups in a trunking system. A lot of this info can be found on the [Radio Reference](http://www.radioreference.com/) website. You need to be a Radio Reference member to download the table for your system preformatted as a CSV file. You can also try clicking on the "List All in one table" link, selecting everything in the table and copying it into a spreadsheet program, and then exporting or saving as a CSV file.

**Note:** You can use the direct CSV from Radio Reference for talk groups, but setting priority is not supported with this file format. If you need to use the Priority field, you'll need to reorder the CSV to match the format described below.
**Note:** You can use the direct CSV from Radio Reference for talk groups. You will need to add the Priority column if you are going to be using that.

You may add an additional column that adds a priority for each talkgroup. The priority field specifies the number of recorders the system must have available to record a new call for the talkgroup. For example, a priority of 1, the highest means as long as at least a single recorder is available, the system will record the new call. If the priority is 2, the system would at least 2 free recorders to record the new call, and so on. If there is no priority set for a talkgroup entry, a prioity of 1 is assumed.
A Header row is required on the first line of the CSV file. The supported column names are: "Decimal", "Mode", "Description","Alpha Tag", "Hex", "Category", "Tag", "Priority", "Preferred NAC"

Talkgroups assigned a priority of -1 will never be recorded, regardless of the number of available recorders.
The first column must be the "Decimal" column.

Trunk Recorder really only uses the priority information and the decimal talkgroup ID. The Website uses the same file though to help display information about each talkgroup.
The columns are:

Here are the column headers and some sample data: NOTE: If you are adding the Priority to a RR csv, as well as changing order you must use a heading for the first column other than "Decimal" eg DEC for TR to detect you are supplying this layout.
| Column Name | Required | Value |
|-------------|----------|-------|
| Decimal | ✔️ | The Talkgroup Number formatted as a decimal number. |
| Mode | ✔️ | Mode defines the type of transmission broadcast on this talkgroup. Analog transmissions are standard voice, Digital and TDMA transmissions are digitally modulated. <br />A = Analog Talkgroup<br />D = Digital Talkgroup<br />M = Mixed Analog/Digital<br />T = TDMA Capable Talkgroup<br />--<br />A trailing lowercase e represents partial encryption. A trailing uppercase E represents full encryption. |
| Description | ✔️ | The description of the talkgroup |
| Alpha Tag | | A 16 character description that is intended as a shortened display on radio displays |
| Hex | | The Talkgroup Number formatted as a hex number. This value is currently not used. |
| Category | | The category for the Talkgroup |
| Tag | | The Service Tag for the Talkgroup |
| Priority | | The priority field specifies the number of recorders the system must have available to record a new call for the talkgroup. For example, a priority of 1, the highest means as long as at least a single recorder is available, the system will record the new call. If the priority is 2, the system would at least 2 free recorders to record the new call, and so on. If there is no priority set for a talkgroup entry, a prioity of 1 is assumed. <br/> Talkgroups assigned a priority of -1 will never be recorded, regardless of the number of available recorders. |
| Preferred NAC | | In Multi-Site mode, the preferred NAC for a specific talk group is used to specify the site you prefer the talk group to be recorded from.|
| Comment | | Use this field to capture comments about a talkgroup. It will be ignored by Trunk Recorder. |

| DEC | HEX | Mode | Alpha Tag | Description | Tag | Group | Priority | PreferredNAC (optional) |
Here are the column headers and some sample data:

| Decimal | Hex | Mode | Alpha Tag | Description | Tag | Category | Priority | Preferred NAC |
|-----|-----|------|--------------|----------------|----------------|----------|----------|-------------------------|
|101 | 065 | D | DCFD 01 Disp | 01 Dispatch | Fire Dispatch | Fire | 1 | 1000 |
|2227 | 8b3 | D | DC StcarYard | Streetcar Yard | Transportation | Services | 3 | 1001 |

In Multi-Site mode, the preferred NAC for a specific talk group is used to specify the site you prefer the talk group to be recorded from.

## channelFile

This file allows for you to specify additional information about conventional channels. A recorder is started for each line in the file and set the to frequency specified. The type of recorder is based on the type of System. A **Conventional** system would have Analog Recorders, while **ConventionalP25** or **ConventionalDMR** would have digital recorders.

*Tone based squelch is currently not supported.*


| Column Name | Required | Value |
|-------------|----------|-------|
| TG Number | ✔️ | The Talkgroup Number formatted as a decimal number. This has to be the first column |
| Frequency | ✔️ | The frequency in Hz for the channel |
| Tone | ✔️ | The Tone for the talkgroup. This value is not used. *Tone based squelch is currently not supported.* |
| Alpha Tag | | A 16 character description that is intended as a shortened display on radio displays |
| Category | | The category for the Talkgroup |
| Tag | | The Service Tag for the Talkgroup |
| Comment | | Use this field to capture comments about a talkgroup. It will be ignored by Trunk Recorder. |
| Enable | | Set to 'false' if you do not want this talkgroup/channel to created |


The **Enable** Column is optional and defaults to *True*. It only needs to be added to rows that you do not want to have recorded. For those rows, set **Enable** to *False*.

| TG Number | Frequency | Tone | Alpha Tag | Description | Tag | Group | Enable (*optional*) |
| TG Number | Frequency | Tone | Alpha Tag | Description | Tag | Category | Enable (*optional*) |
| --------- | --------- | -------- | ------------- | ---------------------- | ------ | ------ | ------------------- |
| 300 | 462275000 | 94.8 PL | Town A Police | Town A Police Dispatch | Police | Town A | |
| 325 | 462275000 | 151.4 PL | Town B DPW | Town B Trash Dispatch | DPW | Town B | False |
| 300 | 462275000 | 94.8 | Town A Police | Town A Police Dispatch | Police | Town A | |
| 325 | 462275000 | 151.4 | Town B DPW | Town B Trash Dispatch | DPW | Town B | False |


## unitTagsFile
Expand Down
Loading

0 comments on commit 47460b1

Please sign in to comment.