GnuRadio在OS X 10.9.4和HackRF One上无法运行
我刚从Kickstarter上拿到了我的新HackRF,跟Windows上的SDR#配合得很好,所以这个产品没问题。
为了能真正使用它,我试着在我的Mac上安装GNURadio,按照这个官方教程来操作:https://github.com/robotastic/homebrew-hackrf
不过,编译完成后运行gnuradio却失败了:
Bella:~ feejai$ gnuradio-companion
/usr/local/bin/gnuradio-companion:70: GtkWarning: Das Symbol »gnuradio-grc« konnte
nicht gefunden werden, ebenso wenig wie das Thema »hicolor«. Möglicherweise müssen Sie
es installieren.
Sie können sich eine Kopie herunterladen unter:
http://icon-theme.freedesktop.org/releases
try: gtk.window_set_default_icon(gtk.IconTheme().load_icon('gnuradio-grc', 256, 0))
Warning: Block with key "analog_agc2_xx" already exists.
Ignoring: /usr/local/Cellar/gnuradio/3.6.5.1/share/gnuradio/grc/blocks/analog_agc2_xx.xml
Warning: Block with key "analog_agc_xx" already exists.
Ignoring: /usr/local/Cellar/gnuradio/3.6.5.1/share/gnuradio/grc/blocks/analog_agc_xx.xml
Warning: Block with key "analog_cpfsk_bc" already exists.
Ignoring: /usr/local/Cellar/gnuradio/3.6.5.1/share/gnuradio/grc/blocks/analog_cpfsk_bc.xml
Warning: Block with key "analog_ctcss_squelch_ff" already exists.
Ignoring: /usr/local/Cellar/gnuradio/3.6.5.1/share/gnuradio/grc/blocks/analog_ctcss_squelch_ff.xml
Warning: Block with key "analog_dpll_bb" already exists.
....
Fatal Python error: PyThreadState_Get: no current thread
Abort trap: 6
我甚至不知道为什么第一个错误信息是德语,我的操作系统和所有环境变量都设置成了英语。
这可能是python和xquartz的问题,我在网上搜索gtk+时看到过类似的错误信息,但还没有找到解决办法。
2 个回答
因为我刚入门,所以不能给Kevin的回复“点赞”,但问题的核心就是:Python的可执行文件和库之间不匹配。
注意事项:
如果你还没有订阅GNU Radio用户讨论列表,建议你去看看,这里对类似的问题非常有帮助。 https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
MacPorts提供了一个“hackrf”的软件包,我会定期更新它以保持最新。你可以直接使用这个,而不需要手动从源代码安装(只需输入“sudo port install hackrf”)。MacPorts还提供GNU Radio和UHD的版本(分别是“sudo port install gnuradio”和“sudo port install uhd”),还有开发版本,我也会保持它们的最新状态(“sudo port install gnuradio-devel”和“sudo port install uhd-devel”)。
Fatal Python error: PyThreadState_Get: no current thread
这个错误可能是因为GNU Radio编译时用的Python版本和运行时用的Python版本不一致。
在我的情况下,我是从源代码编译GNU Radio的,而我的Python是通过MacPorts安装的;解决办法是在配置GNU Radio时,在cmake
命令中加上选项-DPYTHON_LIBRARY=/opt/local/lib/libpython2.7.dylib
(注意,/opt/local/lib
这个路径是特定于MacPorts Python的)。我在这篇博客上找到了这个建议。
我不能保证这个具体的修改一定有效,因为你可能还有其他不匹配的地方,但我希望这能帮助你搞清楚问题所在。
(如果你愿意尝试使用MacPorts而不是Homebrew,我可以说HackRF在它的gnuradio和gr-osmosdr包中可以直接使用,没有问题。)