robotastic / trunk-recorder

Records calls from a Trunked Radio System (P25 & SmartNet)
GNU General Public License v3.0
872 stars 195 forks source link

`Failed parsing Config: stod` is less than useful #729

Open ZeroChaos- opened 2 years ago

ZeroChaos- commented 2 years ago
zero@theprophet trunk-recorder-configs % trunk-recorder --config=something.json                                                                                (git)-[main] 
[2022-10-06 10:38:06.174185] (info)   Using Config file: something.json
[2022-10-06 10:38:06.174205] (info)   Trunk-Recorder: Version: 4.4.1
[2022-10-06 10:38:06.174379] (info)   
-------------------------------------
     Trunk Recorder
-------------------------------------
[2022-10-06 10:38:06.174387] (info)   

-------------------------------------
INSTANCE
-------------------------------------
[2022-10-06 10:38:06.174394] (info)   Capture Directory: /tmp/tr
[2022-10-06 10:38:06.174399] (info)   Upload Server: 
[2022-10-06 10:38:06.174403] (info)   Broadcastify Calls Server: 
[2022-10-06 10:38:06.174407] (info)   Status Server: 
[2022-10-06 10:38:06.174411] (info)   Instance Key: 
[2022-10-06 10:38:06.174414] (info)   Instance Id: 
[2022-10-06 10:38:06.174418] (info)   Broadcast Signals: false
[2022-10-06 10:38:06.174423] (info)   Default Mode: digital
[2022-10-06 10:38:06.174447] (info)   Call Timeout (seconds): 3
[2022-10-06 10:38:06.174451] (info)   Log to File: false
[2022-10-06 10:38:06.174456] (info)   Log Directory: logs
[2022-10-06 10:38:06.174459] (info)   Control channel warning rate: 10
[2022-10-06 10:38:06.174464] (info)   Control channel retune limit: 0
[2022-10-06 10:38:06.174468] (info)   Enable Audio Streaming: false
[2022-10-06 10:38:06.174472] (info)   Record Unit to Unit Voice Calls: true
[2022-10-06 10:38:06.174477] (info)   Frequency format: exp
[2022-10-06 10:38:06.174481] (info)   Status as String: true
[2022-10-06 10:38:06.174486] (info)   Log Level: info
[2022-10-06 10:38:06.174491] (info)   
-------------------------------------
SYSTEMS
-------------------------------------
[2022-10-06 10:38:06.174502] (info)   

System Number: 1
-------------------------------------
[2022-10-06 10:38:06.174506] (info)   Short Name: dmr
[2022-10-06 10:38:06.174511] (info)   System Type: conventionalDMR
[2022-10-06 10:38:06.174516] (info)   Channel File: channels.csv
[2022-10-06 10:38:06.174520] (info)   Loading Talkgroups...
[2022-10-06 10:38:06.174603] (error)   Failed parsing Config: stod

Min test case json

{
    "ver": 2,
    "sources": [
        {
            "center": 464000000.0,
            "rate": 2048000.0,
            "error": 0,
            "gain": 40,
            "driver": "osmosdr",
            "device": "rtl=0,buflen=32768"
        }
    ],
    "systems": [
      {
        "channelFile": "channels.csv",
        "talkgroupDisplayFormat": "tag_id",
        "type": "conventionalDMR",
        "callLog": true,
        "audioArchive": true,
        "minDuration": 1,
        "shortName": "dmr",
        "digitalLevels": 1,
        "uploadScript": "./encode-upload.sh",
        "compressWav": false,
        "squelch": -20
      }
    ],
  "captureDir": "/tmp/tr"
}

Min test case channels.csv

0123,464100000,,shortname,longname,whatever,bob
ZeroChaos- commented 2 years ago

I have no idea what's wrong. Trunk Recorder refuses to load. Kneel before Stod!

ZeroChaos- commented 2 years ago

Ugh, I found it. This is an incarnation of https://github.com/robotastic/trunk-recorder/issues/724

Min broken case

0123,464100000,,shortname,longname,whatever,bob

Min working case

0123,464100000,100 PL,shortname,longname,whatever,bob

Basically, if you don't have something in for tone, it fails. This is broken for a lot of reasons.

1.) Not every analog station uses tones 2.) channelFile is used by conventionalDMR and conventionalP25 which don't use tones.

I know the tone stuff is a no-op at this moment, but when that support is added, the digital modes will all break since the tone won't ever be detected.

robotastic commented 1 year ago

ok - the easy fix for this is to improve the parsing of the Channels file so it can handle the tone field being empty.

A better fix is probably looking at how we handle digital conventional channels... to the point in #724 - maybe we don't really need a channels file for conventional digital.

EricTendian commented 1 year ago

I also ran into this, though my issue was that my CSV included the column headers as shown on https://github.com/robotastic/trunk-recorder/blob/master/docs/CONFIGURE.md#channelfile but actually there shouldn't be any headers in the CSV.

taclane commented 1 year ago

A better fix is probably looking at how we handle digital conventional channels... to the point in #724 - maybe we don't really need a channels file for conventional digital.

I can't speak for all conventional digital systems, but it is fairly common for conventional P25 deployments to use the default talkgroup (1) across everything. For instance, the only way to discriminate Police (TG 1) from Fire (TG 1) is by the frequency used. Using a channel.csv to assign metadata by frequency is a reasonable solution for both conventional and conventional p25.

As far as conventional DMR or other single-frequency trunks, I don't have any in my area, but it does sound like they operate in a way that would benefit more from a talkgroup.csv. Maybe depending on whether a talkgroupsFile or channelFile is specified, it can drive whether a system looks up metadata by TG or frequency?