Ham Radio Raspberry Pi AA6E Tiny Python Panadapter

The Experiment: In this experiment were going build, the AA6E Tiny Python Panadapter. To get things started, will use the M0JMO Tiny Python Panadapter for Raspberry Pi – Setup Guide.  From experience most of the project found on the internet won’t  work, unless the OS / Software / Hardware are identical to the OS / Software / Hardware used in the Setup Guide. So will expect to spend some time getting this to work. Will use Raspbian Wheezy (Instead of NOOBS) and a  5inch HDMI/LCD/Touch Display with a hopefully a cheap USB Sound Card.

Table of Contents

1. Project Progress
2. Part List
3. Software
4. Prototype
5. Notes
6. Conclusion
7. Reference Links


Project Progress

Nov 1, 2015: Started working on this experiment on Oct 30, 2015, had a lot of problems getting the Display / USB sound card to work, but after 20 hours finally have it working. See Prototype / Notes for details. The USB Sound Card in photo won’t work.

ham-radio=raspberry-pi-aa6e-tiny-python-panadapter-0
^Top

Nov 2, 2015: Learned something today, cannot use the USB sound card in the photo, because RX/IQ require’s  2(two) Mic inputs or a Line-in input. Cheap PC USB sound cards only have 1(one) mono Mic input so they can’t be used. So ordered a Behringer UCA202 which has 2(two) Mic inputs and should work (not a the cheap option), also orders a Vinyl Cassette To CD/MP3 Converter – USB Digital Audio MP3 WMA WAVE Recorder,  it has 2(two) stereo Mic input, but don’t know if it will work with Raspberry Pi, if it does work this might be a cheap USB sound card option for the Raspberry Pi Tiny Python Panadapter.

The Behringer UCA202 skip (Step 18-19) from the installation instructions. Will see what need to be done for the Vinyl Cassette To CD/MP3 Converter – USB Digital Audio MP3 WMA WAVE Recorder.

Nov 11, 2015: The Behringer UCA202 and the Vinyl Cassette To CD/MP3 Converter – USB Digital Audio MP3 WMA WAVE Recorder arrived today. First thing plugged in the Vinyl Cassette To CD/MP3 Converter – USB Digital Audio MP3 WMA WAVE Recorder into the Raspberry Pi  USB port, then launched pa.py to see if Raspbian Wheezy found the USB sound card.  Well it did and it showed maxInputChannels : 2(two) / maxOutputChannels : 0(zero) / defaultSampleRate : 48000.0. So Updated Step 18 – 19 channels to 2 and updated r.sh rate=48000. Launched r.sh and turned On RX I/Q in the KX3 and wow it’s working, a little slow, but did not over clock the Rasberry Pi.

ham-radioraspberry-pi-aa6e-tiny-python-panadapter-1

So there is a cheap USB sound card for less then $10.00 which will work with the Tiny Python Panadapter. Not even going to try the Behringer UCA202 USB sound card I that should work.

Vinyl Cassette To CD/MP3 Converter – USB Digital Audio MP3 WMA WAVE Recorder.
Vinyl-Cassette-To-CD-MP3-Converter-USB-Digital-Audio-MP3-WMA-WAVE-Recorder

Will pickup a USB to TTL adapter and try the Hamlib functions.


Part List:

1. Raspberry Pi B+
2. 5inch 800*480 Resistive Touch Screen HDMI interface for Raspberry Pi
3. Vinyl Cassette To CD/MP3 Converter – USB Digital Audio MP3 WMA WAVE Recorder
4. 2.5mm Female stereo phone to 3.5mm Male stereo phone adapter
^Top


Software:

1. Raspbian Wheezy
2. TIq.tar.gz
3. pyaudio-0.2.7.tar.gz
4. Putty
5. WinSCP

^Top


Prototype:

Step 1.
1. Download the Raspbian Debian Wheezy here
2. Installing Operating System Images here Linux Mac OS Windows

At Boot-up: sudo raspi-config
1. 1. Expand Filesystem <Select> <Enter>
2. 8. Advanced Options <Select> <Enter> A4 SSH <Select> <Enter>
3. <Back> <Enter>
4. <Finish> <Enter>
5. Login: pi <Enter>
6. Password: raspberry <Enter>

At Command Prompt:
pi@raspberry – $
Step 1. sudo apt-get update
Step 2. sudo apt-get upgrade
Step 3. sudo apt-get clean
Step 4. sudo apt-get install ntp
Step 5. sudo apt-get autoremove
Step 6. Make sure to past all in one line.
sudo apt-get install python-pygame python-libhamlib2 python-dev portaudio19-dev python-numpy
Step 7. Copy pyaudio-0.2.7.tar.gz to /home/pi  (used WinSCP to copy files to RPi)
Step 8. Copy Iq.tar.gz to /home/pi directory (used WinSCP to copy files to RPi)
Step 9. tar xzf pyaudio-0.2.7.tar.gz
Step 10. Cd pyaudio
Step 11. sudo python setup.py install
Step 12. Type: python at >>> Type: import pyaudio (If No ERROR pyaudio is working)
Step 13. Cd /
Step 14. tar xzf Iq.tar.gz
Step 15. cd iq
Step 16. sudo nano iq.py edit line 262 SCREEN_SIZE = (800, 480)
Step 17. To Save: Ctrl x – y – <Enter>
Step 18-19 not needed, but left hear for refrence. goto step 20
Step 18. sudo nano iq_af.py edit line 79 input_channels=1 and line 88 channles=1
Step 19. To Save: Ctrl x – y – <Enter>
Step 20. sudo nano r.sh
Step 21. Past in code below make sure it’s all in one line.

nice -20 python iq.py --size=310 --n_buffers=16 --take=6 --index=2 --rate=48000 --WATERFALL --waterfall_acc=1 --FULLSCREEN

Step 22. To Save: Ctrl-x – y – <Enter>

Step 23. sudo nano /boot/cmdline.txt
Step 24. Past: add dwc_otg.speed=1 in front of:

dwc_otg.lpm_enable=0 console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait

Like this.

dwc_otg.speed=1 dwc_otg.lpm_enable=0 console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait

Again make sure it’s all in one line.

Step 25. sudo nano /boot/config.txt (past the following under)

# uncomment to force a specific HDMI mode (this will force VGA)
#hdmi_group=1
#hdmi_mode=1

#copy/past below
hdmi_group=2
hdmi_mode=1
hdmi_mode=87
hdmi_cvt 800 480 60 6 0 0 0

Step 26. Type: startx (This will launch the GUI desktop) it’s best to do all the testing in LXTerminal. If you do the testing at command prompt you won’t see the ERROR messages. If all working in LXTerminal then you can launch Tiny Pyhton Panadapter from command prompt /home/pi/iq/bask r.sh it will display in a full screen see photo.

^Top


Notes:

Use pa.py in /home/pi/iq directory to get the information for the sound card.
Snip-it of the USB sound card info displayed with pa.py.

DEVICE: 2; NAME: 'C-Media USB Headphone Set: USB Audio (hw:2,0)'
defaultSampleRate : 44100.0
maxInputChannels : 1
maxOutputChannels : 2

In Step 18. input_channels=maxInputChannels and channles=maxInputChannels. Tried to use maxOutputChannels for channles but got an ERROR

In Step 23. index=DEVICE # and rate=defaultSampleRate

In Step 18. SCREEN_SIZE(800, 480) the size of you HDMI screen.

5inch LCD Pine-out

PIN NO. SYMBOL DESCRIPTION
1, 17 3.3V Power positive (3.3V power input)
2, 4 5V Power positive (5V power input)
3, 5, 7, 8, 10, 11, 12, 13, 15, 16, 18, 24 NC NC
6, 9, 14, 20, 25 GND Ground
19 TP_SI SPI data input of Touch Panel
21 TP_SO SPI data output of Touch Panel
22 TP_IRQ Touch Panel interrupt, low level while the Touch Panel detects touching
23 TP_SCK SPI clock of Touch Panel
26 TP_CS Touch Panel chip selection, low active

^Top


Conclusion:

It was nice to to find cheap USB sound card for the AA6E Tiny Python Panadapter experiment.  Without the enclosure the total cost less then $100.00, because of all the unknowns still spent less then $150.00. What’s nice about the Vinyl Cassette To CD/MP3 Converter – USB Digital Audio MP3 WMA WAVE Recorder, is that it can plug right into the KX3 with a 2.5mm to 3.5 mm stereo phone adapter.
^Top


Reference Links:

1. Tiny Python Panadapter
2. Tiny Python Panadapter Download
3. Index of /hubert/pyaudio/packages
4. Raspberry Pi 5” HDMI LCD Display w/touch
5. A Tiny Python Panadapter ARRL
6. How to set up a Tiny Python Panadapter for Raspberry Pi

^Top

Advertisements