Simon McNamara

+ Follow
since Nov 13, 2019
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Simon McNamara

If you're going to use Runtime.exec() or one of the other external program execution resources, then you should actually use the absolute program path. That is "/usr/bin/python", not just "python". Don't depend on the JVM's shell path. You may also need to intercept the stdio paths for the python interpreter.

If you just want to run a preset gnuradio from Java, that's probably it...

This is my hope, Tim.

I fear that this post is straying away from a general question of running python from java, however, and now getting into gnuradio territory.

I tried running the python on the pi. In terminal, I cd to the correct directory, then:

To my surprise, I get the exact same message:

Fortunately, getting PyQt4 is not so difficult for Raspian. I can get the package with:

But now I get this message when I try to run the python:

I found a relevant thread on git. Some users are having the same problem:

The respondent's feedback was, in part:

It seems that the gr-gsm-0.41.2-1 package is incompatible with gnuradio-3.7.11-6 and there is no easy way to fix it. The gnuradio package in Debian Buster has been heavily modified and all distributions that are directly or indirectly based on Debian Buster are affected - Ubuntu 18.04, Kali Rolling, Parrot Os, .... This error is not because of missing qt library but because of incompatibility between grgsm_livemon and the latest gnuradio versions from Debian/Ubuntu/Kali repositories. The gnuradio in debian has been migrated from qt4 to qt5 ( so all QT flowgraphs have to be regenerated.

And to solve this problem, I should comment out some lines in the .py . This just isn't practical and I find it hard to believe that this problem persists a year after the most recent post on that thread. If anyone has some feedback or general guidance on this, that would be great, if not, I may be creating a gnuradio-specific thread next!


1 week ago
Hello all,

Many thanks for your feedback. I got my USB-C cable in the mail, but I over-estimated the current supplied by my monitor's usb ports. I can't seem to power the Pi with any of my wall worts or usb ports on hand. So I'm now waiting on a 3A 5V supply to go with my USB-C cable. Dang.

A bigger question however is whether the python part is even needed here. Gnuradio itself is a self-contained engine, and while it has a Python API to allow certain functions, I think you might be able to run a canned flow without it.

Tim - can you elaborate? I see that my GNURadio script generates a .py . That's what I've been trying to run. Is this a good approach?

3 weeks ago
Many thanks for the help. I plan to try some of this on the Pi as soon as my USB-c cable arrives in the mail. I'll check back then.
3 weeks ago
Hey Joe,

I also have python3 since before I updated to Catalina, so I thought maybe I just had that from my prior installation.

One thing I also did try was to point "python absolute/path/to/" to python3, but I either failed to point correctly, or GNURadio simply requires PyQt4 (I received the same error). I would not be surprised if GNURadio requires the older module PyQt4.

How would I find the correct path for python3? The path to python2.7 seems totally different (e.g., something like /usr/lib/python2.7).

Even if pointing to python3 worked for now, establishing the absolute path to python3 would still be a problem when I deploy to RaspberryPi.

Thanks for your help.

4 weeks ago
Hello Code Ranchers,

For the life of me I cannot get my PyQt4 problem resolved. The shipped version of python for MacOS is 2.7.x . The most helpful thread about getting the PyQt module running is here:

People seem to have some success installing Python 2.7.x fresh from here:

Then using the PyQt4 binaries package from here: .

However, that PyQt4 package doesn't seem to work with MacOS Catalina (or perhaps other earlier versions which I cannot confirm).

MacPorts and HomeBrew don't seem to have any version of PyQt4 for Python 2.7.x unfortunately.

So I will try the ProcessBuilder approach tomorrow when I have access to my RaspberryPi. I'll report back, in the event that others need this thread in the future. Thanks.
4 weeks ago
Joe -

I didn't occur to me that this package wasn't included with my distribution. I found on the interwebs ( ) that I can install this with:

Unfortunately, now I get:

I don't know python at all, so now I'm probably in over my head. This is a GNURadio script.

Rob -

A feature of my program is that users can change the GNURadio script (.py) to suit their signal processing needs. My java program then calls a GNURadio script to import data via TCP. Users shouldn't need to edit the java, so embedding python inside the java wouldn't work well for me.

Kristina -

It would have been far wiser to start the entire project in python. Alas, I chose java early on (because it's what I knew), and now I'm too far along to change. The basic workflow is that a user can start the python from within the java GUI. Then, they can select to pipe up to three signals from the GNURadio .py script.

Many thanks for your replies. I am especially interested in solutions that might allow me to send commands to python (I hope to be able to change some variable values in the python on startup - not sure if this is at all possible). The Runtime.getRuntime().exec(command + param ) option might work for this, where "param" is an optional parameter.

4 weeks ago
Hello Code Ranchers,

I'm trying to call a python script from within my java program. Jython is not an option for me. I'm running MacOS Catalina 10.15.2 with NetBeans.

I've tried this:

This java compiles and runs fine, but doesn't launch the python. No exceptions. No nothing.

I think this may be a python problem. When I run that same command in terminal:

I get:

I've tried updating python with homebrew. I've also tried pointing to my python directory:

This gives me the same error.

Also - my final java implementation will be on Raspberry Pi (Buster), so I'll need a solution which is platform agnostic. Any feedback on this subject is welcomed.

4 weeks ago
Wow. GNURadio is a beast. Looks like I can acquire and demodulate in there and send it anywhere I like after that. Many thanks for suggesting that.

I may still be in need of some functionality like netcat to monitor my data stream as I prepare to write my program to talk to GNURadio. I'll check back in when I write something in GNURadio that I can actually transmit.

1 month ago
Hey Tim,

I should have mentioned my purpose more clearly. I plan to use SDR for radio astronomy. Ultimately, I hope to demodulate the audio into complex numbers for use in another program.

Some user comments mention sox and multimon-ng. I'm going to try some of that along with netcat to see if I can get any output at all.

I'll check back when I have more details. Thanks for your input so far.
1 month ago
Ok I'll take a look at tcpdump tomorrow morning.

On a related note; do you have any suggestions for how I can demodulate the audio into, for example, complex numbers? I plan to pipe these data to a java application that I've partially written.

Thanks for your feedback.
1 month ago
Hello Tim,

On the raspberry Pi, listening on the port I specify prints jibberish while I'm streaming data. That's fine, it at least tells me I'm getting data. My next task will be implementing some demodulation so that I can get meaningful text.

On OSX, I get no terminal output whatsoever while listening on the port.

Thanks for your reply.
1 month ago
Hello all,

I am attempting the equivalent of crawling in the networking world. It's not going well. I have the latest version of netcat installed on my macbook from homebrew.

I'm working with an open source "software defined radio" (SDR) application to retrieve radio signals with some cheap hardware plugged into my macbook via USB. I can tune to the radio station just fine in the app, but when I attempt to stream the audio over UDP with netcat, no text prints to terminal.

As the developer suggests ( ), I tried the following in termainl:



None of these worked.

With the Raspberry Pi variant of the software, I can get the stream in terminal using any of the above commands.

Any suggestions will be much appreciated.
1 month ago
Ok well that certainly simplifies things. Can you recommend any beginner articles for Maven?

Many thanks.
2 months ago

Thank you for this. That one line fixes everything.

How did you know that you needed only those dependencies (short of the fact that those dependencies allow the code to run)?

Many thanks,
2 months ago
Hello Stephan,

Please see the screen shot, attached. I've highlighted the dependencies added to the project. I am running the project through the NetBeans IDE.

I do indeed need to learn Maven. I will read up to avoid these problems in the future. I'd like to have some sense of what Maven does behind the scenes, anyway.

2 months ago