EFForg / crocodilehunter

Taking one back for Steve Irwin     (๑•̀ㅂ•́)و
GNU General Public License v3.0
944 stars 135 forks source link

test with limesdr and other sdrs supported by soapysdr #86

Closed cooperq closed 3 years ago

cooperq commented 3 years ago

Test to see if crocodile hunter can run on a cheaper SDR:

alexballas commented 3 years ago

Yes, I also get the

[ERROR] Tx Calibration: MCU error 4 (SXT tune failed)

but only once.

I fixed the first errors as you said. Would it be possible to check the memory usage of cell_measurement? It seems to go up faster if you have multiple earfcns

cooperq commented 3 years ago

Would it be possible to check the memory usage of cell_measurement?

The memory leak error was fixed in the commit referenced in #84. If you pull the latest release (and update the srsLTE sub repo) you will get the fix.

cooperq commented 3 years ago

UPDATE: IT WORKS see next comment original comment below.


I just ran cell_measurement on my machine with a lime SDR mini and also get the error above: [ERROR] Tx Calibration: MCU error 4 (SXT tune failed) cell measurement goes as far as decoding the mib on the first pass but can't seem to decode it on the second pass or decode the sib. Going to look into this more. Once we get it working with the C code I will fix the bash script.

$ ./lib/examples/cell_measurement -z 5035,5230,5110,5330,5780
- Scanning 5 EARFCNs
Opening RF device...
[INFO] [UHD] linux; GNU C++ version 9.2.1 20200304; Boost_107100; UHD_3.15.0.0-2build5
Opening USRP with args: 
Error opening UHD: code 11
Soapy has found device #0: addr=24607:1027, driver=lime, label=LimeSDR Mini [USB 2.0] 1D3CCBDE66D3FA, media=USB 2.0, module=FT601, name=LimeSDR Mini, serial=1D3CCBDE66D3FA, 
[INFO] Make connection: 'LimeSDR Mini [USB 2.0] 1D3CCBDE66D3FA'
[INFO] Reference clock 40.00 MHz
[INFO] Device name: LimeSDR-Mini
[INFO] Reference: 40 MHz
[INFO] LMS7002M register cache: Disabled
[INFO] RX LPF configured
[INFO] RX LPF configured
Set Rx bandwidth to 2.50 MHz
[INFO] Filter calibrated. Filter order-4th, filter bandwidth set to 5 MHz.Real pole 1st order filter set to 2.5 MHz. Preemphasis filter not active
[INFO] TX LPF configured
Set Tx bandwidth to 5.00 MHz
Setting up RX stream
Setting up TX stream
Available device sensors: 
 - clock_locked
 - lms7_temp
Available sensors for RX channel 0: 
 - lo_locked
[ERROR] Tx Calibration: MCU error 4 (SXT tune failed)
[INFO] Rx calibration finished
State of gain elements for Rx channel 0 (AGC not supported):
 - TIA: 9.00 dB
 - LNA: 30.00 dB
 - PGA: -4.00 dB
State of gain elements for Tx channel 0 (AGC not supported):
 - TIA: 9.00 dB
 - LNA: 30.00 dB
 - PGA: -4.00 dB
Rx antenna set to LNAH
Tx antenna set to BAND1
Starting AGC thread...
Set master clock rate to 245.76 MHz
******* first init multi
***** plan dft 1d
<snip>
******* first init multi done 
[INFO] Selected RX path: LNAW
Tuned Rx to 731.50 MHz
[  0/5]: EARFCN 5035 Freq. 731.50 MHz looking for PSS.
Set Rx bandwidth to 2.50 MHz
[INFO] Rx calibration finished
Tuned Rx to 751.00 MHz
[  1/5]: EARFCN 5230 Freq. 751.00 MHz looking for PSS.
Set Rx bandwidth to 2.50 MHz
[INFO] Rx calibration finished
Tuned Rx to 739.00 MHz
[  2/5]: EARFCN 5110 Freq. 739.00 MHz looking for PSS.
Set Rx bandwidth to 2.50 MHz
[INFO] Rx calibration finished
******* rf_mib_decoder
***** plan dft 1d
<snip>
Set Rx bandwidth to 2.50 MHz
[INFO] Rx calibration finished
******* rf_mib_decoder_done
Found CELL ID 416. 50 PRB, 2 ports
Tunning receiver to 739.000 MHz
Set master clock rate to 245.76 MHz
Setting sampling rate 11.52 MHz
[INFO] RX LPF configured
Set Rx bandwidth to 8.64 MHz
******* init multi
***** plan dft 1d
<snip>
***** plan dft 1d
******* start rx stream
[INFO] Rx calibration finished
******* start rx stream done
******* Begin SIB Decoding Loop******* Decoding MIB try 1
******* Decoding MIB try 2
******* Decoding MIB try 3
******* Decoding MIB try 4
******* Decoding MIB try 5
******* Decoding MIB try 6
******* Decoding MIB try 7
******* Decoding MIB try 8
******* Decoding MIB try 9
******* Decoding MIB try 10
******* Decoding MIB try 11
******* Decoding MIB try 12
******* Decoding MIB try 13
******* Decoding MIB try 14
******* Decoding MIB try 15
******* Decoding MIB try 16
******* Decoding MIB try 17
******* Decoding MIB try 18
******* Decoding MIB try 19
******* Decoding MIB try 20
******* Decoding MIB try 21
Tuned Rx to 763.00 MHz    7.8, FrameCnt: 0, State: 1
[  3/5]: EARFCN 5330 Freq. 763.00 MHz looking for PSS.
[INFO] RX LPF configured
Set Rx bandwidth to 2.50 MHz
[ERROR] Rx calibration: MCU error 4 (SXT tune failed)
cooperq commented 3 years ago

Update: IT WORKS Apparently the solution was to plug it into a USB3 port and connect some better antennas! Here is the output from SoapySDRUtil:

$ SoapySDRUtil --find
######################################################
##     Soapy SDR -- the SDR abstraction library     ##
######################################################
Found device 0
  addr = 24607:1027
  driver = lime
  label = LimeSDR Mini [USB 3.0] 1D3CCBDE66D3FA
  media = USB 3.0
  module = FT601
  name = LimeSDR Mini
  serial = 1D3CCBDE66D3FA

and here is the output from crocoidle hunter :

* 11:10:44 home2 - INFO starting crocodile hunter project: home2
 * 11:10:44 home2 - INFO Starting WebUI
 * 11:10:44 home2 - INFO  * Running on http://0.0.0.0:5000/ (Press CTRL+C to quit)
 * 11:10:44 home2 - INFO Checking for config file
 * 11:10:44 home2 - INFO Skipping GPS test
 * 11:10:44 home2 - INFO Compiling srsUE
 * 11:10:44 home2 - INFO SrsUE built succesfully
 * 11:10:44 home2 - INFO Reticulating Splines
 * 11:10:44 home2 - SUCCESS Watchdog server running
 * 11:10:44 home2 - NOTICE Using earfcn list <snip>
 * 11:10:44 home2 - INFO Running srsUE
 * 11:10:44 home2 - SUCCESS srsUE started with pid 120685
 * 11:11:05 home2 - SUCCESS Adding a new tower: <snip>
 * 11:11:05 home2 - INFO Calculating suspiciousness for <snip>
 * 11:11:05 home2 - VERBOSE Found 1 towers a total of 1 times

And it goes on like that finding several other cells. The only change I made was to remove the SDR checking stuff from the bash script. 0ab5ac52635569912b8d474f9d213d7c61ab141f In conclusion try the following steps:

  1. Plug into usb3
  2. Pull the latest release
  3. Get an LTE antenna or get up high if you are using the stubby antennas that come with the limeSDR mini.

If those don't let you run crocodile hunter with the limeSDR mini please comment here.

alexballas commented 3 years ago

Great work @cooperq ! I just tested with the latest version and cell_measurement seems to be doing find in terms of memory usage so far. Will test more.

I had mine running for 5 minutes (indoors) and got -> * 21:27:19 default - VERBOSE Found 4 towers a total of 27 times

I had one last question about the towers I get.

I seem to be always getting a "eNodeb id" with value 0 and a PLMN value of 0-0. I get other ledgit towers, but that entry is always there too.

cooperq commented 3 years ago

yea I've noticed that in the past. I've been told that a 0-0-0 cell can be broadcast when an eNodeB is rebooting sometimes. You should go track it down using the GPS and direction finding!

alphafox02 commented 3 years ago

This is great news. Thanks for making so many improvements. I’ll test it out ASAP. I’ve been using usb3 and good antennas so hopefully the improvements in the code will yield good results. A mini is such a great priced radio to use for this project!

alexballas commented 3 years ago

On another subject, MyriadRF confirmed here that they're working on a native version of the LimeSDR library for srsLTE which will also (hopefully) make things much smoother.

alphafox02 commented 3 years ago

Speaking of uhd and soapy.. Are you guys now testing and finding good results with just soapy or uhd soapy when running the crocodile hunter?

edit: I see the outputs above which look as though you’re using just straight soapy. I’ll try both.

cooperq commented 3 years ago

I was using just soapy with the lime rf. I'll try UHD Soapy as well with the UHD device I have though.

alphafox02 commented 3 years ago

I just mentioned uhd soapy because if I build this and have the uhd driver and soapy installed uhd Soapy takes precedence with the lime sdr until I go disable uhd in the cmake file and build srslte with just soapy support.

cooperq commented 3 years ago

does this cause a bug? Can you show me what the output is? I'm a little slow today but I don't totally understand the problem.

alphafox02 commented 3 years ago

Built the latest and it works great so far with the lime-sdr. I didn’t change a thing at first so when I started it up it was using the “uhd soapy” with the LimeSDR. It seemed to run but something didn’t seem right, didn’t run it long enough to really evaluate it well.

So I stopped it, went in to srsLTE and changed the CMakefile list file to disable uhd and enable soapy. Rebuilt and reran and within a few minutes the LimeSDR found two cells/towers. It looked like it was running way faster with normal soapy when compared to uhd soapy.

Thanks for making this possible!

alphafox02 commented 3 years ago

This is with the CMakelist file like this, which I had to manually do and it seems to run faster with the limesdr.

option(ENABLE_GUI "Enable GUI (using srsGUI)" OFF) option(ENABLE_UHD "Enable UHD" OFF) option(ENABLE_BLADERF "Enable BladeRF" ON) option(ENABLE_SOAPYSDR "Enable SoapySDR" ON)

And with it like this, which is how it is by default (I'm running it again this way now and will get you feedback asap)

option(ENABLE_GUI "Enable GUI (using srsGUI)" OFF) option(ENABLE_UHD "Enable UHD" ON) option(ENABLE_BLADERF "Enable BladeRF" ON) option(ENABLE_SOAPYSDR "Enable SoapySDR" OFF)

alexballas commented 3 years ago

I know this is now closed. Just wanted to let you know that with the latest "master" checkout of LimeSuite, I don't get the " [ERROR] Tx Calibration: MCU error 4 (SXT tune failed)" any more

alphafox02 commented 3 years ago

Oh interesting. I’m using the packaged version in 20.04. Should I maybe look at replacing that and build with source?

alexballas commented 3 years ago

These latest changes in the LimeSuite repo were probably triggered by the following MyriadRF forums discussion: https://discourse.myriadrf.org/t/how-to-fix-the-error-tx-calibration-mcu-error-4-sxt-tune-failed/

I would certainly recommend compiling from source. You just need to make sure that you also compile the latest 0.7.x version of Soapy SDR as the Master SoapySDR version defaults to 0.8 which is not supported by LimeSuite yet. https://github.com/pothosware/SoapySDR/tree/soapy-sdr-0.7.2

tip: I used checkinstall to install the compiled versions instead of doing a make install as it generates deb files and it's cleaner.

alphafox02 commented 3 years ago

Thanks for the tip! I do have soapysdr 0.7 in place and I like the idea of the deb packages, I’ll have to give it a try ASAP.

cooperq commented 3 years ago

Thanks for coninuing to test!