Hello all!
I am trying to get OP25 running on a Raspberry Pi Zero.
I can get OP25 to run, and I can get the audio piped over the network to my desktop PC so I can hear it. However, I have to turn the sample rate for rx.py way down to get OP25 to detect any transmissions, and even then, it doesn't detect nearly as many transmissions as when running on my desktop PC.
It sort of feels like the Pi Zero is not quite fast enough to run OP25, but I'm not sure that's what's going on.
Is there something else I should tweak or check?
I run the same radio, antenna, antenna location, version of OP25, etc on my desktop PC under Linux and it works just fine.
Hardware:
The radio is from rtl-sdr.com a couple of years ago. It says "DVB-T + DAB + FM + SDR" and "RTL2832U R820T2 TCXO" on the front. The QA sticker is marked 2015-12.
The antenna is a small telescoping whip, about 10 inches long, on a base with about 3 feet of thin co-ax and an SMA connector. It came in a kit with the radio. I put it on the frame of the window in my office, indoors.
The Pi is a "Raspberry Pi Zero 1.3 KN3G", per the bag it came in. (Note it is not a Zero W - it does not have Wi-Fi.)
Storage is a new 16 GB Class 10 MicroSD card, Micro Center brand.
Power is either from a USB wall supply rated at 5 V 1.5 A, or a USB battery bank rated at 5 V 2.1 A, with the same results on both.
The power cable came with the 1.5 A wall supply, and I have used it with that supply to charge an Android tablet several times.
I have an HDMI cable hooked up from the Pi to an Asus monitor.
There is an Adafruit 2991 4-port USB hub connected to the Pi. That supports the RTL-SDR stick and Ethernet adapter. If I am using the Pi console, it also supports a keyboard and mouse.
The USB-to-Ethernet adapter is a J5Create JUE120. Raspbian detects it as "ASIX AX88772B".
The Ethernet runs at 100 megabits from the Pi Zero to a switch, and then at 1 gigabit from the switch to my desktop PC.
Software:
I am using Raspbian "Stretch" from 9 October 2018.
I replaced systemd with sysvinit, using packages offered through the default apt repositories. I have also updated all the other installed packages to the latest versions offered in the default apt repositories. The root filesystem is about 40% full.
I am using boatbod's version of OP25, as cloned from Github in September 2018, plus some modifications of my own.
I run this same version of OP25 on a Linux desktop PC and it works fine for me.
Observations:
python uses 97-98% of the CPU on the Pi Zero when OP25 is running, per top .
It doesn't seem to matter whether it is "scanning", or actively receiving a particular transmission. The CPU usage also doesn't change when I adjust the sampling rate to rx.py .
The CPU speed throttles up to a maximum of 1000 MHz when OP25 is running, per vcgencmd get_config arm_freq .
When I have X up, I don't ever get the "lightning bolt" low-power warning on the screen.
I have used a USB inline multimeter on the Pi Zero power supply. The Pi Zero plus all peripherals except the radio never draws more than approximately 0.55 A. With the radio included, the whole setup never draws more than approximately 0.85 A.
The CPU temperature runs around 47-48 C (116-118 F) at idle, and around 52-53 C (125-127 F) with OP25 running.
Tweaks I have tried:
Turning down the sample rate (-S) argument to rx.py, in steps of 24,000, to between 1,440,000 and 1,920,000 - some improvement, but not much
As I turn it down, "tsbks" count up faster in the OP25 terminal, and it detects more transmissions on various talkgroups. However, the audio quality gets worse to nonexistent. (On my desktop PC, I use 2,400,000.)
Shutting down some of the daemons I don't need, like Bluetooth and DHCP - no change
Running "headless" via SSH, with keyboard and mouse disconnected from the Pi - no change
Shutting off X completely and just running OP25 in a text console over the network - no change
Running with no audio output, just watching the terminal window to see how often OP25 detects a transmission - no change
Using pypy instead of python - no change
I went back to python for further testing.
Updating some of the Python libraries on the PI, including numpy, via pip - no change
Changing the CPU frequency governor from "ondemand" to "performance" - no change
Cloning a fresh copy of OP25 from github (as of 12 Feb 2019), and building it without any of my own changes - no change
Tweaks I have not tried:
Anything involving config.txt on the Pi.
I am still running with the stock config.txt. (Among other things, this sets the CPU speed and overclocking options.)
Moving to Python 3.
OP25 depends on gnuradio, and the default Raspbian repositories supply gnuradio 3.7, which doesn't support Python 3. gnuradio 3.8 does, but I haven't tried building it yet.
Going back to systemd .
I don't really want to do this, but maybe it will make a difference.
Conclusion:
I know people have made OP25 run on a Pi 3. I thought people have made it run on a Pi Zero, but maybe not.
Thanks for your help!
I am trying to get OP25 running on a Raspberry Pi Zero.
I can get OP25 to run, and I can get the audio piped over the network to my desktop PC so I can hear it. However, I have to turn the sample rate for rx.py way down to get OP25 to detect any transmissions, and even then, it doesn't detect nearly as many transmissions as when running on my desktop PC.
It sort of feels like the Pi Zero is not quite fast enough to run OP25, but I'm not sure that's what's going on.
Is there something else I should tweak or check?
I run the same radio, antenna, antenna location, version of OP25, etc on my desktop PC under Linux and it works just fine.
Hardware:
The radio is from rtl-sdr.com a couple of years ago. It says "DVB-T + DAB + FM + SDR" and "RTL2832U R820T2 TCXO" on the front. The QA sticker is marked 2015-12.
The antenna is a small telescoping whip, about 10 inches long, on a base with about 3 feet of thin co-ax and an SMA connector. It came in a kit with the radio. I put it on the frame of the window in my office, indoors.
The Pi is a "Raspberry Pi Zero 1.3 KN3G", per the bag it came in. (Note it is not a Zero W - it does not have Wi-Fi.)
Storage is a new 16 GB Class 10 MicroSD card, Micro Center brand.
Power is either from a USB wall supply rated at 5 V 1.5 A, or a USB battery bank rated at 5 V 2.1 A, with the same results on both.
The power cable came with the 1.5 A wall supply, and I have used it with that supply to charge an Android tablet several times.
I have an HDMI cable hooked up from the Pi to an Asus monitor.
There is an Adafruit 2991 4-port USB hub connected to the Pi. That supports the RTL-SDR stick and Ethernet adapter. If I am using the Pi console, it also supports a keyboard and mouse.
The USB-to-Ethernet adapter is a J5Create JUE120. Raspbian detects it as "ASIX AX88772B".
The Ethernet runs at 100 megabits from the Pi Zero to a switch, and then at 1 gigabit from the switch to my desktop PC.
Software:
I am using Raspbian "Stretch" from 9 October 2018.
I replaced systemd with sysvinit, using packages offered through the default apt repositories. I have also updated all the other installed packages to the latest versions offered in the default apt repositories. The root filesystem is about 40% full.
I am using boatbod's version of OP25, as cloned from Github in September 2018, plus some modifications of my own.
I run this same version of OP25 on a Linux desktop PC and it works fine for me.
Observations:
python uses 97-98% of the CPU on the Pi Zero when OP25 is running, per top .
It doesn't seem to matter whether it is "scanning", or actively receiving a particular transmission. The CPU usage also doesn't change when I adjust the sampling rate to rx.py .
The CPU speed throttles up to a maximum of 1000 MHz when OP25 is running, per vcgencmd get_config arm_freq .
When I have X up, I don't ever get the "lightning bolt" low-power warning on the screen.
I have used a USB inline multimeter on the Pi Zero power supply. The Pi Zero plus all peripherals except the radio never draws more than approximately 0.55 A. With the radio included, the whole setup never draws more than approximately 0.85 A.
The CPU temperature runs around 47-48 C (116-118 F) at idle, and around 52-53 C (125-127 F) with OP25 running.
Tweaks I have tried:
Turning down the sample rate (-S) argument to rx.py, in steps of 24,000, to between 1,440,000 and 1,920,000 - some improvement, but not much
As I turn it down, "tsbks" count up faster in the OP25 terminal, and it detects more transmissions on various talkgroups. However, the audio quality gets worse to nonexistent. (On my desktop PC, I use 2,400,000.)
Shutting down some of the daemons I don't need, like Bluetooth and DHCP - no change
Running "headless" via SSH, with keyboard and mouse disconnected from the Pi - no change
Shutting off X completely and just running OP25 in a text console over the network - no change
Running with no audio output, just watching the terminal window to see how often OP25 detects a transmission - no change
Using pypy instead of python - no change
I went back to python for further testing.
Updating some of the Python libraries on the PI, including numpy, via pip - no change
Changing the CPU frequency governor from "ondemand" to "performance" - no change
Cloning a fresh copy of OP25 from github (as of 12 Feb 2019), and building it without any of my own changes - no change
Tweaks I have not tried:
Anything involving config.txt on the Pi.
I am still running with the stock config.txt. (Among other things, this sets the CPU speed and overclocking options.)
Moving to Python 3.
OP25 depends on gnuradio, and the default Raspbian repositories supply gnuradio 3.7, which doesn't support Python 3. gnuradio 3.8 does, but I haven't tried building it yet.
Going back to systemd .
I don't really want to do this, but maybe it will make a difference.
Conclusion:
I know people have made OP25 run on a Pi 3. I thought people have made it run on a Pi Zero, but maybe not.
Thanks for your help!