DSD and the Rapsberry Pi

This is a work in progress, and as such is more a journal of things that didn't work

I got DSD+ compiled without any issues, just following the instructions as George M1GEO did, however I did run into a couple of issues trying to decode anything and have been unsuccessful as of yet.

The first was an error “Fatal unable to get cpu freq from /proc/cpuinfo” when running ‘dsd -a’ to list the audio devices attached. I tracked this back to being a problem/bug/feature of the jack package, which is resolved in JACK2. Building and installing that following the instructions here:

http://theredbalcktree.wordpress.com/2014/08/10/fatal-cannot-locate -cpu-mhz-in-proccpuinfo/

There is a JACK2 package in the raspbian repositories which I also installed for good measure, but found that the portaudio19-dev package will complain about it, but if you’ve already got dsd built you can ignore portaudio19-dev (the actual library is in the libportaudio0 or libportaudio2 package).

As an aside, this should also have fixed wspr, fldigi and anything else that uses portaudio.

This is where I ran into my next hurdle, dsd tries to open the soundcard at 48K, which the cheap Chinese usb sound card I was using didn't support so the program ungracefully segfaults, spitting vast quantities of errors to the screen. I did bodge round this by creating an upsampling virtual device, which did at least run. But as you’d expect nothing would decode given the limited bandwidth.

George reports that using 96K worked better for him, and he has a trick for making it work which escapes me atm.

Undeterred by this, I next tried to use an rtl sdr as the receiver rather than the ft857 I had been using before. This however proved to be unsuccessful. However I will detail how I attempted it and you may find it of some use.
From the dsd wiki it outlines that you can pass it raw data via STDIN rather than using an audio device, and the format happens to be compatible with that written by rtl_fm to std out. I should therefore be able to do the following:

rtl_fm -F 145.150M -s 48K -M fm | dsd -i - -o pa:0
and this should decode any dstar on 145.150 MHz, however I was never successful at decoding either the two local repeaters VK3RWN and VK3RMM, or a local transmission. I believe the problem to be with the audio level output from rtl_fm. Playing it back it is significantly lower than the volume of the noise, however there are no options to adjust this. There is a tuner gain option for rtl_fm however none of the values I tried 1 to 10K had any effect.
I would suggest maybe if your going to go down the rtl sdr route to use something like gqrx to demodulate the fm and raise the level before presenting it to dsd. However I haven’t had a chance to do so.

Linux and Amateur Radio

A few weeks ago I gave a talk at the Geelong Radio and Electronics society (http://qrz.com/VK3ANR) about the history of the Linux operating system and some the applications relate to amateur radio. In this short article, I aim to follow up on that talk and address some of the feedback I've received from the members by presenting some of the applications mentioned and how they can be installed.

Most of the instructions here should work for those using a Raspberry Pi, although some packages may require additional repositories in this instance. I'm personally am writing this using Linux Mint as my distribution and inspiration, although most things will transfer directly to Ubuntu and it's many derivatives.

The slides from that presentation are available here

Continue reading Linux and Amateur Radio

Raspberry Pi B+ Review

Below is a review I wrote for the Geelong Radio and Electronics Society (VK3ANR) on the Raspberry Pi model B+ that was released earlier this year.

 

2 years ago, the Raspberry Pi foundation, launched the original Raspberry Pi Model B, a 700MHz ARM processor with 256MB of ram, USB, ethernet, HDMI and a whole host of other I/O and pins for good measure all in the area of a credit card. Since there have been three other Raspberry Pi’s released: the cut-down model A, aimed at schools; the model B - version 2 which brought out more of the GPIO that was previously inaccessible and doubled the amount of RAM to 512MB, and the compute module for embedding in devices.

Continue reading Raspberry Pi B+ Review

2.2" ILI9340C TFT and the Raspberry Pi

Introduction

This page describes how I went about connecting a small 2.2" TFT display to the Raspberry Pi. This page is mainly for reference about what chip is in the display and what modules are required to make it work.

X server running on the 2.2" TFT in portrait mode.
X server running on the 2.2" TFT in portrait mode.

The hardware

The display is I purchases is a 2.2" Colour TFT with a resolution of 320x240. It is controlled with the ILI9340C LCD driver chip via the SPI bus and runs on 3.3v.  They can be found on eBay for a ~$6 AUD.

Continue reading 2.2" ILI9340C TFT and the Raspberry Pi

Getting Started with the STM32F3 Discovery Board on Ubuntu 13.10

On a whim I went out and added a STM32F3-Discovery Development board to a rs-online order. The board contains an STM32F303 ARM-Coretex M4 processor capable of ~70MHz and has four  5 MSPS ADCs, 12 Fast DACs, hardware DSP and FPU; making it an ideal candidate for building a software defined radio. Although before I could get to that I had to setup the tools needed to actually program the thing. Having never programmed an ARM chip before (well not bare metal anyway). Here are the steps that I went through to get it working. Most of which are taken from articles published here: http://engineering-diy.blogspot.com.au/2012/11/stm32f3-discovery-eclipse-openocd.html . I'm just collating them all together for reference.

Continue reading Getting Started with the STM32F3 Discovery Board on Ubuntu 13.10

RTL-SDR on the Raspberry PI

Intro:

A while ago I decided to venture into the world of Ham Radio. Under the advice of   George I went out a purchased a cheap DVB USB dongle to use as a Software Defined Radio (SDR). I had thought about using it with the Raspberry Pi I bought a while ago.

How?

The software was pretty straight forward to setup, here are my instructions from a fresh install of the Raspbian distribution:

Continue reading RTL-SDR on the Raspberry PI

ADS-B

Introduction

Having bought an RTL-SDR compatible dongle recently I thought I could see what I could make it do. So one for the first things I did successfully was tracking planes using ADS-B.

ADS-B or Automatic Dependant Surveillance Broadcast (http://en.wikipedia.org/wiki/Automatic_dependent_surveillance-broadcast) is used to track Aircraft, each plane is fitted with a transmitter which broadcasts its position, heading, altitude, identification and a number of other things on 1090MHz.

Continue reading ADS-B

Raspberry PI - USB Hub error

When playing with the raspberry Pi I noticed a couple of oddities. If I have a mouse and keyboard plugged into a usb hub the ethernet goes very slowly and as soon as X is run pretty much becomes unusable, filling the kernel messages with:

[ 2354.487491] smsc95xx 1-1.1:1.0: eth0: Failed to read register index 0x00000114
[ 2354.487530] smsc95xx 1-1.1:1.0: eth0: MII is busy in smsc95xx_mdio_read
[ 2359.487451] smsc95xx 1-1.1:1.0: eth0: Failed to read register index 0x00000114
[ 2359.487499] smsc95xx 1-1.1:1.0: eth0: MII is busy in smsc95xx_mdio_read
[ 2365.587487] smsc95xx 1-1.1:1.0: eth0: Failed to read register index 0x00000114
[ 2370.587541] smsc95xx 1-1.1:1.0: eth0: Failed to write register index 0x00000114
[ 2378.717626] smsc95xx 1-1.1:1.0: eth0: Failed to read register index 0x00000118

and:

[ 601.380138] smsc95xx 1-1.1:1.0: eth0: kevent 4 may have been dropped
[ 601.388141] smsc95xx 1-1.1:1.0: eth0: kevent 4 may have been dropped
[ 601.396113] smsc95xx 1-1.1:1.0: eth0: kevent 4 may have been dropped
[ 601.404137] smsc95xx 1-1.1:1.0: eth0: kevent 4 may have been dropped
[ 601.412135] smsc95xx 1-1.1:1.0: eth0: kevent 4 may have been dropped
[ 601.420139] smsc95xx 1-1.1:1.0: eth0: kevent 4 may have been dropped
[ 601.428136] smsc95xx 1-1.1:1.0: eth0: kevent 4 may have been dropped
[ 601.436114] smsc95xx 1-1.1:1.0: eth0: kevent 4 may have been dropped
[ 601.444136] smsc95xx 1-1.1:1.0: eth0: kevent 4 may have been dropped
[ 601.452137] smsc95xx 1-1.1:1.0: eth0: kevent 4 may have been dropped
[ 601.460138] smsc95xx 1-1.1:1.0: eth0: kevent 4 may have been dropped
[ 601.468140] smsc95xx 1-1.1:1.0: eth0: kevent 4 may have been dropped
[ 601.476115] smsc95xx 1-1.1:1.0: eth0: kevent 4 may have been dropped
[ 601.484138] smsc95xx 1-1.1:1.0: eth0: kevent 4 may have been dropped

This can can also be noted in the ping times to the local router, which are of the order of 0.9ms normally and 500-2500ms when a mouse and keyboard are plugged into the hub.

This seems to have been attributed to noise from somewhere, either from the hub or from using the HDMI (As the errors only appear to happen when X is running).
This has been discussed at https://github.com/raspberrypi/linux/issues/60

Temporarily worked around this issue by plugging both mouse and keyboard into the PI itself, although long term this is less than ideal.

4 digit 7 Segment LED Display

After acquiring a large ( 26cm x 13cm) 4 digit 7 segment display, from George (M1GEO) and not wanting to unpack I set about making it work under linux.

The board contains a SAA1064 - an I2c 4 digit 7 segement display driver chip. Ideal for connecting to my bus pirate.

After much stumbling around and trial and error I managed to get it to light each segment. The notable points(errors) were:

 

  1. I2C is an open collector bus, meaning each device only pulls the data lines low. This meant that I had to turn on the Bus pirates on board pull up resistors, as for some reason the ones I thought were doing it on the board weren't.
  2. When using the bus pirates pullup resistors, the Vpu(V pull up) lead should be connected to +5V.
  3. The board requires a large voltage inorder to get the Led's to light, my initial attempts used the bus pirate to power it, but this was both too low current 125mA and too low in voltage for anything to light. I then connected it to an external power supply and found it lights best at about 12V although the chip does get a little warm :S (The data sheet claims it's good till 18V)
  4. The digits are counted from the right hand side(with the chip and sockets at the bottom).

The Digits are are as follows:

0 - 0xfd
1 - 0x0c
2 - 0xda
3 - 0x9e
4 - 0x2e
5 - 0xb6
6 - 0xf6
7 - 0x22
8 - 0xff
9 - 0xfd

Bus pirate:

I once it's connected the bus pirate need to be set to I2c mode i found the default 5khz speed worked fine for me. The pullups and on board power supplies are turned on by sending 'Pn' and 'Wn' respectively. Then to write to all the digits at once I used the following command:
[ 0x76 0x00 0xf2 d1 d2 d3 d4 ]
Where 0x76 is the device address (determined by a potential divider connected to pin 1 of the chip). 0x00 Tells it i want to start writing at the control register. 0xf2 Tells it to refresh all digits and I want them at maximum brightness. then d1,d2,d3,d4 represent the digits in hex.
Heres a picture of it working: