Skip to content
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

Error RTL-SDR #39

Open
mauriwillig opened this issue May 6, 2021 · 7 comments
Open

Error RTL-SDR #39

mauriwillig opened this issue May 6, 2021 · 7 comments
Labels

Comments

@mauriwillig
Copy link

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
Copy link
Owner

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
Copy link
Author

mauriwillig commented May 10, 2021

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
Copy link
Owner

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.

@mhostetter mhostetter added the bug label May 10, 2021
@mauriwillig
Copy link
Author

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
Copy link
Author

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
Copy link
Owner

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
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants