mhostetter / gr-adsb

GNU Radio OOT module for demodulating and decoding ADS-B packets
GNU General Public License v3.0
148 stars 44 forks source link

Error RTL-SDR #39

Open mauriwillig opened 3 years ago

mauriwillig commented 3 years ago

Hi, I'm using gr-adsb for GNU 3.8 version, and I'm getting this error:

Executing: /usr/bin/python3 -u /home/mauricio/Desktop/adsb_rx.py

gr-osmosdr 0.2.0.0 (0.2.0) gnuradio 3.8.1.0 built-in source types: file osmosdr fcd rtl rtl_tcp uhd miri hackrf bladerf rfspace airspy airspyhf soapy redpitaya freesrp The RTL TCP server reports a R820T tuner with 29 RF and 0 IF gains. Traceback (most recent call last): File "/home/mauricio/Desktop/adsb_rx.py", line 258, in main() File "/home/mauricio/Desktop/adsb_rx.py", line 236, in main tb = top_block_cls() File "/home/mauricio/Desktop/adsb_rx.py", line 176, in init self.adsb_decoder_0 = adsb.decoder("Extended Squitter Only", "None", "Brief") File "/usr/local/lib/python3/dist-packages/adsb/decoder.py", line 284, in init self.screen = curses.initscr() File "/usr/lib/python3.8/curses/init.py", line 29, in initscr setupterm(term=_os.environ.get("TERM", "unknown"), _curses.error: setupterm: could not find terminal Error in atexit._run_exitfuncs: _curses.error: must call initscr() first

Done (return code 1)

mhostetter commented 3 years ago

Thanks for the report. How did you execute adsb_rx.py?

From looking at the traceback, the problem is not with the RTL-SDR but with the curses python module. From googling, it seems that curses doesn't work in a python interpreter but only in terminals. So I'm guessing it should work if you open a terminal and type python3 adsb_rx.py.

Also, I'm curious if this is related to https://bugs.python.org/issue7597.

mauriwillig commented 3 years ago

Hi! I'm running adsb_rx.grc (from ./examples) on GNU Radio Companion 3.8.1.0, and when I run it, I get the error I have posted. This is what I get:

image

Yes, if I only run 'python3 adsb_rx.py' on a terminal it works, but I cannot run it directly from GRC.

mhostetter commented 3 years ago

Ok, this should be flagged as a bug. I'm guessing the change happened sometime in GNU Radio 3.8 with how they handle the "console output" or how they invoke flowgraphs. Easy fix is rip out curses and use something else. Maybe there's a workaround with curses. I'm going to leave this issue open, but it may take me a little time to resolve this. I'm preoccupied with something else at the moment.

mauriwillig commented 3 years ago

Ok, I just edited my last comment and added a pic of the GRC console when I run it. Let me know if I can help you with something.

Take your time. Thanks!

mauriwillig commented 3 years ago

Little update: Can get it working, just running "gnuradio-companion adsb_rx.grc" in console and then hitting RUN button on GRC. Yeah... probably there is a bug with how GRC invoke flowgraphs.

mhostetter commented 3 years ago

I'm glad you found a workaround! I've been hustling around trying to get my old 3.7 and 3.8 installations to load, but to no avail.

I hate to kick this over the fence, but it might be a worthwhile issue to submit in the GNU Radio repo itself. Given that the flowgraph works when running python3 adsb_rx.py, gnuradio-companion adsb_rx.py + RUN, but not through the GUI itself is indicative there might be some GUI code causing the problem? Just a thought.

livethisdream commented 2 years ago

I fixed this by adding the following to my ~/.profile

export TERM=xterm-256color

And then rebooting.

I suspect the specific terminal you want to name depends on your distro and configuration. Try checking what your terminal is going by executing the following in a terminal:

echo $TERM