Closed thesubtlety closed 3 years ago
I believe it's when they updated the libbladerf library to 2.0: https://nuand.com/libbladeRF-doc/v2.1.0/relnotes_2_0.html
I was able to compile LTE-Cell-Scanner with these changes I made:
diff --git a/src/CellSearch.cpp b/src/CellSearch.cpp
index 8df062b..22fd03d 100644
--- a/src/CellSearch.cpp
+++ b/src/CellSearch.cpp
@@ -862,7 +862,7 @@ int config_bladerf(
if (dev!=NULL) {bladerf_close(dev); dev = NULL; return(-1);}
}
- unsigned int actual_frequency;
+ long unsigned int actual_frequency;
status = bladerf_get_frequency(dev, BLADERF_MODULE_RX, &actual_frequency);
if (status != 0) {
printf("config_bladerf bladerf_get_frequency: Failed to read back frequency: %s\n",
diff --git a/src/LTE-Tracker.cpp b/src/LTE-Tracker.cpp
index d2bcf28..ff586ce 100644
--- a/src/LTE-Tracker.cpp
+++ b/src/LTE-Tracker.cpp
@@ -954,7 +954,7 @@ int config_bladerf(
if (dev!=NULL) {bladerf_close(dev); dev = NULL; return(-1);}
}
- unsigned int actual_frequency;
+ long unsigned int actual_frequency;
status = bladerf_get_frequency(dev, BLADERF_MODULE_RX, &actual_frequency);
if (status != 0) {
printf("config_bladerf bladerf_get_frequency: Failed to read back frequency: %s\n",
diff --git a/src/capbuf.cpp b/src/capbuf.cpp
index 68d6b95..c8c7ae5 100644
--- a/src/capbuf.cpp
+++ b/src/capbuf.cpp
@@ -87,7 +87,7 @@ int open_bladerf_board(bladerf_device * & bladerf_dev, unsigned int freq_hz, uns
return(-1);
}
- status = bladerf_sync_config(bladerf_dev, BLADERF_MODULE_RX, BLADERF_FORMAT_SC16_Q11, 2, buffer_size, 1, 3500);
+ status = bladerf_sync_config(bladerf_dev, BLADERF_RX_X1, BLADERF_FORMAT_SC16_Q11, 2, buffer_size, 1, 3500);
if (status != 0) {
printf("open_bladerf_board bladerf_sync_config: Failed to configure sync interface: %s\n",
bladerf_strerror(status));
➜ wget https://gist.githubusercontent.com/tonylambiris/466e92a65b2d6428348003049746262b/raw/1644e6c114ddc74aed275b5436194e1d73de8a64/bladerf.diff
➜ patch -Np1 -i bladerf.diff
patching file src/CellSearch.cpp
patching file src/LTE-Tracker.cpp
patching file src/capbuf.cpp
patch unexpectedly ends in middle of line
Hunk #1 succeeded at 87 with fuzz 1.
➜ cmake -DUSE_BLADERF=1 ..
-- Try to find BLADERF LIB
-- Found BLADERF LIB: /usr/lib64/libbladeRF.so
...
➜ pacman -Qo /usr/lib64/libbladeRF.so
/usr/lib/libbladeRF.so is owned by libbladerf-git 2018.10.rc1.r19.g3211d25f-1
I don't have a bladeRF to test but if this works for you be sure to let @JiaoXianjun or myself know so it can be merged!
That worked like a charm, appreciate the links and patch. Working successfully with a bladeRF x40.
~/LTE-Cell-Scanner/build$ make
Scanning dependencies of target LTE_MISC
[ 5%] Building CXX object src/CMakeFiles/LTE_MISC.dir/capbuf.cpp.o
[ 11%] Building CXX object src/CMakeFiles/LTE_MISC.dir/constants.cpp.o
[ 16%] Building CXX object src/CMakeFiles/LTE_MISC.dir/itpp_ext.cpp.o
[ 22%] Building CXX object src/CMakeFiles/LTE_MISC.dir/macros.cpp.o
[ 27%] Building CXX object src/CMakeFiles/LTE_MISC.dir/searcher.cpp.o
[ 33%] Building CXX object src/CMakeFiles/LTE_MISC.dir/common.cpp.o
[ 38%] Building CXX object src/CMakeFiles/LTE_MISC.dir/dsp.cpp.o
[ 44%] Building CXX object src/CMakeFiles/LTE_MISC.dir/lte_lib.cpp.o
[ 50%] Building CXX object src/CMakeFiles/LTE_MISC.dir/from_osmocom.cpp.o
[ 55%] Linking CXX static library libLTE_MISC.a
[ 55%] Built target LTE_MISC
Scanning dependencies of target CellSearch
[ 61%] Building CXX object src/CMakeFiles/CellSearch.dir/CellSearch.cpp.o
[ 66%] Linking CXX executable CellSearch
[ 66%] Built target CellSearch
Scanning dependencies of target LTE-Tracker
[ 72%] Building CXX object src/CMakeFiles/LTE-Tracker.dir/LTE-Tracker.cpp.o
[ 77%] Building CXX object src/CMakeFiles/LTE-Tracker.dir/producer_thread.cpp.o
[ 83%] Building CXX object src/CMakeFiles/LTE-Tracker.dir/tracker_thread.cpp.o
[ 88%] Building CXX object src/CMakeFiles/LTE-Tracker.dir/searcher_thread.cpp.o
[ 94%] Building CXX object src/CMakeFiles/LTE-Tracker.dir/display_thread.cpp.o
[100%] Linking CXX executable LTE-Tracker
[100%] Built target LTE-Tracker
@JiaoXianjun would you like me to create a pull-request for this?
@thesubtlety currently have a bladeRF 2.0 micro xA4 en route so I'll do some more testing once I get that in to figure out better default initialization values I've seen from other projects.
Running into an error while running
make
:error: invalid conversion from ‘int’ to ‘bladerf_channel_layout’
. Any thoughts?Running on Ubuntu 16.04 x64
Successful cmake: