Saturday, January 6, 2018

Beyond the Intel Meltdown Bug

The Intel Page Table Bug has spurned many discussions and a lot of complicated hard work is going into mitigating it, but I am not convinced that the software mitigations are sufficient The problem will only really be solved once Intel fixes the bungle in their processor microcode (which is currently causing processor crashes causing the bungled Intel fixes to be withdrawn by Dell and HP), or make new silicon.

I have written more than one assembler, linker and debugger when I was younger and computers were simpler.  I have found and fixed a bug in an Intel C compiler and reported the same bug in GCC.  I have also written a few device drivers for Linux and Windows, so I am experienced with digging deep down in the computer weeds.  However, I am not unique - there are thousands of other people with the same experience and the problem is that some of these people are not very nice...

The issue that I see with software patches in the Compilers, OS and Web Browsers, is that an attacker need not use a new patched Compiler, OS or Web Browser.  

If an attacker is smart enough to understand and use the side effects of faulty processor instructions to read someone else's data, then he is smart enough to write a piece of assembly code by hand and insert it inline in a C code wrapper to exploit it, or he can simply use an older unpatched version of the C compiler/OS/Browser.

The other problem is that there are hundreds of different Intel processors and there is no easy way for ordinary mortals to tell which Intel processor is inside their computer.  The sticker on the outside of a box is purely a marketing sticker with no useful information on it.  Consequently, trying to figure out which of the hundreds of patches you need is a fool's errand.  Therefore the easiest solution is to buy a new AMD based computer.

One Way Mirror

Intel is trying their level best to throw sand in the eyes of the press, by pointing out minor flaws in the AMD processor line.  Yes, AMD processors have some bugs too, but the Intel Meltdown bug is extremely dangerous.  An attacker can rent a $5 virtual server in a data centre and then read the data of other users, while the victims have no way to tell that they are being spied upon.  

It is like having a one-way mirror in your bedroom - you cannot tell whether there are prying eyes on the other side.

I fear that all the hard work that was done by BSD, Amazon, Google, Microsoft, Apple, Redhat, Linus and others, will only stop script kiddies and will not stop a determined attacker.

Sell, Sell, Sell...

In 1997, there was the Intel Pentium F00F bug.  If one would stick the code "F0 0F C7 C8" into an inline assembly statement, then a faulty Pentium processor would immediately halt.  The problem that we have now, is much, much worse, but same as the F00F bug, it will only be completely solved once everyone threw their old Intel computers away and bought new AMD computers, or new Intel ones made with new silicon. 

If you haven't followed the lead of the Intel CEO and swapped your Intel stock for AMD stock, then you better do so post haste, since nobody in their right mind should buy Intel processors, until they properly fixed this mess.


Oh well, at least my little Raspberry Pi is fine and maybe I should go and dig my Beaglebone Black out of the junk box too...

Écrasez l'infâme!


Wednesday, December 27, 2017

Parasitic Quadrifilar Helical Antenna

If you want to receive Satellite Weather Pictures, then you need a decent antenna, otherwise you will receive more noise than picture.

For polar orbit satellites, one needs an antenna with a mushroom shaped radiation pattern.  It needs to have strong gain towards the horizon where the satellites are distant, less gain upwards where they are close and as little as possible downwards, which would be wasted and a source of noise.  Most satellites are spin stabilized and therefore the antenna also needs circular polarization, otherwise the received signal will flutter as the antennas rotate through nulls.

The helical antenna, first proposed by Kraus in 1948, is the natural solution to circular polarized satellite communications.  It is a simple twisted wire - there seems to be nothing to it.  Various papers have been published on helix antennas, so the operation is pretty well understood.

Therefore, it is amazing that after more than half a century, there is still a new twist to the helical antenna...

Backfire Helix

The backfired quadrifilar helix array is especially popular for amateur satellite communications, but the results reported by Chris van Lindt and Julian Moss (G4ILO) regarding the antenna drawing on the right, left me curious and wondering whether we are dealing with an internet myth, or a comedy of errors, or a design that is too sensitive to build easily.   

Chris reported that the QFH exhibits nulls that are useful for tuning out terrestrial interference.

How can an omni-directional antenna have a null?  That comment rang a huge alarm bell in my mind that the commonly used QFH antenna was not designed or built right.  To figure out what is going on, I modeled the QFH in NEC2.

First of all, I don't really like backfire helices, because that is not the way that Kraus intended them to be implemented and because much power is lost in the forward direction which will then hit the ground, while you are trying to talk to the sky.  The Kraus helix design calls for an earth plane / reflector, which will project the back lobe forward.

Without the reflector, the radiation pattern of a helix is very messy, but since that is what lots of people are using, I modelled it this way.

A model is never 100% the same as a real antenna, but the NEC cards presented below allows any true card carrying radio/computer geek (a.k.a. radioham) to easily play around with it and get  a feeling for the critical antenna constraints, before building one.

The helical antenna work published by Kraus in 1948, shows that a thin helix radiates in normal mode, while a fat helix radiates in axial mode, as shown in his famous angle vs circumference graph. 

Simple Thin Helix in Free Space - No Reflector

The picture above, shows what a single turn thin helix radiation pattern looks like if there is no reflector - an upside down mushroom.  The bulb at the bottom is turned skyward when the thing is flipped over in a backfire configuration, while the twirl at the top is then pointed to the ground.  So while in backfire mode it is nicely circular polarized and nicely omni-directional, there is nevertheless significant radiation towards the ground.

I plotted these with CocoaNEC on a Macbook (since it makes the prettiest plots) and it cannot rotate a helix in the x or y axis, so if you want to flip it, you got to turn your computer around.  CocoaNEC also cannot handle a half turn helix, so I used one full turn.  You could use xnec2c on Linux or BSD for the full set of NEC2 helix options, at the cost of uglier graphics.

Helical Arrays

A monofilar helix is a very long and unwieldy thing.  It is easier to handle a shorter antenna and there are various ways to achieve that.

Every half wavelength, the current in an antenna goes to zero.  When the current goes to zero, it doesn't matter if the wire is open or closed circuit, so one can cut an antenna every half wave length and it will still work the same.  Similarly a long helix could be considered to be an array of identical little helices in a row.  One could even take these little helices and put them side by side and it will still work the same, or one can rotate and interleave them into a multifilar helix.

The main problem with a multifilar helix is hooking the filaments up with the correct phasing.

Bifilar Helix

In a bifilar design, the one helix is rotated through 180 degrees.  It also needs to be driven with a signal that is rotated 180 degrees.  This is easy to do with a balun.

Connect the centre wire to one helix, the shield to the other and then wind five to ten turns in the coax feed to increase the impedance of the sleeve.   That makes a simple infinite balun.

Quadrifilar Helix

A quad design is the same idea as the bifilar, with four helices each rotated by 0, 90, 180 and 270 degrees.  A quad design is nice and compact, but getting the phasing right is much more of a chore.  A 1/4 wave length of coaxial cable will give a 90 degree phase shift.  This is easy to do for a hobbyist, since all you need is a calculator and a ruler.

QFH - 4 Phased Driven Elements

Most of the QFH designs on the wild wild web however, use one short and one long loop of wire (As from the design for the OSCAR 7 satellite).  The idea is to make two helices that are too long (inductive) and two helices that are too short (capacitive), then hook them up in parallel.  One loop then leads 45 degrees, while the other one lags 45 degrees electrically, thus giving a 90 degree phase shift.  See this

However, if the wire dimensions are not exactly right, then it will be anything but - especially the capacitance.  Hence that comment about the handy nulls in the omni-directional pattern...

NEC2 model of a QFH with Transmission Line Phasing:
CM Quad Helix Antenna
CM Copyright reserved, Herman Oosthuysen, 2017, GPL v2
CM 2 meter helical dipole array
CM 137 MHz
CM c=299792458 m/s
CM WL = 2188 mm, r=348 mm
CM WL/2 = 1094 mm
CM WL/4 = 547 mm
CM Max Segments is 10,000 / 40 mm = 250
CM Diameter = 378 mm
CM Radius = 189 mm
CM Length = 570 mm
CM Turns = 1
CM Turn spacing = 570 x 2 = 1140 mm
GH 1 50 1.14E+00 1.14E+01 1.89E-01 1.89E-01 1.89E-01 1.89E-01 1.00E-03
GM 1   1        0        0      90        0        0        0        0
GM 1   1        0        0      90        0        0        0        0
GM 1   1        0        0      90        0        0        0        0
TL 1 1 2 1 50 0.547 0 0 0 0
TL 2 1 3 1 50 0.547 0 0 0 0
TL 3 1 4 1 50 0.547 0 0 0 0
FR     0     0     1      0  1.37E+02         0         0         0         0         0
EX     0     0     1      0  1.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
RP     0    91   120   1000         0         0         2         3      5000

The NEC model is actually not complicated, but you need to read the manual to understand it.  I defined one helix with a GH card, then replicated and rotated it 3 times with GM cards.  The phasing is done with three transmission line (TL) cards. The first helix is excited with 1 Volt using an EX card and the last thing is the radiation pattern (RP) card.

BTW, the NEC2 manual is here:

Quadrifilar Parasitic Helix

Another way to get the phasing right, is to ignore it altogether!

If you make a quad and only drive one helix and leave the other three floating as parasitic elements (same as on a Yagi-Uda antenna), it will work almost exactly the same as when you actively drive them.  Most importantly, it will work much better than if you would drive them wrongly!
QFH - 1 Driven, 3 Parasitic

The above plot shows a quadrifilar helix in free space with one driven element and three parasitic elements.  This plot doesn't look much different from the one above it and it eliminates a major head-ache, so you can then set your phasers to stun.

The NEC model is the same, just remove the three transmission lines.


The antenna god (a.k.a. Kraus) intended helices to work with reflectors.  If we expand the model to include a ground plane, the pattern turns right side up and the stem of the mushroom (almost) disappears, leaving only the bulb, so all the energy goes the right way, providing another dB or two of gain.

QFH - 1 Driven, 3 Parasitic, Reflector

It is the same as the one above, but you don't need to crick your neck.

NEC2 Model Including a Reflector:
CM Quad Helix Antenna with Parasitic Elements
CM Copyright reserved, Herman Oosthuysen, 2017, GPL v2
CM 2 meter helical array
CM 137 MHz
CM c=299792458 m/s
CM WL = 2188 mm, r=348 mm
CM WL/2 = 1094 mm
CM WL/4 = 547 mm
CM Max Segments is 10,000 / 40 mm = 250
CM Diameter = 378 mm
CM Radius = 189 mm
CM Length = 570 mm
CM Turns = 1
CM Turn spacing = 570 x 2 = 1140 mm
GH 1 50 1.14E+00 1.14E+01 1.89E-01 1.89E-01 1.89E-01 1.89E-01 1.00E-03
GM 1   1        0        0      90        0        0        0        0
GM 1   1        0        0      90        0        0        0        0
GM 1   1        0        0      90        0        0        0        0
GN 1
FR     0     0     1      0  1.37E+02         0         0         0         0         0
EX     0     0     1      0  1.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00  0.00E+00
RP     0    91   120   1000         0         0         2         3      5000

The reflector is modeled here as a ground plane card (GN 1).   This works on CocoaNEC, but with Xnec2c, you need to shift the helix up by one or two millimeters to avoid a short circuit, or define a multi patch surface with two SM and SC cards slightly below z=0.


It therefore turns out that a 2 meter band, 146 MHz QFH antenna is actually easy to build, even easier than anyone imagined, simply by ignoring the phasing problem altogether:  

Wind four helices, each 1027 mm long, around a former 300 to 400 mm diameter, connect one up to a 50 Ohm coax and leave the other three floating as parasitic elements.

For good measure, add a reflector, connect it to the screen of the co-ax and put the thing right side up as Kraus intended.

Similarly, you could make a helical array with any number of filaments and get any amount of gain (practically up to about 15 dBi), but the quad neatly solves the impedance matching problem, since it has an impedance of about 40 Ohms and can be hooked up with garden variety RG-58 co-ax without bothering with a tuning element.

Circular Polarization

The electrical field is forced to rotate clockwise, when looking up at the sky, by the helix rotation.  To confirm that you do the right hand polarization correctly, get a nice big wood screw.  If the helix uses a reflector, then it needs to follow a normal right handed screw.  If the helix is backfired without a reflector, then it needs to be opposite to the right handed screw.  

A wrong way polarized antenna will cause a big drop in signal strength.  Opposite polarization is effectively a permanent null pointed at the satellite. 

A right handed bolt will never fit in a left handed nut - unless you use a big hammer...

La Voila!


Sunday, December 17, 2017

Satcom 2 m band Helical Antenna

To receive Satellite Weather Pictures, you need a special antenna that will handle the rotating signal.

Dimitris Papadeas at SatNOGS built a variety of 2 meter band helical antennas:

To see how well it works, I modeled his design with NEC2 using CocoaNEC on my Mac.  The radiation pattern looks cool.  With 12 dB gain, it would be good on a simple tracker or for permanent pointing at a Geo sat.  You cannot just point it up at the sky to catch a polar bird, since then a satellite would have to pass almost directly over head, which doesn't happen very often.

2 m Band Helical Antenna Pattern

At this size, a crossed Yagi would be rather easier to build though. A helix is more suitable for the 70 cm band, where it will be much smaller and easier to support.

CM Helix, SatNOGS, v4
CM Frequency: 434 MHz
CM Wavelength: 691 mm
CM c=299792458 m/s
CM Radius = 110 mm
CM Turns: 8
CM Circumference to wavelength ratio: 1
CM Reflector perimeter to wavelength ratio: 0.8 = 553 mm
CM Winding diameter: 220mm
CM Winding circumference: 691mm
CM Winding spacing: 172 mm
CM WInding length: 5696 mm
CM Reflector perimeter: 553mm
CM Total length = 172 mm x 8 t = 1376 mm
CM Reflector plane 1 mm below zero to avoid a short with start of helix
CM Feedpoint(1) - Z: (111.340 - i 1152.400) I: (0.0001 + i 0.0009) VSWR(Zo=50 Ω): 99.0:1
CM Antenna is in free space.
CM Directivity: 11.08 dB
CM Max gain: 12.51 dBi (azimuth 0 deg., elevation 90 deg.)
GH 1 500 0.172 1.376 0.110 0.110 0.110 0.110 0.003
SM 10 10 0.277 -0.277 -0.001 0.277 0.277 -0.001
SC 0 0 -0.277 0.277 -0.001
EX 0 1 1 0 1 0 0 0 0 0 0
FR 0 1 0 0 434 0
RP 0 90 90 0 0 0 1 4 0 0 0

This design will work over the whole 2 m band and is good for Hamradio, Weather and Cubesats.

What I like about satellite work, is that it is low power, sensitive work, so you need to know what you are doing, but you will not zap anyone touching your antennas when you happen to be transmitting at 3 or 5 Watt.

The modern earth observation satellites produce amazing pictures and they change all the time, due to the sun angle, seasons and weather


Helical antennas superimpose nicely.  That is, if you would wind four helixes together, each 2 turns, every 90 degrees, it would be equivalent to a single 8 turn helix, just much shorter.  Here is the seminal work on the quadrifilar helix

La voila!


Monday, December 11, 2017

Raspberry Pi 3 Headless Server With SSH

If you wish to make a standalone router, file server, or satellite weather station, then you need a little computer to make things happen.  At this time, the most popular embedded Linux machine is the Raspberry Pi.  It is a delightful little design - tiny and very useful.

The default system is Raspbian, which is loosely based on Debian.  This is excellent.  Years ago, I tried a Beaglebone Black and it came with a cripple version of Angstrom Linux which I didn't like and the board is consequently lying somewhere in my junk box.

The Raspbian system is aimed at clueless newbies and the ssh daemon is disabled by default.  To use it as an embedded server, without having to plug in a keyboard and screen, you need to add one line to a configuration file, before you plug the SD card into it.  Here is how to do all that.

Get a Pi and a SD Card Image

Get your RPi3 from here:

Download a Raspbian image zip file from here:

Open a terminal and unzip with:
$ ark —batch

That will take a loooong time…
(You have to do this on the command line.  A graphical tool will very likely run out of memory and crash.)

Become super user:
$ su -

Write the img file to a miniature SD card:
# dd if=filename.img of=/dev/mmcblk0p


Make a headless pi

Re-insert the SD card and mount the root directory (don’t bother with the boot directory).
# cd /run/media/username/root/etc
# vi rc.local

Insert mode:

Go to the bottom and just above the exit statement add:
systemctl start ssh

Save the file:

Flush the disk file buffers:
# sync

Umount and Eject the card.

First Login

Now when you hook the Pi to your router, it will get an IP address via DHCP and then run sshd automatically the way the Linux gods intended it to be.

You can then log in with for example:
$ ssh pi@

Change the password:
$ passwd

Expand the root filesystem to use all of the SD card

Since this is a new device, you need to expand the file system to fill the whole SD card:
$ sudo raspi-config

Now do Update followed by Advanced, Expand Filesystem.  Then do Finish, Reboot, Yes.

Solid State File Server

With four 256 GB USB flash memory widgets plugged in, you can make a 1 TB solid state file server for about 1100 Dirhams - something that was unimaginable just a few years ago.

A file server doesn't have to be fast.  It is limited by the network speed, not the processor.  So a little Rpi makes a very cost effective file server.

So far, I managed to get only two 256 GB Sandisk widgets.  They came in perfectly idiotic packages, so I had to break all the plastic off to get them to fit in the USB sockets.  For protection, I wrapped one layer of self vulcanizing tape around them.  I don't know what the clowns who designed the little enclosures were thinking, but it was clearly form over function - now it is function over form...

I always prefer doing things the simple way, so I formatted them with ext4 and mounted them using /etc/fstab in /mnt/sda1 and /mnt/sdb1 like this:
$ sudo fdisk /dev/sda1
-t 83

$ sudo mkfs.ext4 -L sda1ext4 /dev/sda1

$ sudo nano /etc/fstab /dev/sda1 /mnt/sda1 ext4 defaults,noatime 0 1

$ sudo mount -a

...and ditto for the other one.

I have never managed to figure out how to mount a disk so that a common user can write to it.  My workaround is to make a directory on the thing and assign the user name and group to that, so now I have /mnt/sda1/dataa and /mnt/sdb1/datab and chowned them to pi:. $ sudo mkdir -p /mnt/sda1/dataa
$ sudo chown pi: /mnt/sda1/dataa

So the access problem is solved without having to read another manual on disk mounting and with that, I now have 512 GB of online solid state storage, accessible over ssh and scp.


These Sandisk USB watchammacallits get very hot and there are long stories on the Sandisk forums about heat problems.  So removing them from their plastic packaging is actually a good idea, since that improves the air flow over the chips. The good news is that most people say they last for years, despite the heat.

Rsync Backup Script

I made a RSA key file with ssh-keygen and uploaded it with ssh-copy-id, as described here

The IP address of the Rpi was added to /etc/hosts, so I don't have to keep typing it in.

The trick with a backup script, is to keep it simple and include everything in your home directory and then exclude a few generic things.   That way, the script is maintenance free and will always work, irrespective of how you move files around.

My rsync backup script now looks like this:
#! /bin/bash
rsync -avze ssh --progress --delete --max-delete=10 --max-size=20M --exclude '.Trash'  ~/. pi@rpi:/mnt/sda/dataa/

The max-delete protects against catastrophes and max-size prevents making backups of large ISO files and movies, since those things can always be downloaded again from wherever they came from.

La voila!


Saturday, December 9, 2017

Satellite Weather Maps, on a Macbook

There are about 3000 active communications and earth observation satellites flying over our heads at all times (plus about 2000 dead ones).  Many of the earth observation satellites broadcast useful data which anyone can receive, once you acquired the necessary equipment and know-how.  See this

 Clouds in the UAE Desert

Weather satellites are generally considered to be the most useful of the lot, since the data is open and not encrypted and the signals are quite strong.  The NOAA operates both geostationary and polar observers.  The geo satellites can only be received if you happen to live in its antenna footprint (North America), while the polar satellites pass overhead twice a day wherever you are.

This article describes how to get an image from one of the NOAA polar satellites, using a cheap ($25) little RTL-SDR radio receiver.  These pictures are interesting, since the weather is always changing.  You also need to make a decent antenna, else you may have more noise than picture.

Interface Specifications

NOAA-15, NOAA-18 and NOAA-19 are probably the easiest to interface to.  All three satellites broadcast using an ancient system termed Automatic Picture Transmission (APT).

The APT signal is 2.4 kHz, frequency modulated, described here and here

Each facsimilee line starts with a tone burst and the monochrome line is encoded onto a 2.4 kHz tone by frequency modulation at a rate of two scan lines per second.

To decode it, you need a phase locked loop to convert the FM signal into a varying brightness level - simple as that.

Which Computer System To Use

Most ordinary mortals use MS Windows computers.  These are generally good for playing games, writing letters and doing bookkeeping, but they are not very good for engineering use.  The problems are many fold:  The operating system scheduler is not real-time, the USB interface is buggy, scientific software invariably require specialized libraries of specific versions, which sometimes clash with libraries that are already installed - known as DLL Hell.

The result is that if your special program happens to work, then you are in luck.   
If it doesn't work, then you are out of luck, there is nothing you can then do about it and your project is hung - Nuf sed.

A Macintosh system is better, since it is based on FreeBSD, but it suffers from some of the same software library issues when using precompiled (non-Free) software.  However, if you use Free software, then it is much the same as Linux/FreeBSD.  In order to use Free scientific/engineering software, you need Xcode (The C compiler provided by Apple, in the App Store),  Macports and Homebrew  With these tools, you can compile specialized software, much the same as on FreeBSD/Linux.

Linux and BSD have good real-time performance and gives one full control over everything.   On these UNIX systems, Free software is installed by downloading the source code and compiling it on your machine.  This sorts out all the library dependency issues for your system, with the result that specialized scientific and engineering software generally work much better than on other systems.

Note that the future NOAA software systems will all run on Linux and other operating systems will be supported through Linux virtual machines only, as explained here

So, for Linux users, it is the same idea as in this article.  You need to install rtl_sdr, gpredict and WXtoImg.  All the same, just a bit easier, since the repositories have what you need and you won't need weird paths - everything will be in the usual places.

The Heavens Above

The web site is very useful, but the best way to see when a satellite will pass overhead is with gpredict.

Install gpredict from macports:
$ sudo port selfupdate
... long wait...

$ sudo port install gpredict
...even longer wait...

Finally, you can run it:
$ /opt/local/bin/gpredict

Gpredict Satellite Orbit Prediction

You need to select the satellites that you want to track, but it is not immediately obvious how.  There is a tiny down arrow at the top right, select Configure, then scroll down to the NOAA sats.  Enter your own ground station co-ordinates and then if you hover the mouse over a bird, you can see how many minutes are left to reach your position.

There is also command line version called predict.  It can be used to get the pass data for a satellite for use in scripts, in order to automate a weather map system.  Here are some examples:

Passes between two dates (in seconds since UNIX epoch):
$ predict -f NOAA-15 $(date +s) $(expr $(date +s) + 600) -o n15pos.txt

Passes for next 10 minutes
$ predict -f NOAA-15 +10m

Single pass after now (useful from a crontab):
$ predict -p NOAA-15 -o n15pos.txt

Single pass after sunrise on a specific day:
predict -p NOAA-15 $(date +%s -d”02/14/2018 06/00/00”) -o n15pos.txt

It can get very complicated, but the simplest method is likely the most useful:
$ predict -p NOAA-15
1518602108 Wed 14Feb18 09:55:08    0   21  192   49   41   3315   2726 *
1518602207 Wed 14Feb18 09:56:47    6   24  196   44   43   2678   2726 *
1518602305 Wed 14Feb18 09:58:25   15   30  200   38   45   2067   2726 *
1518602400 Wed 14Feb18 10:00:00   26   41  204   32   47   1527   2726 *


The first line gives the time to start recording and the last when to stop - or you can simply stop recording after 15 minutes, but note that the time is in UTC, so you have to add your time zone offset.

HOWEVER... After much experimentation, I still could not get predict to give the correct time.  It always differs from gpredict by about an hour.  It seems to predict a completely wrong satellite.   Some people are using it, so it must be my Keppler data and satellite database that is wonky.

Image Rendering

Reputedly, the best program to render the images appears to be WXtoImg, which you can get here, but my experience with this program was not good.  The ancient wxsat program worked, but it is a 32 bit Windows program.

 UAE Desert Colour Image by Wxsat

There are other decoders and renderers for Linux/BSD, but I have not tried them all yet.

The secret seems to be to edit the file after recording it and trim the inaudible start and end and save only the good part in the middle in .wav format.  On a Mac, you can trim a file with Quicktime, but it cannot save the result in .wav - it exports to .m4a. To trim, save and resample a .wav file to 11.025 kHz, you need to get Audacity from Sourceforge, or use sox.


The software required for the RTL-SDR radio widget is described here:

You need CubicSDR and rtl_sdr as described in the above link - or gqrx on Linux.


You can look at and listen to the satellite data with CubicSDR.
  • NOAA15: 137.62 MHz
  • NOAA18: 137.9125 MHz
  • NOAA19: 137.10 MHz
The actual frequency is 1.9 kHz lower than the above (the upper side band) and the modulation type is Wide Band FM (35 kHz).  Once tuned in correctly, you'll hear the fax lines go cheap-cheap-cheap... at two cheaps per second.  If it doesn't sound good, then it also won't decode properly.

You need to play with the gain setting.  My turnstile antenna is on the roof, hooked to a 15 meter 50 Ohm RG58U co-ax going in a window to the RTL SDR dongle plugged into a little netbook.  I use "-g 49" to for NOAA15 and NOAA18.  The NOAA19 satellite is more powerful and needs a lower gain setting of "-g 35".
The satellites also have other sensors on them and in future there will be other frequencies in the L and X band with much more data, as explained here


If you would use a simple dipole antenna, then you would only be able to receive something when the bird is almost directly overhead.  This may be good enough at first.

A better receive antenna that you can build yourself using common commercial items, is described here:

You need to know how to wield a drill, soldering iron and tin snips.  Do wear glasses, so you don't poke an eye out with the rods while working on the thing.

The advantage of this antenna is higher signal gain upwards and less noise from the surroundings.  However, the gain is not so high that you need to track the satellites with a mechanical rotator.  Just point it vertically up at the sky.  A plastic, water filled umbrella base, is all you need to keep it standing up.

Weather Data Capture

Once you figured out when a bird will fly overhead, go outside with your whole kit and kaboodle - you won't receive much indoors, if anything.  It depends on what your roof is made of and you won't get a very interesting image at night either.  So, horror of horrors, you have to get out of your cave in daylight!

The 2400 Hz "cheap-cheap" line data screeches can be received with the rtl_fm program and transcoded to wav format with Sound Exchange (sox), as below.

Note that on my Macbook sox resides in /usr/local/bin and rtl_fm in /opt/local/bin, probably since one was installed with homebrew and the other with macports.   This kind of confusion is one reason I prefer Linux for engineering work.

The dangling dash tells sox to read from stdin - the piped data from rtl_fm.  Once you got the data, down sample it with sox to 11.025 kHz for decoding with wxsat.

For example (NOAA15 137.62 MHz - 1.9 kHz, USB):
$ /opt/local/bin/rtl_fm -g 49 -d 0 -M fm -f 137.62M -s 55k -l 0 | /usr/local/bin/sox -r 55k -t raw -e s -b 16 -c 1 - wxdata-55k.wav
$ /usr/bin/sox wxdata-55k.wav -c 1 -r 11025 wxdata-11k.wav

I got better results by setting the gain with -g 49, than by leaving it to automatic.

Found 1 device(s):
  0:  Realtek, RTL2838UHIDIR, SN: 00000001

Using device 0: Generic RTL2832U OEM
Found Rafael Micro R820T tuner
Tuner gain set to automatic.
Tuned to 137618100 Hz.
Oversampling input by: 19x.
Oversampling output by: 1x.
Buffer size: 7.84ms
Exact sample rate is: 1045000.031662 Hz
Sampling at 1045000 S/s.
Output at 55000 Hz.

...long wait...

Press Ctrl-C to stop and close the wxdata.wav file.

You can pipe the signals straight into the wxsat rendering program and get the image in real-time, but making it work the simple way first, is hard enough for starters.

Also note that there are multiple types of weather fax modulation modes used by polar sats, geo sats and HF radio.  Russia also has different satellites.  The above examples are for the older polar NOAA satellites only.

Render the Image

Now you need to trim the audio file to get rid of the noise at the beginning and end and then run wxtoimg, hamfax, wxsat or satsignal and read the audio file.  Hopefully, the result will be better than my first try!

Nice Weather!

With a simple antenna, it will only work if the satellite is passing fairly high, more than 20 degrees above the horizon, otherwise there will be too much noise, distortion and doppler shifting and the first and last 5 minutes are typically unusable, leaving maybe 5 minutes worth in the middle that you can actually use. 

If your antenna didn't blow down in the last storm, 
then it isn't high enough.

The WxToImg program proved to be quite useless to me. I never managed to decode anything useful with it, no matter how good the recording sounded to my ears.

Eventually, in sheer desperation, I used Audacity to convert the recordings to 11.025 kHz sampling rate and decoded a picture (the one at the top) with the old wxsat running on a trusty old Windows XP virtual machine on my Mac.  The better solution is to edit your record script and add another line to down sample with sox (you could do it in a single line if you use the sox effects chain -rate 11025).

Schedule a Weather Fax Recording

Use the at daemon (or crontab) to schedule the execution of a script, so that you don't have to leave your lair during the day time and suffer sunburn:
$ at -f /Users/herman/Hamradio/WeatherSats/n19 now + 1 minute

Note that you will get better results by starting the recording cron job 5 minutes late and ending 5 minutes early, since close to the horizon, there is just too much noise and distortion in the signals.

For example:
$ at -f ./n19 now + 168 minutes
job 6 at Fri Feb  9 13:45:00 2018
$ at -f ./n15 now + 369 minutes
job 7 at Fri Feb  9 17:08:00 2018

$ atq
6    Fri Feb  9 13:45:00 2018
7    Fri Feb  9 17:08:00 2018

If you read man at, it says that the daemon is turned off by default.  If needed,  enable it with: 
$ sudo launchctl load -w /System/Library/LaunchDaemons/ 

The recording will run forever, unless you stop it with a scheduled kill command!

So you can make a simple killall script like this:
#! .bin/bash
killall n19

and schedule it like this:
$ at -f ./n19stop now + 178 minutes

To capture 10 minutes of data.

Other Software

There are also weather fax relays on HF radio for mariners.  The encoding is somewhat different and fldigi can be used to decode them.

The most comprehensive meteorological tool kit is probably gempack

You can also look into wview

Setting the above up will likely be quite an adventure...

More Information

A detailed guide for tuning WxSat and making false colour pictures by combining the images from two cameras (visible and IR) in the satellites:

Group for Earth Observation (GEO):

Satellite Networked Open Ground Station (SatNOGS):

Digital Weather Satellite Reception:

Articles on decoding Russian Meteor-M2 weather pictures.  This one is much higher resolution than the older NOAA satellites and since it is in an orbit for weather prediction in Moscow, it is also very useful for the rest of Eastern Europe and the UAE.

Have fun!


Tuesday, December 5, 2017

Amateur Satcom Turnstile Antenna for the 2 meter Band

NEC2, 2 m band, 146 MHz, Yagi Turnstile Simulation and Build

This article describes a Turnstile Antenna for the 2 meter band, 146 MHz amateur satcom, 137 MHz NOAA and Russian Meteor weather satellites.  Weather satellite reception is described here.
Engineering, is the art of making what you need, 
from what you can get.

Radiation Pattern of the Three Element Yagi-Uda Antenna

Once one combine and cross two Yagis, the pattern becomes distinctly twisted. The right hand polarization actually becomes visible in the radiation pattern plot, which I found really cool.

Radiation Pattern of Six Element Turnstile Antenna

Only a true RF Geek can appreciate the twisted invisible inner beauty of a herring bone antenna...
Six Element Turnstile Antenna

Essentially, it is three crosses on a stick.  The driven elements are broken in the middle at the drive points.  The other elements can go straight through if that is convenient, or they can be broken also - it doesn't matter, since the current is zero in the middle.
A 1 inch wide steel roll-up tape measure is self supporting up to about 600 mm - just good enough for the ~500 mm elements - provided that there is no wind to make them flutter.

Another option is to cut up a Carrefour aluminium clothes rack made of 6 mm aluminium tubes, but I like the idea of a roll-up antenna for training - It is easy to stow and transport in a car for the next time I get the urge to bark at the moon.

For the rod, get a 1.5 inch by 1.5 m wooden dowel at Ace Hardware - it comes with a free boat anchor at one end, that one has to remove.  The boat anchor is a bit light - good for a canoe maybe.

So, one can take some implements from the French Revolution and turn them into a modern day satcom antenna.

Circular Polarization

Most Satellites spin around to stabilize them (The ISS is an exception).  The result is that the RF transmissions also rotate.  If you would use a fixed dipole antenna to work a satellite, then the signal strength will fluctuate rapidly.  The solution is to use a Right Hand Circular Polarized Antenna.

 UAE Desert Clouds Picture Made with WxSat

You can get polarization naturally, with a helical antenna.  Otherwise, you can make a rotating field by setting up a 2 phase electrical motor.  The first phase is the regular signal and the second phase is obtained with a 1/4 wavelength delay line (90 degree phase shift), applied to a second radiator, set at 90 degrees to the first one.  So we use two identical Yagi antennas in a cross/turnstile configuration.

The delay line is simple to calculate using c = L x f, so L = c / f = 513 mm (The value used in the TL card).  The speed of light in RG58 copper wire is 0.666 of c so the 90 degree delay line is shorter: L' = c / f / 4 * 0.666 = 342 mm in reality.

The middle elements are driven and the electrical field is forced to rotate clockwise, when looking up at the sky, by using a delay line.  Wrap your right hand around the antenna rod, with your thumb pointing to the sky.  You need the wave to travel from your knuckles to your finger tips.  Therefore if you drive the element at your knuckle, the next one towards your fingertip needs a 90 degree (1/4 wave length) delay.

Tape Measure Antenna

The rod can be wood or metal.  Wood is easier to work, but here in the desert, it can be harder to get.  I bought a garden rake with a nice wooden varnished handle for 40 Dirhams and cut the rake off!  

A 1 inch wide 5 m Stanley tape measure was sacrificed for the elements.

Tape Measure Turnstile Antenna

The reflector is 1/2 wavelength long.  The driven element is 5% shorter and the director is another 5% shorter.  The spacing from the reflector to the driven element is 1/4 wavelength.  The spacing from the driven element to the director is 0.15 wavelength.  This is a typical 3 element Yagi design.  The dimensions are not very critical, since the frequency is low.
  • The overall length of the reflector is 1027 mm.
  • The length of each arm of the driven elements is 488 mm.
  • The overall length of the director is 927 mm.
  • The spacing between the reflector to the driven elements is 513 mm.
  • The spacing between the driven elements and the director is 308 mm.
  • The cabling is RG58, 50 Ohm or similar. 
  • The delay line is RG58, 342 mm in length.
  • The balun is a clip on ferrite, or 5 to 10 wraps around the rod below the driven elements.
The elements can be made from a 24 mm tape measure, or from 6 mm aluminium tubing from a clothes dry rack or whatever tubing you have on hand.  It will work with almost anything, since the frequency is low.  It is easier if the elements are cut 50 mm longer and trimmed after mounting - for finger and eye safety, trim the corners 45 degrees and wrap the ends with tape or heat shrink tubing.  

A beach umbrella stand makes a handy upright support.

The NEC2 Card deck:

CM Turnstile Crossed Yagi, three element each, 2 meter band, 146 MHz
CM Elements are made of 6 mm Al tube (r = 3 mm)
CM CocoaNEC Summary:
CM Frequency 146.000 MHz
CM Feedpoint(1) - Z: (21.111 + i 4.130)    I: (0.0456 - i 0.0089)     VSWR(Zo=50 Ω): 2.4:1
CM Antenna is in free space.
CM Directivity:  8.39 dB
CM Max gain: 8.31 dBi (azimuth 90 deg., elevation 0 deg.)
CM Front-to-back ratio: 14.78 dB (elevation 90 deg)
CM Front-to-back ratio: 15.16 dB (elevation of front lobe)
CM Front-to-rear ratio: 13.92 dB
CM Weather and Amateur Cubesats:
CM 147 (Weather) or 146 MHz (Amateur) Downlink
CM 436 MHz Uplink
CM Speed of light in vacuum = 299792458 m/s
CM Speed factor of RG58/59 = 0.666
CM 2 m band = 146 MHz
CM L = 2053 mm
CM L/2 = 1027 mm
CM L/4 = 513 mm
CM RG58 90 degree phase shifter:
CM L/4 = 513 * 0.666 = 342 mm
CM The first Yagi is oriented in the X plane
CM The wire radius alters the impedance of the dipole:
CM Thicker wire has higher impedance
CM 3 mm radius wire gives 25 Ohm and 1.9:1 VSWR
CM 12 mm radius wire gives 40 Ohm and 6.8:1 VSWR
CM Reflector spacing alters the impedance of the dipole:
CM Closer spacing has lower impedance
CM Length reflector = L/2 = 1027 mm
CM GW 1 5 -0.513 0 0 +0.513 0 0 0.012
CM Spacing = L * 0.25 = 513 mm
CM Length dipole = L/2 * 0.95 = 976 mm
CM GW 2 5 -0.488 0.513 0 +0.488 0.513 0 0.012
CM Spacing = L * 0.15 = 308 mm
CM Y Position = 513 + 308 = 821 mm
CM Length director = Length dipole * 0.95 = 927 mm
CM GW 3 5 -0.463 0.821 0 +0.463 0.821 0 0.012
CM Excite the 2nd wire in the middle on element 3 of 5 with 1 Volt
CM EX 0 2 3 0 1 0 0 0 0 0 0
CM Frequency 146 MHz
CM FR 0 1 0 0 146 0
CM Radiation plot 360 degrees
CM xnec2c: RP 0,91,120,0,0,0,2,3,0,0,0
CM CocoaNEC: RP 0,91,120,1000,0,0,2,3,5000
CM The second Yagi is offset by 10 mm in Y axis to prevent short circuiting the elements
CM It is oriented in Z plane
CM An ideal 1/4 wavelength transmission line connects the two dipoles
GW 1 5 -0.513 0 0 +0.513 0 0 0.003
GW 2 5 -0.488 0.513 0 +0.488 0.513 0 0.003
GW 3 5 -0.463 0.821 0 +0.463 0.821 0 0.003
GW 4 5 0 0.010 -0.513 0.010 0 +0.513 0.003
GW 5 5 0 0.523 -0.488 0 0.523 +0.488 0.003
GW 6 5 0 0.831 -0.463 0 0.831 +0.463 0.003
TL 2 3 6 3 50 0.513 0 0 0 0
EX 0 2 3 0 1 0 0 0 0 0 0
FR 0 1 0 0 146 0
RP 0 91 120 1000 0 0 2 3 5000

Impedance Match

The impedance of a dipole antenna in free space is supposedly 73 Ohm.  The parasitic elements of a Yagi-Uda, reduce the impedance to something closer to 50 Ohm.  You can fine tune the impedance by adjusting the distance between the reflector and the dipole.  The thickness of the elements also affects the bandwidth and the impedance.

In this dual design, there are many elements and the impedance is about 21 Ohm.  Therefore, it is good to hook the antenna up with RG58, 50 Ohm coaxial cable.


The coaxial cable is unbalanced, while the dipoles are balanced.  It is therefore necessary to add some inductance to the cable shield, by wrapping five to ten turns around the rod, just below the driven elements.  Note that the wrap only affects the shield.  The centre conductor is shielded and therefore is blissfully unaware that it is wrapped around a stick.

Alternatively, clamp a ferrite around the cable.  This will prevent the cable shield from radiating and disrupting the antenna pattern.  Again, the ferrite will only affect the shield, not the inner conductor.


A tape measure antenna is not rugged and sooner or later a wire connection will break, but the advantage is that one can fold it and get it in and out of a car, making it good for educational use.

Unknown Satellite Signal

A quick check outside showed that it works.  I could see a satellite signal get stronger over a period of time.  Unfortunately it is raining.  It is the middle of the desert and it is a veritable rain storm - a misty drizzle - not good for my computer!

The signal is stable, and doesn't fluctuate, so the circular polarization is working.


I have subsequently also built an antenna from a laundry dry rack 6 mm aluminium tubes.  This looks rather better and sturdier and there are enough tubes left over for a 70 cm turnstile transmit antenna also.  Once I have both of them done, I'll build an electric screwdriver rotator mount for it.

La voila!


Monday, November 20, 2017

SDR and ATC Transponders

Here is the skinny on my ATC transponder ADS-B phun and games. 

Get a SDR receiver for the princely sum of $25, including antennas and tripod here:

Mode A, C and S Transponders at Al Ain Airport

Ubuntu Linux

First try the Ubuntu repos for dump1090 if that is the Linux version you are using:
$ sudo apt install dump1090

and see if you are lucky!

Fedora Linux

Here is what I did to build Malcom Rob's version of dump1090 on Fedora 26:
According to legend, Malcom's is the best one and according to the below, it really is much better than rtl_adsb.

Get the rtl-sdr library, which includes a set of useful basic utilities, including rtl_test, rtl_fm, rtl_tcp and rtl_adsb:
# dnf install rtl-sdr

Get the development files, so we can build other software with this library:
# dnf install rtl-sdr-devel

Get and make Malcom's software:
# cd
# mkdir sw
# cd sw
# git clone git://
# cd dump1090
# make


Test dump1090

Run it with the default settings:
# ./dump1090

and the output looks like this:
Found 1 device(s):
0: Realtek, RTL2838UHIDIR, SN: 00000001 (currently selected)
Found Rafael Micro R820T tuner
Max available gain is: 49.60
Setting gain to: 49.60
Exact sample rate is: 2000000.052982 Hz
Gain reported by device: 49.60

CRC: 000000 (ok)
DF 11: All Call Reply.
  Capability  : 4 (Level 2+3+4 (DF0,4,5,11,20,21,24,code7 - is on ground))
  ICAO Address: 89645e
  IID         : II-00

CRC: 000000 (ok)
DF 11: All Call Reply.
  Capability  : 5 (Level 2+3+4 (DF0,4,5,11,20,21,24,code7 - is airborne))
  ICAO Address: 8963c2
  IID         : II-00

CRC: 000000 (ok)
DF 11: All Call Reply.
  Capability  : 5 (Level 2+3+4 (DF0,4,5,11,20,21,24,code7 - is airborne))
  ICAO Address: 8963c2
  IID         : II-00

CRC: 8963c2 (ok)
DF 0: Short Air-Air Surveillance.
  VS             : Airborne
  CC             : 0
  SL             : 0
  Altitude       : 1500 feet
  ICAO Address   : 8963c2

CRC: 8963c2 (ok)
DF 0: Short Air-Air Surveillance.
  VS             : Airborne
  CC             : 0
  SL             : 0
  Altitude       : 1500 feet
  ICAO Address   : 8963c2

Old Transponder Modes

$ ./dump1090 --modeac --
Found 1 device(s):
0: Realtek, RTL2838UHIDIR, SN: 00000001 (currently selected)
Found Rafael Micro R820T tuner
Max available gain is: 49.60
Setting gain to: 49.60
Exact sample rate is: 2000000.052982 Hz
Gain reported by device: 49.60
SSR : Mode A/C Reply.
  Mode A : 6041

SSR : Mode A/C Reply.
  Mode A : 0130
  Mode C : 2400 feet

SSR : Mode A/C Reply.
  Mode A : 6041

SSR : Mode A/C Reply.
  Mode A : 0110
  Mode C : 2300 feet

Interactive Mode

To get a display as at the top of the page:
$ ./dump1090 --enable-agc --modeac --interactive --aggressive



I finally got ADS-B to work on my Macbook Pro with a combination of rtl_tcp and cocoa1090.

This is the best radio test tool I've ever bought and it is very useful for acceptance testing and fault finding of radio equipment in a laboratory, hangar, apron or helipad.  

Consider that a Keysight spectrum analyzer costs $30,000 and cannot do half of what this $20 hoosammawatzit does...

-. --- / .-- .. -. -.. --- .-- ... --..-- / -. --- / -.-. .-. -.--