bcfy-pi/trunk-recorder Failed parsing Config

Status
Not open for further replies.

kslager

Member
Feed Provider
Joined
Sep 11, 2010
Messages
46
This is all new and over my head, but slow seem like im making some progress. I am using the Canakit pi 4gb starter pro with the Broadcastify feed appliance image with one of those sliver RTL-SDR's. I am trying to use get a P25 Phase 2 system going.

Here is what I get when I try and start the service:
Starting trunk-recorder...
\u25cf trunk-recorder.service - BCFY Trunk Recorder Service
Loaded: loaded (/etc/systemd/system/trunk-recorder.service; disabled; vendor preset: enabled)
Active: activating (auto-restart) (Result: exit-code) since Sun 2021-04-11 14:53:03 CDT; 1s ago
Process: 3224 ExecStart=/bin/sh -c /home/pi/bcfy/trunk-recorder/recorder --config=/home/pi/bcfy/configs/trunk-recorder/config.json >> /home/pi/bcfy/logs/trunk-recorder.log 2>&1 (code=exited, status=1/FAILURE)
Main PID: 3224 (code=exited, status=1/FAILURE)
Press [Enter] to return to the main menu...

When I look in the log file, this has been what I am finding currently:
[2021-04-11 14:53:03.714961] (error) Failed parsing Config: /home/pi/bcfy/configs/trunk-recorder/config.json(13): expected key string
[2021-04-11 14:53:34.106202] (info) Using Config file: /home/pi/bcfy/configs/trunk-recorder/config.json

Here is my current config.json I am playing with:

{
"ver": 2,
"sources": [{
"center": 774000000.0,
"rate": 2048000,
"ppm": 69.0,
"gain": 35.0,

"digitalRecorders": 4,
"driver": "osmosdr",
"device": "",

}],
"systems": [{
"modulation": "qpsk"
"digitalLevels": 3,
"control_channels": [774343750],
"type": "p25",
"shortName": "mySystemName",
"broadcastifyApiKey": "retracted",
"broadcastifySystemId": "retracted",
"audioArchive": false
}],
"broadcastifyCallsServer": "https://api.broadcastify.com/call-upload",
"controlWarnRate": 5,
"callTimeout": 0.75
}

No, I don't really have retracted for the ApiKey or SystemId. Any ideas what direction I need to go next?
 

blantonl

Founder and CEO
Staff member
Super Moderator
Joined
Dec 9, 2000
Messages
11,120
Location
San Antonio, Whitefish, New Orleans
you are missing a comma after "qpsk"

you'll probably to set device to rtl=0 or the serial number if you flashed the rtl device with a custom serial number

Try this:

Code:
{
    "ver": 2,
    "sources": [{
        "center": 774000000.0,
        "rate": 2048000,
        "ppm": 69.0,
        "gain": 35.0,
        "digitalRecorders": 4,
        "driver": "osmosdr",
        "device": "rtl=0"
    }],
    "systems": [{
        "modulation": "qpsk",
        "digitalLevels": 3,
        "control_channels": [774343750],
        "type": "p25",
        "shortName": "mySystemName",
        "broadcastifyApiKey": "retracted",
        "broadcastifySystemId": "retracted",
        "audioArchive": false
    }],
    "broadcastifyCallsServer": "https://api.broadcastify.com/call-upload",
    "controlWarnRate": 5,
    "callTimeout": 0.75
}
 

kslager

Member
Feed Provider
Joined
Sep 11, 2010
Messages
46
you are missing a comma after "qpsk"

you'll probably to set device to rtl=0 or the serial number if you flashed the rtl device with a custom serial number

Try this:

So that got me going along further. Thank you. It now says 'Started BCFY Truck Recorder Service' In the BCFY Shell, and when I back out and go to Start/Stop services, it says 'active (running) for Trunk Recorder Instance #1.

On the Manage Calls System Node page on Broadcastify.com, I am showing that the node has never been online.

On a side note, I can see the control channel going in Gqrx and some channels light light up when they start talking - corresponding with what I am hearing on the scanner. I cant seem to hear anything though from the pi. I plugged in my external speakers from my PC and did try turning up the volume on the TV I'm using as a monitor. I did try changing a line in the config.json file to "device": "rtl=00000001" to correlate with what Gqrx input was showing as what I believe my serial number may be (Realtek RTL2838UHIDIR SN: 00000001).

Any suggestions?
 

kslager

Member
Feed Provider
Joined
Sep 11, 2010
Messages
46
[2021-04-11 16:33:53.004393] (error) [mySystemName] There is only one control channel defined
[2021-04-11 16:33:53.004516] (error) [mySystemName] Control Channel Message Decode Rate: 1/sec, count: 3
 

blantonl

Founder and CEO
Staff member
Super Moderator
Joined
Dec 9, 2000
Messages
11,120
Location
San Antonio, Whitefish, New Orleans
You aren't properly tuning the control channel.

Looks like you are using the ppm of "69" which was the one in the template - and not the one that is specific to your RTL dongle. You need to determine the ppm settings for your specific RTL dongle.

You can do this in two ways.

1) Open GQRX and tune to the control channel of the site, or NOAA Weather Radio (162.550 or 162.4000 etc), and adjust the PPM until the signal is centered or

2) Run rtl_test -p for at least 10 minutes and use the average or most reported cumulative PPM setting towards the end of the 10 min period.

Code:
pi@bcfy-1fe4ab4a:~ $ rtl_test -p
Found 1 device(s):
  0:  Realtek, RTL2838UHIDIR, SN: 1003

Using device 0: Generic RTL2832U OEM
Detached kernel driver
Found Rafael Micro R820T tuner
Supported gain values (29): 0.0 0.9 1.4 2.7 3.7 7.7 8.7 12.5 14.4 15.7 16.6 19.7 20.7 22.9 25.4 28.0 29.7 32.8 33.8 36.4 37.2 38.6 40.2 42.1 43.4 43.9 44.5 48.0 49.6
[R82XX] PLL not locked!
Sampling at 2048000 S/s.
Reporting PPM error measurement every 10 seconds...
Press ^C after a few minutes.
Reading samples in async mode...
Allocating 15 zero-copy buffers
lost at least 52 bytes
real sample rate: 2047878 current PPM: -59 cumulative PPM: -59
real sample rate: 2047967 current PPM: -16 cumulative PPM: -38
real sample rate: 2048304 current PPM: 149 cumulative PPM: 25
real sample rate: 2048139 current PPM: 68 cumulative PPM: 36
...
10 minutes later
.....
real sample rate: 2048086 current PPM: 42 cumulative PPM: 57
real sample rate: 2048319 current PPM: 156 cumulative PPM: 61
real sample rate: 2048142 current PPM: 69 cumulative PPM: 61
real sample rate: 2048124 current PPM: 61 cumulative PPM: 61
real sample rate: 2048131 current PPM: 64 cumulative PPM: 61
real sample rate: 2047857 current PPM: -69 cumulative PPM: 57
real sample rate: 2048235 current PPM: 115 cumulative PPM: 59
real sample rate: 2048305 current PPM: 149 cumulative PPM: 61

For example above, I would probably go with 60.
 

kslager

Member
Feed Provider
Joined
Sep 11, 2010
Messages
46
You aren't properly tuning the control channel.

Looks like you are using the ppm of "69" which was the one in the template - and not the one that is specific to your RTL dongle. You need to determine the ppm settings for your specific RTL dongle.

You can do this in two ways.

1) Open GQRX and tune to the control channel of the site, or NOAA Weather Radio (162.550 or 162.4000 etc), and adjust the PPM until the signal is centered or

2) Run rtl_test -p for at least 10 minutes and use the average or most reported cumulative PPM setting towards the end of the 10 min period.

I came up with -2 using method 1, and -4 using method 2 (I do now see where 69 would have been way off frequency). However, I am still having issues. BCFY Shell is showing active (running) for Trunk Recorder Instance #1, Manage Calls System page for the node is showing never seen. BCD996P2 on same antenna/control frequency is working away just fine.
 

kslager

Member
Feed Provider
Joined
Sep 11, 2010
Messages
46
I can't seem to get any audio from this Canakit pi4. I don't know if this is related or not. I wouldn't think so, but then again I don't know.

I launched a traditional feed in Chromium. In PulseAudio Volume Control, I can see the Chromium 'meter' bouncing around, correlating to what I am hearing on a scanner. I can't hear anything on the TV that I am using as a monitor, nor when I plug the speakers from my windows PC to the 4 pole jack. Anyways, I ordered another pi4 kit to mess with.
 

blantonl

Founder and CEO
Staff member
Super Moderator
Joined
Dec 9, 2000
Messages
11,120
Location
San Antonio, Whitefish, New Orleans
Looks like
I came up with -2 using method 1, and -4 using method 2 (I do now see where 69 would have been way off frequency). However, I am still having issues. BCFY Shell is showing active (running) for Trunk Recorder Instance #1, Manage Calls System page for the node is showing never seen. BCD996P2 on same antenna/control frequency is working away just fine.
Trunk Recorder is running, it just doesn't seem to be decoding anything. The Manage Calls page will only show your system as known and receiving if you actually start decoding and receiving calls. The trunk recorder log will give you details.

If you are seeing this below then you aren't getting any decode. Try adjusting the gain or moving the antenna.

[2021-04-11 16:33:53.004393] (error) [mySystemName] There is only one control channel defined [2021-04-11 16:33:53.004516] (error) [mySystemName] Control Channel Message Decode Rate: 1/sec, count: 3

Use GQRX to tweak your gain and PPM settings on the control channel for the system to make sure you are getting a decent centered signal. Zoom in and make sure that you are dead center on the control channel with a strong signal. Record those Gain and PPM settings and use those in the trunk-recorder config.
 

Kingscup

Member
Feed Provider
Joined
Jun 1, 2006
Messages
599
Change the rate to 2048000.0 and see if that works. Or, you may have too many zeroes. Remove the .0s from the equation. Don’t forget delete the last zero in the control channel if you do this. I am just going by the example for the rtl-sdr for trunk recorder in the link. robotastic/trunk-recorder

I just noticed this. Delete the comma after “device”.
 
Last edited:

kslager

Member
Feed Provider
Joined
Sep 11, 2010
Messages
46
Use GQRX to tweak your gain and PPM settings on the control channel for the system to make sure you are getting a decent centered signal. Zoom in and make sure that you are dead center on the control channel with a strong signal. Record those Gain and PPM settings and use those in the trunk-recorder config.

The node ingest is up and running. It seemed to be a gain issue. But unfortunately, I used a Guess/Test/Revise method, so I am not fully tuned in. But it sounds halfway decent.

When I look at the small graph on GQRX (View, Audio tab) the bottom right hand side of the screen, I am not seeing any data being plotted like I see on some of the tutorials on Youtube. I do see a gain slide right below that, and sliding that does nothing. Every now and then, it looks like there might be something off the charts on the bottom?

Gain 1 was not working. 5 all garbled. 10 and 15 seem to be doing alright. I will be switching back out of GQRX and trying another value here soon.
 

kslager

Member
Feed Provider
Joined
Sep 11, 2010
Messages
46
PPM and Gain Settings are here in GQRX. These are the two components you need to worry about.

Thank you. I see the LNA slider. I'm guess I should slide that slider so the peak of the control channel frequency is to a certain optimal level on the left of the top graph? On your example, 32 dB on the slider is about -20 for the peak. Is that about optimal for what what the software is wanting, -20?
 

blantonl

Founder and CEO
Staff member
Super Moderator
Joined
Dec 9, 2000
Messages
11,120
Location
San Antonio, Whitefish, New Orleans
You are looking for a good solid signal with no adjacent overloading of noise or intermod. that could be an LNA gain setting of anywhere from the mid 20’s to the Max of 49.6 based on your antenna setup and RR environment.
 

HarryWilly

Member
Joined
Jul 4, 2007
Messages
270
2) Run rtl_test -p for at least 10 minutes and use the average or most reported cumulative PPM setting towards the end of the 10 min period.

So I tried this myself and ended up with -3 and -2 for two different dongles, but when I went to use this in the config file, I couldn't get Trunk Recorder to decode the CC properly (using "ppm": -3, as an example)

Can you help shed a little more light on this - sounds like it would be a useful tool for those of us who want an appliance with a CLI install only

I had to go back to plugging the dongles into a computer with SDR# and just watching the drift after 10 minutes and using the frequency offset in Hz
 

RaleighGuy

Member
Premium Subscriber
Joined
Jul 15, 2014
Messages
13,309
Location
Raleigh, NC
Will someone please check my config file, I'm having the same problem getting it to work.

Starting trunk-recorder...
\u25cf trunk-recorder.service - BCFY Trunk Recorder Service
Loaded: loaded (/etc/systemd/system/trunk-recorder.service; disabled; vendor preset: enabled)
Active: activating (auto-restart) (Result: exit-code) since Sat 2021-05-01 12:04:54 EDT; 1s ago
Process: 14632 ExecStart=/bin/sh -c /home/pi/bcfy/trunk-recorder/recorder --config=/home/pi/bcfy/configs/trunk-recorder/config.json >> /home/pi/bcfy/logs/trunk-recorder.log 2>&1 (code=exited, status=1/FAILURE)
Main PID: 14632 (code=exited, status=1/FAILURE)


Checked my PPM and Gain, and shows good signal in Gqrx. I'm sure it is me, since I have no clue what I'm doing. Using Pi4 with 8gb, running one feed using scanner, and trying to set up a second Calls feed with SDR (serial number 00000004) this is a motorola type II system (Wake Co NC TRS). Note: One CC omitted as it is being used for the new P25 system they are in the process of setting up.

{
"ver": 2,
"sources": [{
"center": 852150000.0,
"rate": 2048000,
"ppm": 0.0,
"lGain": 39.6,
"digitalLevels": 4,
"digitalRecorders": 4,
"driver": "osmosdr",
"device": "rtl=0,buflen=65536"
"modulation": "FSK4"
}],
"systems": [{
"control_channels": [853537500,853787500,853150000,853762500],
"type": "T-P25",
"shortName": "Wake County (Wake County Simulcast)",
"modulation": "qpsk",
"broadcastifyApiKey": "d455687f-aa24-11eb-ba68-0xxxxx",
"broadcastifySystemId": "840"
"audioArchive": false

}],
"broadcastifyCallsServer": "https://api.broadcastify.com/call-upload",
"frequencyFormat": "mhz",
"captureDir": "/home/pi/bcfy/audio",
"controlWarnRate": "10",
"callTimeout": "1"
}
 
Last edited:

Kingscup

Member
Feed Provider
Joined
Jun 1, 2006
Messages
599
I am not an expert as I provide an analog feed but I see a couple of things.

/home/pi/bcfy/logs/trunk-recorder.log will tell you what line your config file is having a problem.

You have 2 different modulations. I believe you don't need the one under "sources". If you do, put a comma at the end of the device line.

Put a comma at the end of the "broadcastifySystemId" line.

Type should be p25.

Should be ifGain.
 

RaleighGuy

Member
Premium Subscriber
Joined
Jul 15, 2014
Messages
13,309
Location
Raleigh, NC
I am not an expert as I provide an analog feed but I see a couple of things.

/home/pi/bcfy/logs/trunk-recorder.log will tell you what line your config file is having a problem.

You have 2 different modulations. I believe you don't need the one under "sources". If you do, put a comma at the end of the device line.

Put a comma at the end of the "broadcastifySystemId" line.

Type should be p25.

Should be ifGain.

Made corrections and I think that did it. However, when I check the status it shows Disabled on bottom line and still not showing in the CALLS feed list, what is the Disabled?

>>> Trunk Recorder Instances <<<
----------------------------------------------------------------------------
Item Status Instance
Boot
----------------------------------------------------------------------------
[2] active (running) Trunk Recorder Instance #1
disabled
 

Kingscup

Member
Feed Provider
Joined
Jun 1, 2006
Messages
599
I believe disabled is the status of Trunk Recorder on reboot. There is an option to start up Trunk Recorder automatically when the RPi reboots.
 

Kingscup

Member
Feed Provider
Joined
Jun 1, 2006
Messages
599
Let me clarify my answer. If the RPi, shuts down and reboots for any reason (i.e. power failure), this option allows the RPi to start up Trunk Recorder without any interaction from you.

On the main screen of the appliance shell where you can start/stop services, press 1. Next screen press the number that has Trunk Recorder. Next screen has the option to enable/disable start on boot. Pick on enable start on boot. Go back to the main screen and pick show status. It should not be enabled if you picked that option earlier.
 
Status
Not open for further replies.
Top