Trunk Recorder & Rdio Scanner: Ubuntu Docker install for the n00b

Status
Not open for further replies.

polkaroo

Missed him again!
Joined
Apr 14, 2002
Messages
420
Reaction score
93
I'm trying to wrap my head around running Trunk Recorder and Rdio Scanner on Ubuntu Server 20.04. I can find myself slowly around linux but not an engineer or claim to know anything about programming, so I'm requesting a bit of hand-holding here. I've searched and searched but things are simply fragmented, links to outdated tutorials or dead ends, etc. and getting quite frustrated.

My goal is to run trunk-recorder on two P25 systems and serve it up via rdio-scanner.

I'm stuck somewhere between the first and second post of this thread How I Setup Trunk Recorder Using Docker - Suggested Deployment For Calls Platform, where I've setup my SDR sticks (1st post) and have Trunk-Recorder in Docker setup (2nd post). And I have no idea how to build? a proper Docker container after I've grabbed the Git repository. But afaik the robotastic/trunk-recorder container works, it's just it can't find the config files (see step 7 below).

I've looked at the Wiki instructions here: robotastic/trunk-recorder but it doesn't even tell me how to pull it off Docker hub, then jumps to straight past config.json and running already: robotastic/trunk-recorder

The Gitter Lobby trunk-recorder/Lobby makes my brain explode - there's no method to the madness (I thought Microsoft Teams was bad enough.) No threading or searching, I'm sure someone has asked a similar question like this before, I just can't find it!


Hopefully I've documented my steps clearly enough. (elevated su privileges.)

Ubuntu Server 20.04:
  1. Update package list and upgrade to latest and greatest
    $ apt update
    ...
    $ apt upgrade


  2. Install docker
    $ apt install docker

  3. Check docker install with hello-world
    $ docker run hello-world
    Hello from Docker!
    This message shows that your installation appears to be working correctly.
    ...


  4. Install RTL-SDR modules
    $ apt install rtl-sdr

  5. Plug in SDR sticks and yes it works
    $ rtl_eeprom
    Found 2 device(s):
    0: Generic RTL2832U OEM
    1: Generic RTL2832U OEM
    ...


  6. Install trunk-recorder’s Docker image
    $ docker pull robotastic/trunk-recorder
    Using default tag: latest
    latest: Pulling from robotastic/trunk-recorder
    04a5f4cda3ee: Pull complete
    ff496a88c8ed: Pull complete
    0ce83f459fe7: Pull complete
    58ebfd16f5c3: Pull complete
    e16b9adec51f: Pull complete
    e1df2917d4eb: Pull complete
    0e2ef27b4858: Pull complete
    e22f9b1a6e60: Pull complete
    Digest: sha256:45693501c4960d8c8c99af6818ee69d7b2d506c91098b68713aac16e690b90d6
    Status: Downloaded newer image for robotastic/trunk-recorder:latest
    docker.io/robotastic/trunk-recorder:latest



  7. Following instructions at robotastic/trunk-recorder, (radio is my username). I assume this is to map a directory for trunk-recorder in Docker to access?
    docker run -it \
    -v ~/trunk-recorder/media:/app/media \
    -v ~/trunk-recorder:/app/config \
    -v ~/trunk-recorder/my_talkgroup.csv:/app/my_talkgroup.csv \
    --device /dev/bus/usb robotastic/trunk-recorder:latest


    gives me docker: unknown server OS: .

  8. Make the config.json file in ~/trunk-recorder/ anyway but no joy.

    $ docker run robotastic/trunk-recorder
    [2021-04-14 05:09:01.173484] (info) Using Config file: /app/config.json
    [2021-04-14 05:09:01.173839] (error) Failed parsing Config: /app/config.json: cannot open file

So this is where I'm stuck and I'm not sure what to do next.
 

DC31

Member
Feed Provider
Joined
Feb 19, 2011
Messages
1,632
Reaction score
177
Location
Massachusetts
Have you tried running Step 7 without elevated su privileges?

 

polkaroo

Missed him again!
Joined
Apr 14, 2002
Messages
420
Reaction score
93
If I do it without elevated privileges, I get this:

$ docker run robotastic/trunk-recorder
docker: Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Post http://%2Fvar%2Frun%2Fdocker.sock/v1.40/containers/create: dial unix /var/run/docker.sock: connect: permission denied.
See 'docker run --help'.

$ sudo docker run robotastic/trunk-recorder
[2021-04-15 04:04:46.373501] (info) Using Config file: /app/config.json
[2021-04-15 04:04:46.454616] (error) Failed parsing Config: /app/config.json: cannot open file
 

lynchy135

Member
Joined
Jul 31, 2019
Messages
162
Reaction score
77
what does cat ~/trunk-recorder/config.json look like, does it show the file? Is the config.json file in ~/trunk-recorder/.
If it is, you can try mounting that file directly.
Code:
docker run -it \
-v ~/trunk-recorder/media:/app/media \
-v ~/trunk-recorder:/app/config \
-v ~/trunk-recorder/config.json:/app/config.json \
-v ~/trunk-recorder/my_talkgroup.csv:/app/my_talkgroup.csv \
--device /dev/bus/usb robotastic/trunk-recorder:latest
 

polkaroo

Missed him again!
Joined
Apr 14, 2002
Messages
420
Reaction score
93
Yes, the command shows the config.json file and is indeed in ~/trunk-recorder (full path is /home/radio/trunk-recorder/config.json).

I just don't know what I did wrong so I can try to learn from it. I've reinstalled Ubuntu from scratch and tried again with the same results. I guess everyone else's system works just fine. I was hoping to leave the laptop remotely and have it feed a rdio-scanner instance I'd host at home, but I'm afraid if I can't even get this running, I wouldn't be able to keep it unattended and stable.
 

lynchy135

Member
Joined
Jul 31, 2019
Messages
162
Reaction score
77
Try running the full path. It could be because your running it in sudo that ~/ isn't /home/radio but rather /root.

So run this
Code:
docker run -it \
-v /home/radio/trunk-recorder/media:/app/media \
-v /home/radio/trunk-recorder:/app/config \
-v /home/radio/trunk-recorder/config.json:/app/config.json \
-v /home/radio/trunk-recorder/my_talkgroup.csv:/app/my_talkgroup.csv \
--device /dev/bus/usb robotastic/trunk-recorder:latest


Alternatively, trunk-recorder does have a background option via systemd. Directions are in robotastic/trunk-recorder/examples/trunk-recorder.service (make sure to read the comments at the bottom). You need to make sure that you add the auto restart script.

Once you add those you can do
Code:
sudo systemctl daemon-reload #reloads systemd and should add new services
sudo systemctl enable trunk-recorder.service #enables the service on boot (it will start on bootup)
sudo systemctl start trunk-recorder.service #starts the service

#then to stop or restart
sudo systemctl stop trunk-recorder
sudo systemctl restart trunk-recorder
 

polkaroo

Missed him again!
Joined
Apr 14, 2002
Messages
420
Reaction score
93
I've given up on a Linux-based system, and went with Docker on Windows 10. Got much further... SDR-Trunk to a local Windows directory and Rdio-Scanner in a container. UI is accessible on another computer but Rdio-Scanner isn't playing any recordings. I've asked for help in the Gitter lobby.

But this is what I did:
  1. In your BIOS settings, enable Virtualization Technology VTx.
  2. Go to Start>Settings>Apps & Features>Optional Features>More Windows features
    Make sure Hyper-V and Windows Subsystem for Linux are checked and installed. Not installing this will run Rdio-Scanner but the Docker container won't be able to access the remapped Windows folder for config files.

    Full instructions for enabling Hyper-V and WSL: Logs and troubleshooting
  3. Install Docker for Windows and make a Docker Hub account
  4. Install Rdio-Scanner by opening up an elevated Powershell window
    > docker pull chuot/rdio-scanner
  5. Initialize Rdio-Scanner and map local Windows directory to /app/data in the rdio-scanner container
    > docker run -it -v c:/pathto/rdio-scanner:/app/data chuot/rdio-scanner init
    If docker returns Configuration and database initialized, then you should see config.json and database.sqlite in the Windows directory. You may also get a notification pop up about WSL access.

    -it creates an interactive terminal so you see the program running. Replacing -it with -d runs Docker in detached mode so it runs in the background and you're immediately returned to the command prompt. You can still observe the terminal output if you use the Windows Docker app and go to the Containers/Apps>rdio-scanner>Logs part of the app.
    -v c:/pathto/rdio-scanner:/app/data maps /rdio-scanner in your user home directory to /app/data in the Docker container. Syntax is always host:container.
    chuot/rdio-scanner is the Docker container to run.
  6. Check if rdio-scanner can run!
    > docker run -d -p 80:3000 -v c:/pathto/rdio-scanner:/app/data chuot/rdio-scanner
    -d
    see above (versus -it)
    -p 80:3000 maps port 80 of the Windows host to port 3000 of the Docker container so I just go directly to the IP address of the Windows machine to access the Rdio-Scanner website. You can also check the Logs section of the Windows Docker app.
  7. Continue at step 4 at chuot/rdio-scanner to load system and talkgroup info. Note that options --rm --user $(id -u):$(id -g) are not valid in Windows Docker so don't type them out. Won't screw anything up, Docker will just return an error.
  8. ... this is where I'm stuck. Everything seems to be config'd properly but just nothing in the web player.
 

polkaroo

Missed him again!
Joined
Apr 14, 2002
Messages
420
Reaction score
93
... this is where I'm stuck. Everything seems to be config'd properly but just nothing in the web player.

Turns out dirWatch syntax is different from the examples. I don't know if this is because of Docker on Windows? Major differences is no comma after type, and a comma after the last ]. Otherwise Docker will spit out errors. Also deleteAfter must be true.

"dirWatch": [
{
"deleteAfter": true,
"directory": "/app/recordings",
"extension": "mp3",
"type": "sdr-trunk"
}
],


Each time Rdio-Scanner imports a file, it will be seen in the Logs window of Docker as such:
NewCall: system=<id> talkgroup=<tgid> file=<file> Success

So at this point, I got existing MP3s to import and play, but new MP3s after Rdio-Scanner starts doesn't play.
 
Status
Not open for further replies.
Top