close
The Wayback Machine - https://web.archive.org/web/20220516015728/https://github.com/jopohl/urh/issues/584
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

Add device support for XTRX #584

Open
zhovner opened this issue Dec 14, 2018 · 15 comments
Open

Add device support for XTRX #584

zhovner opened this issue Dec 14, 2018 · 15 comments

Comments

@zhovner
Copy link

@zhovner zhovner commented Dec 14, 2018

XTRX is a versatile and powerfull SDR https://www.crowdsupply.com/fairwaves/xtrx
It would be nice to add it to URH.

They have two modes:

  • kernel module for mPCIe connection
  • userspace driver for user USB3-mPCIe adapter

Here it the sources: https://github.com/xtrx-sdr
And first start howto https://github.com/xtrx-sdr/images

@jopohl jopohl added the feature label Dec 14, 2018
@zhovner
Copy link
Author

@zhovner zhovner commented Jan 2, 2019

I've already started to port libxtrx into URH here https://github.com/zhovner/urh/
But I have no idea what i'm actually doing with all of this Cython stuff and try to figure out by looking at another *.pyx and *.pxd lib's and copy&pasting in same manner.

This example application that using libxtrx https://github.com/xtrx-sdr/libxtrx/tree/master/examples/xtrx_fft can be used as reference.

I would appreciate any help.

@zhovner
Copy link
Author

@zhovner zhovner commented Jan 5, 2019

Little quick start guide for those who maybe want to join me. @JessieAMorris @ducnguyenAstro @ccsh23 @ynour @mpbraendli

  1. Install XTRX libraries and headers. You should have them at following path:
    /usr/local/lib/libxtrx.so
    sources at /usr/include/libxtrx/

  2. Install URH with all dependencies

  3. Clone my fork in separate directory https://github.com/zhovner/urh/

Hardware support in URH made by Cython wrappers of original C libraries.
Here is the manual of this technique https://cython.readthedocs.io/en/latest/src/tutorial/clibraries.html

Here is an example for HackRF (libhackrf):

I write some XTRX wrappers:

To build this Cython wrapper into binary use this script: urh/src/urh/cythonext/build.py
In my fork it builds only XTRX lib ignoring others.

For the current moment I can build it successfully but not sure if it even works :)

@zhovner
Copy link
Author

@zhovner zhovner commented Jan 5, 2019

I can now successfully initialize XTRX using my wrappers. Real breakthrough for me.

$ python3 ./tests/device/TestXTRX.py 

WARN:   xtrxllpciev0_discovery:238 [PCIE] XTRX PCIe driver isn't loaded
DEBUG:  xtrxllusb3380v0_discovery:788 [USB3] usb3380: Found `usb3380://2/2/5` speed 480Mbit

XTRX Found

@JessieAMorris
Copy link

@JessieAMorris JessieAMorris commented Jan 5, 2019

Nice. Have you committed your changes on your branch? I've been adding some of the auxiliary stuff that was missing, i.e. device config, etc. Mostly still working on getting familiar with the urh codebase still.

@zhovner
Copy link
Author

@zhovner zhovner commented Jan 6, 2019

Have you committed your changes on your branch?

Yes. At this moment we need to work at xtrx.pyx to add all necessary functions. I think the good first step is to implement receive only functionality.

@JessieAMorris
Copy link

@JessieAMorris JessieAMorris commented Jan 6, 2019

I've made a good start on that. I have device listing and device opening working at this point. I'm working on frequency setting, gain, etc. as well.

@JessieAMorris
Copy link

@JessieAMorris JessieAMorris commented Jan 6, 2019

Not sure if you want to give me permissions to push to your fork or if I should just fork yours.

@JessieAMorris
Copy link

@JessieAMorris JessieAMorris commented Jan 6, 2019

For now, I've just created a fork to be able to push my code and so you can see what I've done so far: https://github.com/JessieAMorris/urh

I did have to go into the options menu in urh and enable the XTRX portion to get it to show up in the devices.

@zhovner
Copy link
Author

@zhovner zhovner commented Jan 6, 2019

Not sure if you want to give me permissions to push to your fork or if I should just fork yours.

I've grant you access to my repo. Fell free to merge.

@JessieAMorris
Copy link

@JessieAMorris JessieAMorris commented Jan 6, 2019

@zhovner I just pushed up my changes. I have a working (I think) spectrum analyzer now. I'm not sure if the data is accurate yet, but it is showing something that seems reasonable ish. I think I need to figure out gain options next.

Error handling still seems to be pretty poor. It seems like the XTRX can get into a funky state pretty easily. I've found that setting the sample rate is needed before tuning the radio and subsequent sample rate changes are iffy at best.

I've found that the test_xtrx command in the libxtrx/build/ director (in the actual libxtrx project) seems to reset it and get into a healthy state.

@zhovner
Copy link
Author

@zhovner zhovner commented Jan 7, 2019

Great, will test in few days.

@zhovner
Copy link
Author

@zhovner zhovner commented Jan 7, 2019

I've record a screencast of testing spectrum analyzer with RTL-SDR and XTRX for comparison.

RTL-SDR: https://files.catbox.moe/zwsob8.mp4
XTRX: https://files.catbox.moe/2sysxl.mp4

Looks like XTRX does not receive any data. Sometimes it shows some static signal when i press Start button, but no new signal after. But at least it found a correct device identifier :)

@JessieAMorris
Copy link

@JessieAMorris JessieAMorris commented Jan 7, 2019

Yeah, I can believe that. I need to take a closer look at the data that the xtrx is outputting and make sure that I'm formatting it correctly for urh. I probably won't have any time until tomorrow to look at that.

@m4ver1cks
Copy link

@m4ver1cks m4ver1cks commented Feb 22, 2019

I have been able to use XTRX in URH via gnuradio.
image

I'm using Manjaro so some steps could be different.
0º You need to install gnuradio-osmosdr from xtrx branch and ensure that you are using the correct drivers. Yo can ensure launching the osmocom_fft and if in the line that shows all drivers loaded (in my computer "built-in source types: file osmosdr fcd rtl rtl_tcp uhd hackrf rfspace airspy soapy redpitaya xtrx") have the string xtrx you are lucky.
1º I download the code from GIT.
2º I copy the files hackrf_recv.py and hack_send.py to xtrx_recv.py and xtrx_send.py (The files are located in the following folder : /urh/src/urh/dev/gr/scripts)
3º Modify some lines in each new files. Replace "hackrf" to "xtrx", Replace 433000 to 433000000.
4º Modify the file dev/BackendHandler.py and add xtrx in the list of the hardware ( DEVICE_NAMES = ("AirSpy R2", "AirSpy Mini", "BladeRF", "FUNcube", "HackRF",
"LimeSDR", "PlutoSDR", "RTL-SDR", "RTL-TCP", "SDRPlay", "SoundCard", "USRP", "xtrx"))
5º Install the package python2-pyzmq

@JessieAMorris
Copy link

@JessieAMorris JessieAMorris commented Feb 25, 2019

I just pushed my fixes to @zhovner's master branch.

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

No branches or pull requests

4 participants