New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable SDRPlay in Windows version #371
Comments
SDRPlay has unfortunately no native support. You can use it via the GNU Radio backend, by entering the directory GNU Radio was installed to at the bottom of the dialog. |
I tried to, but which directory do you choose? it seems like there needs to be some sort of OK button once the directory is picked, i have tried. But what ever i choose doesn't seem to stick. |
It should be the one where GNU Radios The supported way is to use the official GNU Radio installer from here. |
Just had a look at the source. There should be a directory |
Unfortunately it seems that there is no gr-python27 directory with pothossdr :-( C:. C:\Program Files\PothosSDR> |
Seems like this woll not work then. Is there a python.exe somewhere in the Pothos Install dir? If so, I could maybe add support for it. Is it an option for you to install GNU Radio to get the backend working? |
What you could also try is to define the path to the python 2 Interpreter (assuming you have one installed). I could imagine, that PothosSDR modifies the PYTHONPATH so it may be enough to just configure a Python 2 interpreter. |
Unfortunately no python.exe within C:\Program Files\PothosSDR My python directory is C:\Python27 |
PYTHONPATH=C:\Program Files\PothosSDR\lib\python2.7\site-packages |
It may work if you choose the radio button "Python2 interpreter" in the URH dialog from your screenshot and enter |
This setting should stay if it works. If there is an error it defaults back to the empty value. You can check if your Python2 interpreter has GNU Radio support with this command:
|
No Go. C:\Python27>python.exe -c 'import gnuradio' C:\Python27> |
Looks like the Windows CMD behaves a bit weird. If you are in that directory you can also simply enter
and see if it works. If that is so, you can try to enter |
C:\Python27>python.exe
|
Is it working when you press enter? |
Was the |
This is actually a good sign! I have a suspicion what is going wrong here. Could you try entering
with double quotes instead of single quotes like before and see if this runs without error? |
Runs without error. C:\Python27>python.exe -c "import gnuradio" C:\Python27> |
Thanks for your help, this is actually a Windows Bug in URH then because the Windows CMD, unlike a linux shell, does not work with single quotes in this case. I will fix this ASAP. |
Thanks Jopohl, Your work is truly appreciated. |
Could you share your top_block.py from your GNU Radio example ? |
uplpad sdrplay api , try to build add a native support. Thanks jopohl |
This is my gnuradio top_block.py |
Does it help if you change
to
Sorry for the long shots, but the SDRplay support was actually added by the community, so I can not verify my ideas because I do not possess an SDRPlay device. This would also make it very hard to develop a native interface. |
Change this" sdrplay=0" There is no use for anything,In the same way as the above |
Can you provide us with some test devices or make a PR with native support? |
I'm sorry that my English is poor. Thank you very much! I'm here at one o'clock in the morning, and I go to bed first |
Sure get some sleep mate. 👍 |
This seems to be an issue with the python2 interpreter. Does it work when you run this in terminal:
Note the slight difference to the test we did above. |
What happens if you call:
from command line? |
C:>cd Python27 C:\Python27>C:\Python27\python.exe "C:\Program Files\Universal Radio Hacker\sdrplay_recv.py" C:\Python27> |
Alright, this is the same error as in the application. Please add Futhermore, please share the output of |
C:\Python27>C:\Python27\python.exe "C:\Program Files\Universal Radio Hacker\sdrplay_recv.py" C:\Python27> C:\Python27> |
I just noticed, that the line numbers in your #!/usr/bin/env python2
##################################################
# GNU Radio Python Flow Graph
# Title: Top Block
# Generated: Fri Aug 21 15:56:13 2015
##################################################
from optparse import OptionParser
import Initializer
Initializer.init_path()
from gnuradio import gr
from gnuradio.eng_option import eng_option
from grc_gnuradio import blks2 as grc_blks2
from InputHandlerThread import InputHandlerThread
import osmosdr
from gnuradio import zeromq
class top_block(gr.top_block):
def __init__(self, samp_rate, freq, gain, bw, port):
gr.top_block.__init__(self, "Top Block")
##################################################
# Variables
##################################################
self.samp_rate = samp_rate
self.gain = gain
self.freq = freq
self.bw = bw
##################################################
# Blocks
##################################################
self.osmosdr_source_0 = osmosdr.source(args="numchan=" + str(1) + " " + "sdrplay")
self.osmosdr_source_0.set_sample_rate(samp_rate)
self.osmosdr_source_0.set_center_freq(freq, 0)
self.osmosdr_source_0.set_freq_corr(0, 0)
self.osmosdr_source_0.set_dc_offset_mode(0, 0)
self.osmosdr_source_0.set_iq_balance_mode(0, 0)
self.osmosdr_source_0.set_gain_mode(False, 0)
self.osmosdr_source_0.set_gain(gain, 0)
self.osmosdr_source_0.set_if_gain(gain, 0)
self.osmosdr_source_0.set_bb_gain(gain, 0)
self.osmosdr_source_0.set_antenna("", 0)
self.osmosdr_source_0.set_bandwidth(bw, 0)
self.zeromq_push_sink_0 = zeromq.push_sink(gr.sizeof_gr_complex, 1, 'tcp://127.0.0.1:' + str(port))
##################################################
# Connections
##################################################
self.connect((self.osmosdr_source_0, 0), (self.zeromq_push_sink_0, 0))
def get_samp_rate(self):
return self.samp_rate
def set_samp_rate(self, samp_rate):
self.samp_rate = samp_rate
self.osmosdr_source_0.set_sample_rate(self.samp_rate)
def get_gain(self):
return self.gain
def set_gain(self, gain):
self.gain = gain
self.osmosdr_source_0.set_gain(self.gain, 0)
self.osmosdr_source_0.set_if_gain(self.gain, 0)
self.osmosdr_source_0.set_bb_gain(self.gain, 0)
def get_freq(self):
return self.freq
def set_freq(self, freq):
self.freq = freq
self.osmosdr_source_0.set_center_freq(self.freq, 0)
def get_bw(self):
return self.bw
def set_bw(self, bw):
self.bw = bw
self.osmosdr_source_0.set_bandwidth(self.bw, 0)
if __name__ == '__main__':
parser = OptionParser(option_class=eng_option, usage="%prog: [options]")
parser.add_option("-s", "--samplerate", dest="samplerate", help="Sample Rate", default=100000)
parser.add_option("-f", "--freq", dest="freq", help="Frequency", default=433000)
parser.add_option("-g", "--gain", dest="gain", help="Gain", default=30)
parser.add_option("-b", "--bandwidth", dest="bw", help="Bandwidth", default=200000)
parser.add_option("-p", "--port", dest="port", help="Port", default=1337)
(options, args) = parser.parse_args()
tb = top_block(float(options.samplerate), float(options.freq), int(options.gain),
float(options.bw), int(options.port))
iht = InputHandlerThread(tb)
iht.start()
tb.start()
tb.wait() If it then should complain about a missing Initalizer.py file, just create that file in that directory with this conent: import sys
import os
import tempfile
def init_path():
# Append script path at end to prevent conflicts in case of frozen interpreter
sys.path.append(sys.path.pop(0))
try:
with open(os.path.join(tempfile.gettempdir(), "gnuradio_path.txt"), "r") as f:
gnuradio_path = f.read().strip()
os.environ["PATH"] = os.path.join(gnuradio_path, "bin") + os.pathsep + os.environ["PATH"]
sys.path.insert(0, os.path.join(gnuradio_path, "lib", "site-packages"))
except IOError:
pass However, a clean reinstall (with prior uninstall) may be the better option here. |
The file was different, did an uninstall and clean install, Traceback (most recent call last): |
What does
give you? |
C:\Python27>python.exe -c "from gnuradio import zeromq" C:\Python27> |
Seems like you have no zeromq installed for you python2 interpreter. You could try this:
|
Getting close now lol gr-osmosdr v0.1.4-98-gc653754d (0.1.5git) gnuradio 3.7.11.1 �[0m FATAL: Trying to fill up 1 missing channel(s) with null source(s). |
This may be an issue with Pothos by the looks of it, so don't worry too much about it if it cant be done.. I always have hackrf to capture with. :-) |
Looks also like a PothosSDR error for me, maybe Pothos is not supposed to be used in this way. You still have the option to install the official GNU Radio for Windows, which is better supported. If you do so, you need to configure the GNU Radio install dir in URH options. Unfortunately, we do not have the budget at the moment to afford a SDRPlay. I would add native support otherwise. |
Thanks Johannes for trying, ill try to reach out to the SDRPlay team and see what they can arrange, do you have an email address i could send them to contact you? |
Sure, just use my GMail address: Johannes.Pohl90@gmail.com |
No.. Thank you.. |
I'm unable to enable SDRPlay in windows version .msi
Not sure if it requires a dll file like other sdr's in the C:\Program Files\Universal Radio Hacker directory
Also i have the pothossdr suite installed and am able to use gqrx in windows with the SDRPlay, not sure if that makes a difference or not.
The text was updated successfully, but these errors were encountered: