GQRX Tips

21 Dec

Pulse Audio
Prior to installation of gqrx make sure pulseaudio is available during build by installing the following:
pavucontrol
pavumeter
pulseaudio-libs-devel

Install gqrx
git clone https://github.com/csete/gqrx.git
cd gqrx
mkdir build
cd build
qmake-qt5 ..
make -j8
sudo make install

Typical device strings
For the b200:
uhd,type=b200,nchan=1

For the X310 with LFRX in slot 2:
uhd,addr=192.168.1.13,subdev=B:A,nchan=1

For the X310 with WBX in slot 1:
uhd,addr=192.168.1.13,nchan=1

For the N210 with LFRX:
uhd,addr=192.168.1.11,subdev=A:A,nchan=1

When switching between devices in gqrx the gain control changes will segfault the application.  Fix this by deleting the “gains” section in:
~/.config/gqrx/default.conf

Sending gqrx audio to fldigi
Install fldigi with yum

Configure fldigi sound card to use pulseaudio, leaving server string empty

Launch pulseaudio volume control, and under recording tab, fldigi capture from monitor of built-in audio analog stereo, and set level to 0 dB.

Adjust fldigi waterfall upper signal level and signal range.

Sending gqrx audio to UDP

Streaming audio over UDP

Configure the network settings in the Network tab of the audio settings window:
UDP host: localhost
UDP port: 7355

Verify the data is coming through at the opposite end using netcat:
nc -l -u 7355
nc -l -u localhost 7355
nc -l -u 127.0.0.1 7355

Pipe the output of netcat to other applications.
The following example will send the audio to the ALSA player application:
nc -l -u 7355 | aplay -r 48k -f S16_LE -t raw -c 1

The following command line will re-sample the raw audio to 22.05 kHz and send it to multimon-ng and decode POCSAG data (thanks to André Schmelzer for this):
nc -l -u 7355 | \
sox -t raw -esigned-integer -b16 -r 48000 - -esigned-integer -b16 -r 22050 -t raw - | \
multimon-ng -t raw -a SCOPE -a POCSAG512 -a POCSAG1200 -a POCSAG2400 -f alpha -

Advertisement

Setting up NI GPIB-USB-HS under Linux

26 Jul

Mostly stolen from: http://www.cl.cam.ac.uk/~osc22/tutorials/gpib_usb_linux.html

Note unlike the ni_usb_b, this is the ni_usb_hs so no firmware has to be loaded at boot, thus gpib_config can be called directly.

Get latest source code
http://linux-gpib.sourceforge.net/

Typical build in /usr/local/src with
./configure
make
sudo make install

Edit configuration
sudo vi /etc/gpib.conf

board_type = "ni_usb_b"
name = "gpib0"

Add udev rules
sudo vi /etc/udev/rules.d/99-linux_gpib_ni_usb.rules

SUBSYSTEM=="usb", ACTION=="add", ENV{DEVTYPE}=="usb_device", ATTR{idVendor}=="3923", ATTR{idProduct}=="709b", MODE="660", GROUP="username", SYMLINK+="usb_gpib"
SUBSYSTEM=="usb", ACTION=="add", ENV{DEVTYPE}=="usb_device", ATTR{idVendor}=="3923", ATTR{idProduct}=="709b", RUN+="/usr/local/sbin/gpib_config"
KERNEL=="gpib[0-9]*", ACTION=="add", MODE="660", GROUP="username"

sudo udevadm control –reload-rules

Note udev will not run the gpib_config at boot, so add it in rc.local
sudo vi /etc/rc.d/rc.local

#!/bin/sh
/usr/local/sbin/gpib_config
exit 0

sudo chmod +x /etc/rc.d/rc.local
sudo systemctl enable rc-local.service
systemctl status rc-local.service

Tests
Now plug in the adapter and run ibtest
Reboot and run ibtest

Linux Multimedia

19 Jul

Logitech C615 HD Webcam
sudo vi /etc/udev/rules.d/99-webcam.rules

SUBSYSTEMS=="usb", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="082c", MODE:="0666"

sudo udevadm control --reload-rules

Dell XPS 13 Webcam
sudo vi /etc/udev/rules.d/99-webcam.rules

SUBSYSTEMS=="usb", ATTRS{idVendor}=="0bda", ATTRS{idProduct}=="5752", MODE:="0666"

sudo udevadm control --reload-rules

RPM Fusion Repository
sudo yum localinstall --nogpgcheck http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm

GUVCView Webcam Recording
sudo yum install libwebcam guvcview

Change resolution to 1280×720 on XPS-13

Set sound device to hw:2,0 for Logitech webcam

Screen Recording
sudo yum install gtk-recordmydesktop

Set sound device to DEFAULT for Logitech webcam

May also need to use hw:0,0 (use arecord -l to list input devices)

Video Editing
sudo yum install openshot

Video Playback
sudo yum install vlc

Setting up the Ettus USRP B200

10 Jun

Add udev Rules
sudo vi /etc/udev/rules.d/99-usrp-b200.rules
SUBSYSTEMS=="usb", ATTRS{idVendor}=="2500", ATTRS{idProduct}=="0020", MODE:="0666"
sudo udevadm control --reload-rules

Realtime Priority
sudo vi /etc/security/limits.conf
# Add for USRP realtime priority
myusername – rtprio 99

Will require re-login

Update Firmware
sudo /usr/local/lib64/uhd/utils/uhd_images_downloader.py

Probe
uhd_find_devices --args="type=b200"

Benchmark
cd /usr/local/lib64/uhd/examples
./benchmark_rate --rx_rate 60E6 --args "type=b200, master_clock_rate=60E6"

Baudline Tips

20 Apr

Install extra Fedora fonts
sudo yum install xorg-x11-fonts-misc
sudo yum install xorg-x11-fonts-ISO8859-1-75dpi

Reading data file from GNU Radio
GNU Radio file sink with input type complex writes IEEE 754 single-precision floats:
f = scipy.fromfile(open("filename"), dtype=scipy.complex64)

Baudline file raw parameters
Decompression: OFF
Initial byte offset: 0
Sample Rate: custom
Channels: 2
Quadrature: ON
Flip Complex: ON
Decode Format: 32 bit float, little endian
Normalization: 1 maximum sample value

GNURadio Tricks

20 Apr

Dynamic recording of files
Create a QT GUI Check Box with ID “Record” and set type to Boolean, and Default Value to False.

Create a variable with ID “file_name” and set Value to:
'data.bin' if Record==True else '/dev/null'

Create a File Sink with file “file_name”

USRP N210 and HDSDR Setup

10 Feb

Notes on setup of HDSDR software with the USRP N210 via the ExtIO interface

Instructions here

Click to access application_note_usrp_and_hdsdr_spectrum_monitoring.pdf

Configuration as of 7/23/2013
Window 7 64-bit
Ettus USRP N210 Rev 4
UHD 003.005.003 for Windows
UHD 003.005.000 for USRP
HDSDR 2.63
ExtIO USRP 1.5.1

Install UHD driver for Windows
Install uhd_003.005.003-release_Win64.exe from:
http://code.ettus.com/redmine/ettus/projects/uhd/wiki/UHD_Windows
This will place utility file in C:\Program Files (x86)\UHD\share\uhd\utils\

Install ExtIO compatible UHD for USRP
As of 7/23/2013 must use UHD 003.005.000 from:
http://files.ettus.com/binaries/master_images

Unzip and copy usrp_n210_fw.bin and usrp_n210_r4_fpga.bin to C:\Program Files (x86)\UHD\share\uhd\utils\

Open up a shell and cd to C:\Program Files (x86)\UHD\share\uhd\utils\

Run the following:
usrp_n2xx_simple_net_burner --addr 192.168.1.13 --fw usrp_n210_fw.bin --fpga usrp_n210_r4_fpga.bin

Install HDSDR
http://www.hdsdr.de/download/HDSDR_install.exe

Install ExtIO
http://spench.net/drupal/files/ExtIO_USRP+FCD+BorIP_Setup.zip

Update USRP firmware before returning to GNU Radio
Running usrp_n2xx_simple_net_burner.exe will download and update USRP with the the latest firmware

Windows shortcut
Install USRP ExtIO Firmware
"C:\Program Files (x86)\UHD\share\uhd\utils\usrp_n2xx_simple_net_burner.exe" --addr "192.168.1.13" --fw "usrp_n210_fw.bin" --fpga "usrp_n210_r4_fpga.bin"

Windows shortcut
Restore USRP Latest Firmware
"C:\Program Files (x86)\UHD\share\uhd\utils\usrp_n2xx_simple_net_burner.exe" --addr "192.168.1.13"

Setting up the Ettus USRP N210

8 Feb

https://files.ettus.com/manual/page_usrp2.html

Changing the IP Address
The USRP N210 comes with a default IP address of 192.168.10.2 which may be changed (e.g. 192.168.1.11):
./usrp_burn_mb_eeprom --args="addr=192.168.10.2" --values="ip-addr=192.168.1.11"

Increase Socket BUffers
sudo vi /etc/sysctl.conf
# Increase buffers for USRP
net.core.wmem_max=50000000
net.core.rmem_max=50000000
net.core.wmem_default=50000000
net.core.rmem_default=50000000

Realtime Priority
sudo vi /etc/security/limits.conf
# Add for USRP realtime priority
myusername - rtprio 99

Will require re-login

Updating N210 Firmware and FPGA
sudo /usr/local/lib64/uhd/utils/uhd_images_downloader.py
cd /usr/local/lib64/uhd/utils
uhd_image_loader --args="type=usrp2,addr=192.168.1.11"

Cycle power on the USRP

Probe
uhd_usrp_probe --args "addr=192.168.1.11"

Benchmark
cd /usr/local/lib64/uhd/examples
./benchmark_rate --rx_rate 25E6 --tx_rate 25E6 --args "addr=192.168.1.11"

GNU Radio and Ettus UHD Build Notes

8 Feb

Fedora 36 x86_64 with Python 3.10
Instructions at http://gnuradio.org/redmine/projects/gnuradio/wiki/BuildGuide

Dependencies
Dependencies listed at http://gnuradio.org/doc/doxygen/build_guide.html

Add to .profile
export PYTHONPATH=/usr/local/lib64/python3.10/site-packages:/usr/local/lib/python3.10/dist-packages
export PKG_CONFIG_PATH=/usr/local/lib64/pkgconfig

Dependencies for UHD 3.14
sudo dnf install
git
cmake
gcc-c++
boost-devel
ncurses-devel
dpdk-devel
libusb-devel
python-devel
doxygen

Build UHD
cd /usr/local/src/
git clone https://github.com/EttusResearch/uhd.git
cd uhd/host/
mkdir build
cd build
cmake ../
make
make test
sudo make install

Files will be installed in:
/usr/local/bin
/usr/local/include/uhd
/usr/local/lib64

pygccxml
sudo dnf install castxml
pip install pygccxml

Additional dependencies for GNU Radio 3.9
pybind11-devel
volk-devel
gmp-devel
mathjax
spdlog-devel
thrift-devel
python3-thrift
libunwind-devel
libsndfile-devel
fftw-devel
zeromq-devel
python3-zmq
cppzmq-devel
SDL-devel
gsl-devel
codec2-devel
gsm-devel
python3-click-plugins
portaudio-devel
qwt-qt5-devel
python3-qt5-devel
python3-pyqtgraph
python3-scipy
libiio-devel
python3-pytest
SoapySDR-devel
python3-jsonschem

Build GNU Radio
cd /usr/local/src
git clone https://github.com/gnuradio/gnuradio.git
cd gnuradio
mkdir build
cd build
cmake ../
make
make test
sudo make install

Update and rebuild
cd build
sudo make uninstall
cd ..
rm -rf build
git pull --recurse-submodules=on
git submodule update
mkdir build
cd build
make
make test
sudo make install

Fedora 35 x86_64 Linux Install Notes

7 Feb

Hardware Configuration
TBD

Hostname
sudo hostnamectl set-hostname tesla

Change to multi-user.target (e.g. runlevel 3)
sudo rm /etc/systemd/system/default.target
sudo ln -s /lib/systemd/system/multi-user.target /etc/systemd/system/default.target

Change GRUB
sudo vi /etc/default/grub and remove rhgb quiet
sudo grub2-mkconfig -o /boot/grub2/grub.cfg

Set XFCE
sudo dnf -y group install "Xfce Desktop"
touch ~/.xinitrc
echo "exec /usr/bin/xfce4-session" >> ~/.xinitrc
startx

Network Config
IPV4: manual
Address: 192.168.1.2
Netmask: 255.255.255.0
Gateway: 192.168.1.1
Nameserver: 192.168.1.1
IPV6: ignore

Update the System
sudo dnf update

<strong>Enable root Account
sudo passwd
</strong

Install Custom Shell Scripts
cp .bash_profile ~
cp .bashrc ~
cp .profile ~
cp .vimrc ~
sudo cp .bashrc /root

Directory Permissions
sudo chmod 777 /usr/local/src

Add Library Path to Linker
sudo vi /etc/ld.so.conf.d/usrlocal.conf
add /usr/local/lib
add /usr/local/lib64
sudo ldconfig

Firewall
sudo /usr/bin/firewall-config
Change default zone to internal
Trust services as required

Printer
sudo dnf install system-config-printer
sudo system-config-printer

Search for network printer at 192.168.1.4
Use DirectJet port
Choose driver for Brother HL-5170DN
Use BR-Script3

Sound
sudo usermod -a -G audio username

nm-applet
The nm-applet gives insufficent permission errors when changing WiFi due to startxfce4 instead of using a display manager. This will fix it:

sudo vi /etc/polkit-1/rules.d/50-org.freedesktop.NetworkManager.rules
polkit.addRule(function(action, subject) {
if (action.id.indexOf("org.freedesktop.NetworkManager.") == 0 && subject.isInGroup("myusername")) {
return polkit.Result.YES;
}
});

(must reboot to take effect)