Saturday, August 15, 2020

Using the LG AN-WF100 USB Wi-Fi adapter for PC

 


The LG AN-WF100 USB Wi-Fi dongle left, after trashing the TV.

 This dongle uses a generic Broadcom chipset. To use the dongle at Windows 7 PC

1. Download a compatible driver from http://www.downloads.netgear.com/files/GDC/WNDA3100V2/WNDA3100v2_V2.2.0.5.zip

2. Install the driver normally. Close application

3. Remove/Disable WNDA3100v2.exe from the strat-up entry

4. Now plug-in the LG dongle to your PC. It will be detected as an unknown “Remote Download Wireless Adapter” device.

5. Open Device Manager, right-click the unknown “Remote Download Wireless Adapter” device, select “Update Driver…”, choose to browse for the driver.

6. Select the “Network adapters” category, scroll down to “Netgear”, select “Netgear WNDA3100v2 N600 Wireless Dual Band USB Adapter”.

7. Just Ignore the warning about driver compatibility.

That's it.


Sunday, August 09, 2020

Raspberry Pi3B WSJT-X and WSPR install with RTL-SDR

 

O Prepared gears:

 - Raspberry Pi3B with >8GB SDHC

 - Old RTL-SDR dongle 


Setting up

1. Prepare RPi3B

 - Install the latest image from https://www.raspberrypi.org/downloads/raspberry-pi-os/

  sudo raspi-config

  In the localization settings change the timezone to UTC (localization options -> time zones -> none of the above -> UTC

2. Install RTL-SDR drivers

sudo apt-get update
sudo apt-get install libusb-1.0-0-dev git cmake -y
git clone https://github.com/keenerd/rtl-sdr
cd rtl-sdr/
mkdir build
cd build
cmake ../ -DINSTALL_UDEV_RULES=ON
make
sudo make install
sudo cp ../rtl-sdr.rules /etc/udev/rules.d/
sudo ldconfig

echo 'blacklist dvb_usb_rtl28xxu' | sudo tee --append /etc/modprobe.d/blacklist-dvb_usb_rtl28xxu.conf

Now reboot to apply the blacklist, and plug in your RTL-SDR.     

3. PulseAudio & MPlayer

Need PulseAudio to create virtual audio cables. Also install mplayer for playing the audio.

sudo apt-get install pulseaudio pavucontrol mplayer -y

4. CSDR

CSDR is a library of DSP functions that we'll use to set up a multi-channel receiver.

sudo apt-get install libfftw3-dev -y

cd ~
git clone https://github.com/simonyiszk/csdr
cd csdr

Before going any further, for the Pi 3 we recommend editing the Makefile and changing the PARAMS_NEON flags to the following. The Makefile can be opened with 

  "sudo leafpad Makefile"

-march=armv8-a
-mtune=cortex-a53
-mfpu=neon-fp-armv8.

Also under PARAMS_RASPI set:

-mcpu=cortex-a53
-mfpu=neon-fp-armv8.

We're not sure if it actually does anything, but the idea is that this should help optimize the code for the Pi 3 CPU. For any other SBC, you'll want to check what these settings should be for your architecture.

Close and save the file, then run:

make
sudo make install

5. ncat 

The ncat is a TCP server that we'll use to help us set up a multi-channel receiver.

sudo apt-get install nmap -y

6. Chrony

We'll use Chrony to adjust the time offset required by these QRP modes. The configuration will be discussed later.

sudo apt-get install chrony -y

7. WSJT-X

Go to the WSJT-X page in Chrome, download the .deb file for the Raspberry Pi, And Install it.


8. Audio Piping Setup

Need to create virtual audio sinks for each frequency that you want to simultaneously monitor. The example below will set up two virtual audio sinks that load on boot. 

To set up another, simply add more lines from Virtual 2 and and so on. First open the pulseaudio default.pa file:

sudo leafpad /etc/pulse/default.pa

Add the following lines to the end of the file:

load-module module-null-sink sink_name=Virtual0 sink_properties=device.description="Virtual0"
load-module module-null-sink sink_name=Virtual1 sink_properties=device.description="Virtual1"

Disabling PulseAudio logging is recommended, as this seems to be a large user of CPU cycles.

sudo leafpad /etc/pulse/daemon.conf

 Find "log-level" and change it to "log-level = error". 

; log-target = auto
log-level = error
; log-meta = no

 Now reload pulseaudio either by rebooting, or running "pulseaudio -k" at a command line.

9. RTL-SDR Setup

Set up an RTL-SDR TCP server with ncat. In this example, the center frequency is set to 14.1 MHz (14100000 Hz). 

Change this to whatever frequency band you want to monitor.   Just remember to offset the center frequency by a few hundred kHz from the actual signal frequency to help avoid the center DC spike.

======
pi@raspberrypi1:~ $ rtl_sdr -s 1200000 -f 14100000 -D 2 - | csdr convert_u8_f | ncat -4l 4952 -k --send-only --allow 127.0.0.1
Found 1 device(s):
  0:  Generic, RTL2832U, SN: 77771111153705700

Using device 0: Generic RTL2832U
Found Elonics E4000 tuner
Enabled direct sampling mode, input 2
Enabled direct sampling mode, input 2/Q.
Sampling at 1200000 S/s.
Tuned to 14100000 Hz.
Tuner gain set to automatic.
Reading samples in async mode...

======
 pi@raspberrypi1:~ $ ncat -v 127.0.0.1 4952 | csdr shift_addition_cc `python -c "print float(14100000-14074000)/1200000"` | csdr fir_decimate_cc 25 0.05 HAMMING | csdr bandpass_fir_fft_cc 0 0.5 0.05 | csdr realpart_cf | csdr agc_ff | csdr limit_ff | csdr convert_f_s16 | mplayer -nocache -rawaudio samplesize=2:channels=1:rate=48000 -demuxer rawaudio -
csdr bandpass_fir_fft_cc: window = HAMMING
csdr bandpass_fir_fft_cc: (fft_size = 256) = (taps_length = 79) + (input_size = 178) - 1
(overlap_length = 78) = taps_length - 1
fir_decimate_cc: taps_length = 79
csdr fir_decimate_cc: taps_length = 79
csdr fir_decimate_cc: padded_taps_length = 80
csdr fir_decimate_cc: taps = 7c8018
csdr fir_decimate_cc: NEON aligned taps = 7c8020
Ncat: Version 7.40 ( https://nmap.org/ncat )
csdr bandpass_fir_fft_cc: filter initialized, low_cut = 0, high_cut = 0.5
Ncat: Connected to 127.0.0.1:4952.
csdr shift_addition_cc: reinitialized to 0.0216667
MPlayer 1.3.0 (Debian), built with gcc-6.2.1 (C) 2000-2016 MPlayer Team
do_connect: could not connect to socket
connect: No such file or directory
Failed to open LIRC support. You will not be able to use your remote control.

Playing -.
Reading from stdin...
rawaudio file format detected.
Load subtitles in ./
==========================================================================
Opening audio decoder: [pcm] Uncompressed PCM audio decoder
AUDIO: 48000 Hz, 1 ch, s16le, 768.0 kbit/100.00% (ratio: 96000->96000)
Selected audio codec: [pcm] afm: pcm (Uncompressed PCM)
==========================================================================
AO: [pulse] 48000Hz 1ch s16le (2 bytes per sample)
Video: no video
Starting playback...
^C   8.7 (08.6) of 0.0 (unknown) 29.2% 


MPlayer interrupted by signal 2 in module: play_audio
A:   8.7 (08.7) of 0.0 (unknown) 29.0%   
=====