|
2 | 2 |
|
3 | 3 | python_bladerf is a cython wrapper for [bladerf](https://github.com/Nuand/bladeRF). It also contains some additional tools. |
4 | 4 |
|
5 | | -Before installing python_bladerf library, you must have bladerf host software installed. Because this library uses dynamic linking with an existing library file. |
| 5 | +Before installing python_bladerf library, you must have bladerf host software installed. Because this library uses dynamic linking with an existing library file. Minimum libbladeRF version: 2.5.5 |
6 | 6 |
|
| 7 | +For windows users please use [additional steps](#installation-on-windows) to install python_bladerf |
7 | 8 | You can install this library using |
8 | 9 | ``` |
9 | 10 | pip install git+https://github.com/GvozdevLeonid/python_bladerf.git |
10 | 11 | ``` |
11 | 12 |
|
12 | 13 | If your bladerf files are in non-standard paths and during installation the python_bladerf cannot find libbladeRF.h and bladeRF2.h or the library files, you can specify the paths via environment variables |
13 | 14 | ``` |
14 | | -export PYTHON_BLADERF_CFLAGS=path_to_libbladeRF.h_andbladeRF2.h |
15 | | -export PYTHON_BLADERF_LDFLAGS=path_to_libbladerf.(so, dylib, dll) |
| 15 | +export/set {linux and macos / windows} PYTHON_BLADERF_CFLAGS=path_to_libbladeRF.h_andbladeRF2.h |
| 16 | +export/set {linux and macos / windows} PYTHON_BLADERF_LDFLAGS=path_to_libbladerf.(so, dylib, dll) |
16 | 17 | ``` |
17 | 18 |
|
18 | 19 | ## Requirements: |
19 | | -* libusb-1.0 (https://github.com/libusb/libusb) |
20 | | -* libBladeRF (https://github.com/Nuand/bladeRF) |
21 | | -* Cython==0.29.37 |
22 | 20 | * Numpy>=2.2.1 |
23 | 21 | * Scipy (optional, for faster work) |
24 | 22 | * pyFFTW (optional, for faster work) |
@@ -125,4 +123,45 @@ pythonforandroidrecipes/ |
125 | 123 | ``` |
126 | 124 |
|
127 | 125 | ## Examples |
128 | | -Please use the original bladerf documentation |
| 126 | +Please use the original bladerf documentation |
| 127 | + |
| 128 | +## Installation on Windows |
| 129 | +To install python_bladerf, you must first install the BladeRF software. Official installation instructions are available on the [BladeRF documentation site](https://github.com/Nuand/bladeRF/wiki/Getting-Started%3A-Windows). |
| 130 | +Alternatively, you can download the ZIP archive from the Releases tab of this repository. Extract the archive and move its contents to the standard location: `C:\Program Files\BladeRF` |
| 131 | + |
| 132 | +The BladeRF directory should contain the following subfolders and files: |
| 133 | +``` |
| 134 | +├── include |
| 135 | +│ └── libbladeRF.h |
| 136 | +│ └── bladeRF2.h |
| 137 | +│ └── bladeRF1.h |
| 138 | +│ └── pthread.h |
| 139 | +├── lib |
| 140 | +│ └── bladeRF.dll |
| 141 | +│ └── bladeRF.lib ← for MSVC |
| 142 | +│ └── libbladeRF.a ← for MinGW |
| 143 | +│ └── libusb-1.0.dll |
| 144 | +│ └── pthreadVC2.dll |
| 145 | +│ └── msvcr100.dll |
| 146 | +``` |
| 147 | + |
| 148 | + |
| 149 | +In addition, the archive includes other required DLLs and dependencies to ensure proper operation of HackRF on Windows. |
| 150 | +libusb-1.0.dll |
| 151 | +pthreadVC2.dll |
| 152 | +msvcr100.dll |
| 153 | + |
| 154 | +If you install bladerf yourself or via another path, set the following environment variables |
| 155 | + |
| 156 | +MSVC: |
| 157 | +``` |
| 158 | + set PYTHON_BLADERF_CFLAGS=/I"{path to .h file directory}" |
| 159 | + set PYTHON_BLADERF_LDFLAGS=/LIBPATH:"{path to .dll and .lib file directory}" bladeRF.lib |
| 160 | + set BLADERF_LIB_DIR="{path to .dll and .lib file directory}" |
| 161 | +``` |
| 162 | +MinGW: |
| 163 | +``` |
| 164 | + set PYTHON_BLADERF_CFLAGS=-I"{path to .h file directory}" |
| 165 | + set PYTHONBLADERFF_LDFLAGS=-L"{path to .dll and .a file directory}" -lbladeRF' |
| 166 | + set BLADERF_LIB_DIR="{path to .dll and .lib file directory}" |
| 167 | +``` |
0 commit comments