diff options
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | README.md | 42 | ||||
-rw-r--r-- | airspyhf/libairspyhf.py | 2 | ||||
-rw-r--r-- | airspyhf_rx.py | 10 | ||||
-rw-r--r-- | test.py | 5 |
5 files changed, 48 insertions, 12 deletions
@@ -1,2 +1,3 @@ .idea airspyhf/__pycache__/ +*.wav
\ No newline at end of file @@ -5,12 +5,45 @@ Python wrapper of airspyhf library https://github.com/airspy/airspyhf.git Project webpage main.lv +main project page http://main.lv +cgit source viewer http://git.main.lv/cgit.cgi/pyairspyhf.git -http://git.main.lv/cgit.cgi/pyairspyhf.git # Source code +``` git clone https://git.main.lv/cgit/pyairspyhf.git +``` + +# Install airspyhf + +Install all dependencies such as: +``` + cmake, libusb +``` + +Checked supported and tested version list + +To build the libairspyhf follow: https://github.com/airspy/airspyhf + +Workes localy +``` +git clone https://github.com/airspy/airspyhf.git +cd airspyhf +cmake . +make +sudo make install +``` + +If there is issues with libusb header try to find libusb header locations +``` +cmake -DLIBUSB_INCLUDE_DIR=/usr/include/libusb-1.0/ -DINSTALL_UDEV_RULES=ON +``` + +```commandline +udevadm control --reload-rules +``` + # API ## libairspyhf @@ -21,6 +54,13 @@ git clone https://git.main.lv/cgit/pyairspyhf.git ## airspyhf_rx.py +## Supported and tested + +| --- | --- | --- | --- | +| Python | libairspyhf | OS | Status | +| --- |--- | --- | --- | +| 3.9, 3.10 | 1.7.1 | ArchLinux, Ubuntu 20.04 | Supported and tested | + ## Install diff --git a/airspyhf/libairspyhf.py b/airspyhf/libairspyhf.py index dada9f5..a287626 100644 --- a/airspyhf/libairspyhf.py +++ b/airspyhf/libairspyhf.py @@ -23,7 +23,7 @@ def load_libairspyhf(): driver = driver() if driver is None: continue - print(driver) + #print("Search for driver named %s"%(driver)) try: dll = CDLL(driver) break diff --git a/airspyhf_rx.py b/airspyhf_rx.py index da0e32e..8ba5557 100644 --- a/airspyhf_rx.py +++ b/airspyhf_rx.py @@ -1,3 +1,4 @@ +#!/usr/bin/python3 import os from airspyhf import * from ctypes import * @@ -38,7 +39,8 @@ if args.serial != None: else: serial = c_uint64(0) libairspyhf.airspyhf_list_devices(byref(serial), 1) - ret = libairspyhf.airspyhf_open_sn(dev_p, f"{hex(serial.value)}") + print(hex(serial.value)) + ret = libairspyhf.airspyhf_open_sn(dev_p, int(hex(serial.value),16)) print("open_sn: Returned %d"%(ret)) if (ret != 0): print("airspyhf_open_sn returned != 0, error") @@ -116,17 +118,13 @@ except: ret = libairspyhf.airspyhf_stop(dev_p) print(f"airspyhf_stop ret={ret}") - +time.sleep(1) #Not close for now ret = libairspyhf.close(dev_p) print("closed: Returned %d"%(ret)) print(f"Total samples received {sample_count}") -libairspyhf.py_test() - -libairspyhf.py_test_cb(read_samples_cb) - wave_file.close() print("All is ok") @@ -1,3 +1,4 @@ +#!/usr/bin/python3 import os from airspyhf import * from ctypes import * @@ -110,10 +111,6 @@ print("closed: Returned %d"%(ret)) print(f"Total samples received {sample_count}") -libairspyhf.py_test() - -libairspyhf.py_test_cb(read_samples_cb) - wave_file.close() print("All is ok") |