Skip to content

Commit

Permalink
Added control of external antenna amplifier which adds 14dB of gain.
Browse files Browse the repository at this point in the history
Support for linux added in release.
Compilation is now done using Linux to compile natively for Linux and cross compile native libs for Windows.
  • Loading branch information
pavsa committed Apr 18, 2020
1 parent 1996a84 commit 257e737
Show file tree
Hide file tree
Showing 357 changed files with 554,683 additions and 1,836 deletions.
3 changes: 0 additions & 3 deletions .gitmodules

This file was deleted.

44 changes: 26 additions & 18 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,37 +16,45 @@ Linux: read Installation section below
- Spur filter - removes spur artifacts from the spectrum
- hackrf_sweep integrated as a shared library

### Why?
Other software is limited or hard to use

### Requirements:
* HackRF One with [Firmware 2017.02.1](https://github.com/mossmann/hackrf/releases/tag/v2017.02.1) or newer (use linux inside virtual machine to [update the firmware](https://github.com/mossmann/hackrf/wiki/Updating-Firmware))
* HackRF One with [Firmware 2017.02.1](https://github.com/mossmann/hackrf/releases/tag/v2017.02.1) or newer (use linux inside virtual machine to [update the firmware](https://github.com/mossmann/hackrf/wiki/Updating-Firmware))

### Installation:
Make sure HackRF is using at least the minimum firmware version (see above)

Windows:
Windows:
1. Windows 7+ x64 required
1. Install Java JRE 64bit v1.8+
1. [Download the latest version of Spectrum Analyzer](https://github.com/pavsa/hackrf-spectrum-analyzer/releases) and unzip
1. Install HackRF as a libusb device
1. [Download Zadig](src/hackrf-sweep/lib/zadig_2.2.exe) and run
2. Goto Options and check List All Devices
1. [Download Zadig](src/hackrf-sweep/lib/zadig_2.2.exe) and run
2. Goto Options and check List All Devices
3. Find "HackRF One" and select Driver "WinUSB" and click install
1. Install (if you don't have one installed) [Java JRE for Windows x64](http://www.oracle.com/technetwork/java/javase/downloads/jre8-downloads-2133155.html)
1. Run "hackrf_sweep_spectrum_analyzer.exe"

Linux (beta - only ubuntu tested):
1. Needs to be compiled first, so you'll need to install these packages:
`sudo apt install build-essential ant git libusb-1.0 libfftw3 libfftw3-dev openjdk-8-jdk`
1. `git clone --depth=1 --recurse-submodules https://github.com/pavsa/hackrf-spectrum-analyzer.git`
1. Install (if you don't have one installed) [Java JRE for Windows x64](http://www.oracle.com/technetwork/java/javase/downloads/jre8-downloads-2133155.html)
1. Run "hackrf_sweep_spectrum_analyzer_windows.cmd"

Linux:

1. To run, ensure these packages are installed (exact name depends on distro):
`libusb-1.0 libfftw3 default-jdk`
1. Newer openjdk might work also, not tested. On Ubuntu 18.04:
`sudo apt install libusb-1.0 libfftw3-bin default-jdk`
1. Follow the [HackRF USB permissions setup](https://github.com/mossmann/hackrf/wiki/FAQ) - you have to add rules to udev to allow hackrf library to open the HackRF USB device, it does not work by default.

If something does not work, you can try to build it manually.

### Building
Building native libraries for Windows (using mingw-w64) and linux is done in one unified build using Ubuntu 18.04 x64.
1. You'll need to install these packages:
`sudo apt install build-essential ant git libusb-1.0 libfftw3-bin libfftw3-dev default-jdk mingw-w64`
1. `git clone --depth=1 https://github.com/pavsa/hackrf-spectrum-analyzer.git`
1. `cd hackrf-spectrum-analyzer/src/hackrf-sweep/`
1. `make`
1. `build/hackrf_sweep_spectrum_analyzer.sh`
1. `make`
1. To run, simply execute: `build/hackrf_sweep_spectrum_analyzer_linux.sh`

### Known issues:
* Spectrum updates stop on parameter change
* Solution: press reset button on the HackRF (firmware bug)
* Solution: press reset button on the HackRF (firmware bug)

### License:
GPL v3
GPL v3
30 changes: 15 additions & 15 deletions src/hackrf-sweep/.classpath
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src-java">
<attributes>
<attribute name="org.eclipse.jdt.launching.CLASSPATH_ATTR_LIBRARY_PATH_ENTRY" value="hackrf-sweep/build/lib"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/jdk_x64"/>
<classpathentry kind="lib" path="miglayout15-swing.jar" sourcepath="miglayout-src.zip"/>
<classpathentry kind="lib" path="lib/jcommon-1.0.17.jar"/>
<classpathentry kind="lib" path="lib/jfreechart-1.0.14.jar"/>
<classpathentry kind="lib" path="lib/hackrf-sweep-jna.jar"/>
<classpathentry kind="lib" path="lib/jna/jna-4.5.1.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src-java">
<attributes>
<attribute name="org.eclipse.jdt.launching.CLASSPATH_ATTR_LIBRARY_PATH_ENTRY" value="hackrf-sweep/build/lib"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="lib" path="miglayout15-swing.jar" sourcepath="miglayout-src.zip"/>
<classpathentry kind="lib" path="lib/jcommon-1.0.17.jar"/>
<classpathentry kind="lib" path="lib/jfreechart-1.0.14.jar"/>
<classpathentry kind="lib" path="lib/jna/jna-4.5.1.jar"/>
<classpathentry kind="lib" path="lib/hackrf-sweep-jna.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>
80 changes: 43 additions & 37 deletions src/hackrf-sweep/.cproject
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
</externalSetting>
</externalSettings>
<extensions>
<extension id="org.eclipse.cdt.core.PE" point="org.eclipse.cdt.core.BinaryParser"/>
<extension id="org.eclipse.cdt.core.GNU_ELF" point="org.eclipse.cdt.core.BinaryParser"/>
<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
Expand All @@ -23,35 +23,35 @@
</extensions>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<configuration artifactExtension="dll" artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.sharedLib" buildProperties="org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.sharedLib,org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug" cleanCommand="rm -rf" description="" id="cdt.managedbuild.config.gnu.mingw.so.debug.1593016443" name="Debug" parent="cdt.managedbuild.config.gnu.mingw.so.debug">
<configuration artifactExtension="dll" artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.sharedLib" buildProperties="org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.sharedLib,org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug" cleanCommand="rm -rf" description="" id="cdt.managedbuild.config.gnu.mingw.so.debug.1593016443" name="Debug" optionalBuildProperties="org.eclipse.cdt.docker.launcher.containerbuild.property.selectedvolumes=,org.eclipse.cdt.docker.launcher.containerbuild.property.volumes=" parent="cdt.managedbuild.config.gnu.mingw.so.debug">
<folderInfo id="cdt.managedbuild.config.gnu.mingw.so.debug.1593016443." name="/" resourcePath="">
<toolChain id="cdt.managedbuild.toolchain.gnu.mingw.so.debug.120857886" name="MinGW GCC" superClass="cdt.managedbuild.toolchain.gnu.mingw.so.debug">
<targetPlatform id="cdt.managedbuild.target.gnu.platform.mingw.so.debug.384274225" name="Debug Platform" superClass="cdt.managedbuild.target.gnu.platform.mingw.so.debug"/>
<builder arguments="ARCH=x86-64 V=1" buildPath="${workspace_loc:/hackr-sweep}" command="make" id="cdt.managedbuild.target.gnu.builder.base.157368562" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="Gnu Make Builder" superClass="cdt.managedbuild.target.gnu.builder.base"/>
<tool id="cdt.managedbuild.tool.gnu.assembler.mingw.so.debug.1985658406" name="GCC Assembler" superClass="cdt.managedbuild.tool.gnu.assembler.mingw.so.debug">
<inputType id="cdt.managedbuild.tool.gnu.assembler.input.436238322" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>
<toolChain id="cdt.managedbuild.toolchain.gnu.base.181100997" name="Linux GCC" superClass="cdt.managedbuild.toolchain.gnu.base">
<targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.GNU_ELF" id="cdt.managedbuild.target.gnu.platform.base.2112321933" name="Debug Platform" osList="linux,hpux,aix,qnx" superClass="cdt.managedbuild.target.gnu.platform.base"/>
<builder buildPath="${workspace_loc:/hackr-sweep}" command="make" id="cdt.managedbuild.target.gnu.builder.base.1422315380" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="Gnu Make Builder" superClass="cdt.managedbuild.target.gnu.builder.base"/>
<tool id="cdt.managedbuild.tool.gnu.archiver.base.1675203888" name="GCC Archiver" superClass="cdt.managedbuild.tool.gnu.archiver.base"/>
<tool id="cdt.managedbuild.tool.gnu.cpp.compiler.base.1626002149" name="GCC C++ Compiler" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.base">
<option id="gnu.cpp.compiler.option.optimization.level.1565647391" name="Optimization Level" superClass="gnu.cpp.compiler.option.optimization.level" useByScannerDiscovery="false" value="gnu.cpp.compiler.optimization.level.none" valueType="enumerated"/>
<option defaultValue="gnu.cpp.compiler.debugging.level.max" id="gnu.cpp.compiler.option.debugging.level.234040940" name="Debug Level" superClass="gnu.cpp.compiler.option.debugging.level" useByScannerDiscovery="false" valueType="enumerated"/>
<inputType id="cdt.managedbuild.tool.gnu.cpp.compiler.input.707260741" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.input"/>
</tool>
<tool id="cdt.managedbuild.tool.gnu.archiver.mingw.base.427353119" name="GCC Archiver" superClass="cdt.managedbuild.tool.gnu.archiver.mingw.base"/>
<tool id="cdt.managedbuild.tool.gnu.cpp.compiler.mingw.so.debug.1293744797" name="GCC C++ Compiler" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.mingw.so.debug">
<option id="gnu.cpp.compiler.mingw.so.debug.option.optimization.level.1337021707" name="Optimization Level" superClass="gnu.cpp.compiler.mingw.so.debug.option.optimization.level" useByScannerDiscovery="false" value="gnu.cpp.compiler.optimization.level.none" valueType="enumerated"/>
<option id="gnu.cpp.compiler.mingw.so.debug.option.debugging.level.1772080425" name="Debug Level" superClass="gnu.cpp.compiler.mingw.so.debug.option.debugging.level" useByScannerDiscovery="false" value="gnu.cpp.compiler.debugging.level.max" valueType="enumerated"/>
<inputType id="cdt.managedbuild.tool.gnu.cpp.compiler.input.876443251" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.input"/>
<tool id="cdt.managedbuild.tool.gnu.c.compiler.base.819000094" name="GCC C Compiler" superClass="cdt.managedbuild.tool.gnu.c.compiler.base">
<option defaultValue="gnu.c.optimization.level.none" id="gnu.c.compiler.option.optimization.level.659671539" name="Optimization Level" superClass="gnu.c.compiler.option.optimization.level" useByScannerDiscovery="false" valueType="enumerated"/>
<option defaultValue="gnu.c.debugging.level.max" id="gnu.c.compiler.option.debugging.level.1895380364" name="Debug Level" superClass="gnu.c.compiler.option.debugging.level" useByScannerDiscovery="false" valueType="enumerated"/>
<inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.1640805667" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/>
</tool>
<tool id="cdt.managedbuild.tool.gnu.c.compiler.mingw.so.debug.1235079492" name="GCC C Compiler" superClass="cdt.managedbuild.tool.gnu.c.compiler.mingw.so.debug">
<option defaultValue="gnu.c.optimization.level.none" id="gnu.c.compiler.mingw.so.debug.option.optimization.level.1748632687" name="Optimization Level" superClass="gnu.c.compiler.mingw.so.debug.option.optimization.level" useByScannerDiscovery="false" valueType="enumerated"/>
<option id="gnu.c.compiler.mingw.so.debug.option.debugging.level.1282058530" name="Debug Level" superClass="gnu.c.compiler.mingw.so.debug.option.debugging.level" useByScannerDiscovery="false" value="gnu.c.debugging.level.max" valueType="enumerated"/>
<inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.1100200210" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/>
<tool id="cdt.managedbuild.tool.gnu.c.linker.base.1230066790" name="GCC C Linker" superClass="cdt.managedbuild.tool.gnu.c.linker.base">
<option defaultValue="true" id="gnu.c.link.option.shared.398376598" name="Shared (-shared)" superClass="gnu.c.link.option.shared" valueType="boolean"/>
</tool>
<tool id="cdt.managedbuild.tool.gnu.c.linker.mingw.so.debug.107859939" name="MinGW C Linker" superClass="cdt.managedbuild.tool.gnu.c.linker.mingw.so.debug">
<option defaultValue="true" id="gnu.c.link.mingw.so.debug.option.shared.55419991" name="Shared (-shared)" superClass="gnu.c.link.mingw.so.debug.option.shared" valueType="boolean"/>
</tool>
<tool id="cdt.managedbuild.tool.gnu.cpp.linker.mingw.so.debug.1802756123" name="MinGW C++ Linker" superClass="cdt.managedbuild.tool.gnu.cpp.linker.mingw.so.debug">
<option defaultValue="true" id="gnu.cpp.link.mingw.so.debug.option.shared.708005642" name="Shared (-shared)" superClass="gnu.cpp.link.mingw.so.debug.option.shared" valueType="boolean"/>
<inputType id="cdt.managedbuild.tool.gnu.cpp.linker.input.566588167" superClass="cdt.managedbuild.tool.gnu.cpp.linker.input">
<tool id="cdt.managedbuild.tool.gnu.cpp.linker.base.216889933" name="GCC C++ Linker" superClass="cdt.managedbuild.tool.gnu.cpp.linker.base">
<option defaultValue="true" id="gnu.cpp.link.option.shared.283880789" name="Shared (-shared)" superClass="gnu.cpp.link.option.shared" valueType="boolean"/>
<inputType id="cdt.managedbuild.tool.gnu.cpp.linker.input.165879966" superClass="cdt.managedbuild.tool.gnu.cpp.linker.input">
<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
<additionalInput kind="additionalinput" paths="$(LIBS)"/>
</inputType>
</tool>
<tool id="cdt.managedbuild.tool.gnu.assembler.base.60194713" name="GCC Assembler" superClass="cdt.managedbuild.tool.gnu.assembler.base">
<inputType id="cdt.managedbuild.tool.gnu.assembler.input.702091883" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>
</tool>
</toolChain>
</folderInfo>
</configuration>
Expand All @@ -71,7 +71,7 @@
</externalSetting>
</externalSettings>
<extensions>
<extension id="org.eclipse.cdt.core.PE" point="org.eclipse.cdt.core.BinaryParser"/>
<extension id="org.eclipse.cdt.core.PE64" point="org.eclipse.cdt.core.BinaryParser"/>
<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
Expand Down Expand Up @@ -117,30 +117,36 @@
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<project id="hackr-sweep.cdt.managedbuild.target.gnu.mingw.so.1615767184" name="Shared Library" projectType="cdt.managedbuild.target.gnu.mingw.so"/>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/>
<storageModule moduleId="org.eclipse.cdt.make.core.buildtargets"/>
<storageModule moduleId="refreshScope" versionNumber="2">
<configuration configurationName="Debug">
<resource resourceType="PROJECT" workspacePath="/hackr-sweep"/>
</configuration>
<configuration configurationName="Release">
<resource resourceType="PROJECT" workspacePath="/hackr-sweep"/>
</configuration>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/>
<storageModule moduleId="scannerConfiguration">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.mingw.so.debug.1593016443;cdt.managedbuild.config.gnu.mingw.so.debug.1593016443.;cdt.managedbuild.tool.gnu.c.compiler.mingw.so.debug.1235079492;cdt.managedbuild.tool.gnu.c.compiler.input.1100200210">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.mingw.so.release.104877975;cdt.managedbuild.config.gnu.mingw.so.release.104877975.;cdt.managedbuild.tool.gnu.cpp.compiler.mingw.so.release.1894695160;cdt.managedbuild.tool.gnu.cpp.compiler.input.1850812259">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.mingw.so.release.104877975;cdt.managedbuild.config.gnu.mingw.so.release.104877975.;cdt.managedbuild.tool.gnu.c.compiler.mingw.so.release.1503453796;cdt.managedbuild.tool.gnu.c.compiler.input.1631442765">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.mingw.so.debug.1593016443;cdt.managedbuild.config.gnu.mingw.so.debug.1593016443.;cdt.managedbuild.tool.gnu.c.compiler.mingw.so.debug.1235079492;cdt.managedbuild.tool.gnu.c.compiler.input.1100200210">
<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.mingw.so.debug.1593016443;cdt.managedbuild.config.gnu.mingw.so.debug.1593016443.;cdt.managedbuild.tool.gnu.c.compiler.base.819000094;cdt.managedbuild.tool.gnu.c.compiler.input.1640805667">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.mingw.so.debug.1593016443;cdt.managedbuild.config.gnu.mingw.so.debug.1593016443.;cdt.managedbuild.tool.gnu.cpp.compiler.mingw.so.debug.1293744797;cdt.managedbuild.tool.gnu.cpp.compiler.input.876443251">
<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.mingw.so.debug.1593016443;cdt.managedbuild.config.gnu.mingw.so.debug.1593016443.;cdt.managedbuild.tool.gnu.cpp.compiler.base.1626002149;cdt.managedbuild.tool.gnu.cpp.compiler.input.707260741">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.mingw.so.release.104877975;cdt.managedbuild.config.gnu.mingw.so.release.104877975.;cdt.managedbuild.tool.gnu.cpp.compiler.mingw.so.release.1894695160;cdt.managedbuild.tool.gnu.cpp.compiler.input.1850812259">
<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.mingw.so.debug.1593016443;cdt.managedbuild.config.gnu.mingw.so.debug.1593016443.;cdt.managedbuild.tool.gnu.cpp.compiler.mingw.so.debug.1293744797;cdt.managedbuild.tool.gnu.cpp.compiler.input.876443251">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/>
<storageModule moduleId="org.eclipse.cdt.make.core.buildtargets"/>
<storageModule moduleId="refreshScope" versionNumber="2">
<configuration configurationName="Debug">
<resource resourceType="PROJECT" workspacePath="/hackr-sweep"/>
</configuration>
<configuration configurationName="Release">
<resource resourceType="PROJECT" workspacePath="/hackr-sweep"/>
</configuration>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/>
</cproject>
3 changes: 2 additions & 1 deletion src/hackrf-sweep/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@
/build
/obj
/res
**.jrf
/lib/hackrf-sweep-jna.jar
**.jrf
Loading

0 comments on commit 257e737

Please sign in to comment.