I apologize if my questions are trivial or aggravating, I'm still a total newbie to Linux, RPi's, and OP-25's numerous arguments.
I have OP-25 Boatbod up and running, on an RPi 3B+, with an RTL-SDR, with both the Terminal interface and the Web interface.
These work great and I am very appreciative of the developers and all of their time and effort!
My current goal is to run a Python program, (Program #1), on RPi Boot-up, using crontab, and then use that program to start OP-25 (rx.py...).
Eventually, Program #1 will use RPi I/O pins to determine which of several OP-25 configurations to start.
I can currently automatically start Program #1, through crontab, and select which of several simple Python LED flasher programs to run.
This works fine.
When I use:
proc = subprocess.Popen('python3 /home/pi/Documents/JCRPiFlashV6.py', shell=True)
I can spin off the LED flasher Python program / task / thread / process (? correct term) to run on its own and return control to Program #1.
I can run the Python Program #1 program during the RPi bootup, the LED flasher Python program runs, (forever), and the RPi boots up to its GUI, as per usual.
That was the simple test program, with the Python LED flasher program, and it all worked as desired.
I then tried to swap out the simple Python LED flasher program, (The secondary, or called program), to instead start OP-25 Boatbod, (rx.py...).
Again, this was to be called by Python program #1, that runs via crontab during the RPi bootup.
I have not yet been able to make this work, and I am hoping that I am missing something easy to fix this.
I've been trying to read the Python documentation, and on line examples, but truth be known much of it is still above my level of comprehension.
Side note:
This set of OP-25 arguments could use some more tweaking and cleanup, but this configuration works when entered through a Terminal,
or when called by a shortcut shell command. This configuration doesn't have a whitelist, it just plays all repeater traffic for testing.
Please ignore optimization of the OP-25 parameters for now.
I've tried a few different formats for having Program #1 initiate Program #2, (OP-25).
None have succeeded in getting OP-25 up and running and playing audio.
I suspect the process that I am looking for isn't much different than setups that run OP-25, on startup, on a headless RPi.
My Googling around, however, didn't yield an example of that.
A few, of many, formats tinkered with:
import subprocess #This is to run Shell commands, as spin offs, and return to Main
import os #This is to run Shell Command from Python
import RPi.GPIO as GPIO
import time
proc = subprocess.Popen('python3 /home/pi/op25/op25/gr-op25_repeater/apps/rx.py --args 'rtl' -N 'LNA:35' -S 1000000 -x 2 -f 858.5125e6 -o 25000 -q -1 -d -300 -T trunkJC1.tsv -V -2 -U 2>stderr-stream0.2', shell=True) (Note: This version's core: python3 /home... works from the terminal)
# proc = subprocess.Popen(['python3 /home/pi/op25/op25/gr-op25_repeater/apps/rx.py', '--args', 'rtl', '-N', 'LNA:35', '-S', '1000000', '-x', '2', '-f', '858.5125e6', '-o', '25000', '-q', '-1', '-d', '-300', '-T', 'trunkJC1.tsv', '-V', '-2', '-U', '2>stderr-stream0.2'], shell=True)
proc = subprocess.Popen(["python3", "/home/pi/op25/op25/gr-op25_repeater/apps/rx.py" "--args" "rtl" "-N" "LNA:35" "-S" "1000000" "-x" "2" "-f" "858.5125e6" "-o" "25000" "-q" "-1" "-d" "-300" "-T" "trunkJC1.tsv" "-V" "-2" "-U" "2>stderr-stream0.2"], shell=True)
I can insert a full (non) working Python program if that would be helpful, but I suspect the key to the issue is with the above subprocess.Popen() command usage.
Thoughts, feedback, guidance, a push in the right direction, etc., would all be appreciated.
I appreciate your time and patience in helping with this!
Jay
I have OP-25 Boatbod up and running, on an RPi 3B+, with an RTL-SDR, with both the Terminal interface and the Web interface.
These work great and I am very appreciative of the developers and all of their time and effort!
My current goal is to run a Python program, (Program #1), on RPi Boot-up, using crontab, and then use that program to start OP-25 (rx.py...).
Eventually, Program #1 will use RPi I/O pins to determine which of several OP-25 configurations to start.
I can currently automatically start Program #1, through crontab, and select which of several simple Python LED flasher programs to run.
This works fine.
When I use:
proc = subprocess.Popen('python3 /home/pi/Documents/JCRPiFlashV6.py', shell=True)
I can spin off the LED flasher Python program / task / thread / process (? correct term) to run on its own and return control to Program #1.
I can run the Python Program #1 program during the RPi bootup, the LED flasher Python program runs, (forever), and the RPi boots up to its GUI, as per usual.
That was the simple test program, with the Python LED flasher program, and it all worked as desired.
I then tried to swap out the simple Python LED flasher program, (The secondary, or called program), to instead start OP-25 Boatbod, (rx.py...).
Again, this was to be called by Python program #1, that runs via crontab during the RPi bootup.
I have not yet been able to make this work, and I am hoping that I am missing something easy to fix this.
I've been trying to read the Python documentation, and on line examples, but truth be known much of it is still above my level of comprehension.
Side note:
This set of OP-25 arguments could use some more tweaking and cleanup, but this configuration works when entered through a Terminal,
or when called by a shortcut shell command. This configuration doesn't have a whitelist, it just plays all repeater traffic for testing.
Please ignore optimization of the OP-25 parameters for now.
I've tried a few different formats for having Program #1 initiate Program #2, (OP-25).
None have succeeded in getting OP-25 up and running and playing audio.
I suspect the process that I am looking for isn't much different than setups that run OP-25, on startup, on a headless RPi.
My Googling around, however, didn't yield an example of that.
A few, of many, formats tinkered with:
import subprocess #This is to run Shell commands, as spin offs, and return to Main
import os #This is to run Shell Command from Python
import RPi.GPIO as GPIO
import time
proc = subprocess.Popen('python3 /home/pi/op25/op25/gr-op25_repeater/apps/rx.py --args 'rtl' -N 'LNA:35' -S 1000000 -x 2 -f 858.5125e6 -o 25000 -q -1 -d -300 -T trunkJC1.tsv -V -2 -U 2>stderr-stream0.2', shell=True) (Note: This version's core: python3 /home... works from the terminal)
# proc = subprocess.Popen(['python3 /home/pi/op25/op25/gr-op25_repeater/apps/rx.py', '--args', 'rtl', '-N', 'LNA:35', '-S', '1000000', '-x', '2', '-f', '858.5125e6', '-o', '25000', '-q', '-1', '-d', '-300', '-T', 'trunkJC1.tsv', '-V', '-2', '-U', '2>stderr-stream0.2'], shell=True)
proc = subprocess.Popen(["python3", "/home/pi/op25/op25/gr-op25_repeater/apps/rx.py" "--args" "rtl" "-N" "LNA:35" "-S" "1000000" "-x" "2" "-f" "858.5125e6" "-o" "25000" "-q" "-1" "-d" "-300" "-T" "trunkJC1.tsv" "-V" "-2" "-U" "2>stderr-stream0.2"], shell=True)
I can insert a full (non) working Python program if that would be helpful, but I suspect the key to the issue is with the above subprocess.Popen() command usage.
Thoughts, feedback, guidance, a push in the right direction, etc., would all be appreciated.
I appreciate your time and patience in helping with this!
Jay