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

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.13):
sudo /usr/local/lib64/uhd/utils/usrp2_recovery.py --ifc=em1 --new-ip=192.168.1.13

Increase Socket BUffers
sudo vi /etc/sysctl.conf

# Increase buffers for USRP
net.core.rmem_max=162149863
net.core.wmem_max=162149863

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

./usrp_n2xx_net_burner.py --addr=192.168.1.13 --fw=/usr/local/share/uhd/images/usrp_n210_fw.bin

./usrp_n2xx_net_burner.py --addr=192.168.1.13 --fpga=/usr/local/share/uhd/images/usrp_n210_r4_fpga.bin

Cycle power on the USRP

Probe
uhd_usrp_probe --args "addr=192.168.1.13"

Benchmark
cd /usr/local/lib64/uhd/examples

./benchmark_rate --rx_rate 25E6 --tx_rate 25E6 --args "addr=192.168.1.13"

GNU Radio and Ettus UHD Build Notes

8 Feb

Fedora 29 x86_64 with Python 3.7
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.7/site-packages:/usr/local/lib/python3.7/dist-packages
export PKG_CONFIG_PATH=/usr/local/lib64/pkgconfig

Dependencies for UHD 3.14
sudo dnf install
git
cmake
boost-devel
boost-python3-devel
ncurses-devel
libudev-devel
libusbx-devel
python3-devel
python3-mako

Build UHD
cd /usr/local/src/
git clone https://github.com/EttusResearch/uhd.git
cd uhd/host/
mkdir build
cd build
cmake -DENABLE_PYTHON3=ON -DPYTHON_EXECUTABLE:FILEPATH=/usr/bin/python3 -DRUNTIME_PYTHON_EXECUTABLE=/usr/bin/python3 ../
make
make test
sudo make install

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

Additional dependencies for GNU Radio 3.8

swig
python3-sphinx
fftw-devel
gsl-devel
gmp-devel
mpir-devel
qwt-qt5-devel
python3-qt5-devel
portaudio-devel
orc-devel
zeromq-devel
cppzmq-devel
python3-zmq
texlive-dvips
xmlto
log4cpp-devel
SDL-devel
python3-click-plugins

Reboot the machine as there is something screwed up with the linker finding log4cpp on Fedora 29

Build GNU Radio
cd /usr/local/src
git clone --recursive https://github.com/gnuradio/gnuradio.git
cd gnuradio
mkdir build
cd build
cmake -DENABLE_PYTHON3=ON -DPYTHON_EXECUTABLE:FILEPATH=/usr/bin/python3 -DRUNTIME_PYTHON_EXECUTABLE=/usr/bin/python3 ../
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
cmake -DENABLE_PYTHON3=ON -DPYTHON_EXECUTABLE:FILEPATH=/usr/bin/python3 -DRUNTIME_PYTHON_EXECUTABLE=/usr/bin/python3 ../
make
make test
sudo make install

Fedora 29 x86_64 Linux Install Notes

7 Feb

Hardware Configuration
2 TB HDD on Intel 6G SATA port 0, /dev/sda, (NTFS)
240 GB SSD on Intel 6G SATA port 1, /dev/sdb, (Linux)
2 TB HDD on Intel 3G SATA port 2, /dev/sdc, (NTFS)
DVD on Intel 3G SATA port 4
240 GB SSD on Marvel 6G SATA port 0, /dev/sdd, (Windows 7)
Asus P8Z68 Deluxe/Gen3 Bios
Marvel controller enabled
Boot order (DVD port 4, USB, HDD port 0)
EasyBCD installed on Windows boot partition.
Boot selection for Linux (/dev/sdb1) or Windows (/dev/sdd1)

Fedora Boot CD
Tab at install to modify boot commands.
Remove quiet.

Network Config
IPV4: manual
Address: 192.168.1.2
Netmask: 255.255.255.0
Gateway: 192.168.1.1
Nameserver: 64.126.4.190
IPV6: ignore
Hostname: tesla.lounix.net

Date/Time
Location: Chicago

Software Selection
XFCE Desktop (development tools, extra plugins)

Destination
Choose 2 TB HDD (the last one in the list)
Automatic partitioning

After Reboot
Create user and add to admin group
Synchronize time over network

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

Fix startx
echo "exec /usr/bin/xfce4-session" >> ~/.xinitrc
startx

Change to python 3.x
python -V
sudo alternatives --install /usr/bin/python python /usr/bin/python3.4 2
sudo alternatives --install /usr/bin/python python /usr/bin/python2.7 1
python -V

Reboot
reboot
login
startx

Update the System
sudo dnf update

Enable root Account
sudo passwd

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
(must reboot to take effect)

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)

Apple II Floppy Drive Cable Retention Clamps

8 Jul

The Apple //e I recently acquired was missing the floppy drive cable retention clamps. As you can see from the manual pages, they retain the cable against accidental pulling, which could possibly break the floppy controller.

20120708-194602.jpg

20120708-194622.jpg

However they also reduce electromagnetic emissions (EMI). The ribbon cable has a copper braid, which I assume runs the length of the cable. It does not terminate on the floppy drive so it would serve no purpose other than EMI shielding, and to reduce coupling between adjacent wires. Nonetheless, the braid ought to be electrically bonded to the chassis, hence the need for the retention clamps.

20120708-172739.jpg

I made the clamps out of 1/2″ x 3/32″ brass flat stock available at most hardware stores. It comes in a 12″ length for about $6. Take a sharpie and ruler, and mark off 2″ increments. Draw a centerline down the stock, then mark off 1/4″ from the each 2″ increment; this is where the holes will be drilled. Center punch the holes marks.

Drill 3/32″ holes for the back-plates and 1/8″ holes for the front plates. Tap the 3/32″ holes to 4-40 NC. Saw across the 2″ marks and file the edges smooth. Mark off a notch 1.2″ x 0.1″ on one long edge of each piece, then file the notch.

20120708-183102.jpg

The drive cable lug will sandwich between the two pieces, which in turn will be held to the chassis with 4-40 x 1/2″ machine screws.

20120708-183335.jpg

20120708-194252.jpg

20120708-194305.jpg

20120708-194322.jpg

20120708-194332.jpg

Apple IIe Unboxing

4 Jul

Found this Apple IIe, specifically a //e, on EBay. I normally would not purchase a system on eBay, however, this was a local seller so there was no shipping involved; cash and carry. The buy-it-now was $350 so I put in an offer for $150, which was accepted.

The system is in immaculate condition with the exception of the yellowing. No scratches or even dust. It was purchased from the original owner , a lady who bought I new, and from the looks of it, put it into storage after a few weeks. The peripherals came with the original boxes.

I ordered a Super Serial card on eBay for $10 which will allow me to bootstrap the machine to write disks from a modern PC. I’ll definitely be attending the vendor fair at KansasFest 2012 in hopes of finding a compact flash drive and a ROM upgrade.

20120704-162817.jpg

20120704-162834.jpg

20120704-163045.jpg

20120704-163058.jpg

20120704-163107.jpg

20120704-163132.jpg

20120704-163143.jpg

20120704-163156.jpg

20120704-163204.jpg

20120704-163212.jpg

20120704-163220.jpg

20120704-163235.jpg

Commodore 64 Setup

1 Jul

Ah, the treasures that await on Craigslist! Recently picked up a Commodore 64. Not sure if it was an impulse buy, since my wife was out of town and couldn’t veto it, or maybe trying to regain lost youth. I had one back in the day, however, I sold it to my high school electronics teacher. The only remaining item from my youth was a cartridge of Star Trek Strategic Operations Simulator, a port of awesome vector graphics arcade game. Anyway, I have been adding to the collection over the past few weeks, all vintage items found on KC Craigslist with the exception of the 1541 drive and Supergraphics printer adapter.

Commodore 64 console

Computermate keyboard cover

Commodore 1701 monitor with component video cable

Commodore 1541 floppy drive

Commodore 1530 Datasette

Panasonic KX-P1123 dot matrix printer

Xetec Supergraphics printer interface / buffer

TrippLite Command Console

Wico Command Control joysticks (qty 2)

Wico trackball

Comet 64 modem

EasyFlash 3

uIEC/SD flash drive

Zoom Floppy controller

Flyer Internet Modem

20120701-181136.jpg

20120701-181246.jpg