OP25 Automate start of OP25 upon reboot?

Status
Not open for further replies.

gskroll

Member
Premium Subscriber
Joined
Jun 17, 2005
Messages
96
Location
Portland, ME
I am successfully monitoring Portland, ME's P25 Phase 1 Public Safety system using op25 running on a Raspberry Pi 3B using a command line of ./portland.sh containing:

#!/bin/bash
/home/pi/scanner/rx.py \
--args 'rtl' \
--gains 'lna:32' \
--fine-tune 430 \
-D cqpsk \
-l http:127.0.0.1:8080 \
-P constellation \
-S 960000 \
-T /home/pi/scanner/trunk.tsv \
-v 1 \
-U \
-2 \
2>stderr.2

I had created a symlink(?) of "scanner"to simplify navigation to the .sh and .tsv files using:

ln -s /home/pi/op25/op25/gr-op25_repeater/apps /home/pi/scanner

I had been opening a Terminal and typing:

cd scanner
./portland.sh

to start monitoring the Portland, ME system.


All is working very well (though I am certainly open to a suggestions regarding the command parameters in use).

I would now like to automatically start op25 upon starting or restarting the Pi3+.

I used crontab -e (no sudo) and added several variations on @reboot including:

@reboot /home/pi/scannerportland.sh > /home/pi/scanner/portland.log 2>&1

@reboot /home/pi/op25/op25/gr-op25_repeater/apps/portland.sh > /home/pi/op25/op25/gr-op25_repeater/apps/portland.log 2>&1

@reboot /bin/sleep 30; bash /home/pi/op25/op25/gr-op25_repeater/apps/portland.sh >> /home/pi/op25/op25/gr-op25_repeater/apps/portland.log

Nothing has succeeded in automating the start of op25.

I can do the

cd scanner
./portland.sh

and op25 starts and runs as normal.

I am a relative novice to Linux and suspect there is some faulty syntax that is preventing this from working.

Can anyone point me the the right direction?

Thanks!

Glenn
 

boatbod

Member
Joined
Mar 3, 2007
Messages
3,338
Location
Talbot Co, MD
There is an example systemd configuration file included in the distro.
~/op25/op25/gr-op25_repeater/apps/op25-rx.service

You will need to edit the file to match your purposes, then copy it to /etc/systemd/system and enable it.
Code:
sudo cp ~/op25/op25/gr-op25_repeater/apps/op25-rx.service /etc/systemd/system
sudo systemctl enable op25-rx
sudo systemctl start op25-rx
 

maus92

Member
Premium Subscriber
Joined
Jun 23, 2004
Messages
8,041
Location
The OP
There is an example systemd configuration file included in the distro.
~/op25/op25/gr-op25_repeater/apps/op25-rx.service

You will need to edit the file to match your purposes, then copy it to /etc/systemd/system and enable it.
Code:
sudo cp ~/op25/op25/gr-op25_repeater/apps/op25-rx.service /etc/systemd/system
sudo systemctl enable op25-rx
sudo systemctl start op25-rx


Can you explain this section from the Liquidsoap README:

"Another factor to consider is that op25 should only be auto-started at boot
time when it has been configured for the http terminal type. Auto-starting
the default curses terminal is not going to be successful. An example of this is to add -l http:127.0.0.1:12345"

How would this be accomplished for those using the ./multi_rx.py version? Where would this statement be added? In the op25.sh file or the cfg.json file? There is a terminal section in the cfg.json file that has a default setting 0.0.0.0:8080, just want to make sure what is the correct procedure.
 
Last edited:

boatbod

Member
Joined
Mar 3, 2007
Messages
3,338
Location
Talbot Co, MD
Can you explain this section from the Liquidsoap README:

"Another factor to consider is that op25 should only be auto-started at boot
time when it has been configured for the http terminal type. Auto-starting
the default curses terminal is not going to be successful. An example of this is to add -l http:127.0.0.1:12345"

How would this be accomplished for those using the ./multi_rx.py version? Where would this statement be added? In the op25.sh file or the cfg.json file? There is a terminal section in the cfg.json file that has a default setting 0.0.0.0:8080, just want to make sure what is the correct procedure.
multi-rx config is very different from rx.py, but you are looking in the right place if you look at the "terminal_type" entry in cfg.json. Valid entries for this parameter are the same as the "-l" command line for rx.py. Namely 'curses' or 'http:aaa.bbb.ccc.ddd:pppp'.
 

gskroll

Member
Premium Subscriber
Joined
Jun 17, 2005
Messages
96
Location
Portland, ME
There is an example systemd configuration file included in the distro.
~/op25/op25/gr-op25_repeater/apps/op25-rx.service

You will need to edit the file to match your purposes, then copy it to /etc/systemd/system and enable it.
Code:
sudo cp ~/op25/op25/gr-op25_repeater/apps/op25-rx.service /etc/systemd/system
sudo systemctl enable op25-rx
sudo systemctl start op25-rx

Thanks for the quick reply. I have run the steps to create the service and it's working great.

Glenn
 
Status
Not open for further replies.
Top