Aug 082015

I wanted to remind myself about C coding and how pointers work – never quite got my head round them at sons.

One of these was experimenting with C code so flawed it caused buffer overflows that crashed the kernel on multi user systems. That means the whole computer must be rebooted and other users would have their projects/data disrupted (it was in 1991, so a 32 bit machine was still known as a minicomputer and often used proprietary flavours of Unix and multiple users logged on using VT100 type terminals). I was already becoming disaffected with the place the profs thought I’d done it deliberately!

Todays Raspberry PI Model 2, placed in a suitable box (use a dark one as strong light can crash it due to a flaw in the chip design) is about the size of two packs of cigarettes; costs way less than they now do in the UK and is less unhealthy.

Aside: I can understand why younger people still smoke as I certainly did back then; but tobacco will knacker your insides and you become very ill as you get past your middle age. it has finished off a lot of my older friends on the electronics/radio scene. So at least try to stop with smoking when you get past age 30 if not before..

Back to the RPi – this amazing device is as powerful as the multi user computer I was using in 1991! The biggest advantage is if I screw up and hose the kernel it is only myself who gets affected by it. and I have done at least once, although most likely via accidental hard shutdowns i.e accidentally disconnecting the DC input whilst it is writing to the SD-card.

It is more tolerant of flawed code (I have made a silly mistake below; who can spot it?)

I used the console (having set the framebuffer font larger using sudo dpkg-reconfigure-console-setup as I couldn’t get the codeblocks debugger to play nicely and I find the GUI IDE more distracting when coding (probably because I am old πŸ˜‰ )

Tip: To get a console from X-windows on RPI press CTRL-ALT-F2, this opens a separate virtual terminal. (you can use CTRL-ALT-Fn) up to F6CTRL-ALT-F7 returns you to the X-window and CTRL-ALT-F1 has some odd error because it is in use as part of the X-windows system.


This version is better.


It works.


OK the code doesn’t do much but it reminds me that in C strings are an array of char, so each string has a char * to point to it. The contents of the char* are, as you would expect, a memory address where the string starts!

I then wanted to see what was going on at lower level, so used gdb. You must compile the code with gcc -g for the debugger to work.


back in the day (1986-1990!) I even knew a bit about Assembler, but left high school just as Acorn ARM computers were available. So I thought I’d see if I could still remember any of it today. If you compile with gcc -S you get assembler code.


this is what the source looks like, I can see the char* array, and its contents πŸ™‚


This bit I do not quite understand as well yet but I can grasp the fact it is part of the main loop..


Of course I need to learn much more about how ARM works (especially as you can only work with registers rather than put memory addresses directly in opcodes) and I am clearly no smarter than I was in my teens but at least my brain hasn’t deteriorated too much over the years πŸ™‚


PS: letting random geese loose in Groningen Netherlands (the message is partly in the Gronings dialect) is not just silly but (quite rightly) illegal under their animal welfare rules.

There would no one to look after it and there are plenty of stray ones already.

However if they were going to be otherwise eaten or put down and I’d arranged with the good folk at Akka’s Ganzenparadijs that the birdies had somewhere suitable to stay it would be a good deed. Emden geese aren’t that expensive (Emden is only just the other side in Germany anyway) and are cheaper alive than dead (a friend of mine farms them).

Although the Ganzenparadijs are a Buddhist animal sanctuary and I am baptised as a Catholic (not a very good one though); sparing the lives of these creatures to atone for someone else’s sin is the sort of thing many religions encourage.

I don’t expect this would get me to Heaven on a chariot towed by geese, but it would be sufficiently silly that all the various Gods would have a good laugh about it and I might even get one of those electric trolleys used at airports and large stations to haul the various heavy items through Purgatory required for the maintenance work I am tasked with.

Jul 182015

Yesterday I was watching a news documentary about the BNetzA (German Communications Ministry) at work with a Peilwagen (radio tracking vehicle) searching out stray signals that caused havoc with vehicle alarm/lock systems and TV-sets for some kilometres around and even got into the communications systems of the aircraft.

It turned out that the middle aged couples complaining about the interference had accidentally caused it themselves by defects in cheap gadgets like weather stations (the signal had also cut across the DWD’s far more accurate weather stations) and animal scarers!

In one bit the BNetzA chap got an urgent call from Bremen aerodrome because of “StΓΆrung durch Pfeifton” on aviation frequencies. A Pfeifton (as its name suggests) is a high pitched sound that may or may not be wanted (it can mean the ringtone on a mobile (Handy)). it is definitely unwanted on those frequencies. Not just Angst but Gefahr; DE has had plenty enough trouble with aircraft recently.

The facial expressions of the BNetzA chap and the way he said Pfeifton made it clear whatever was causing it would be made to pipe down – at ARCEP in France he might be equally likely to pipe his eye πŸ˜‰ )

Also: bald muß die BNetzA mit dem Peilwagen für den Pfeifton suchen.

(I might even have got at least half of the cases and genders right in the above [in German the govt, police agencies are always feminine] πŸ˜‰ )

but there are times when the Pfeifton is desirable:

you can hear and see it on the spectrum display (it is the two brighter yellow lines). The Pfeifton is part of the Signal, but the rest of the yellow is Rausch (noise, but can also mean the effect of booze or drugs!).

“cq cq cq de ddh47 ddh9 ddh8” means that everyone who can receive the signal is permitted to monitor it – BNetZA have licensed the Deutscher Wetterdienst to transmit it, Ofcom, Agentschap Telecom, ARCEP etc allow you to monitor it because we are in the EU (it wasn’t always the case!).

DDH47/DDH9/DDH8 are the callsigns to identify the transmitter (required by international law).

more info about it (in German)

if you look at the wave display you can see why they also send “ryryryryryryryryryryryryryryry”.

even with a 20 000W TX there is a lot of interference on LF (worse on HF) – because of the type of signal used (an upper sideband) you also need a radio receiver which can generate the Pfeifton using a special circuit.

The signal I am decoding is at 147.3 KHz so why is the radio tuned to a different frequency? 147.3 – 146.01 Khz = 1.29 Khz – just right to make an audio signal strong enough to get above the noise.

if the sound is familiar from those documentaries about Bletchley Park; that is because its exactly the same signal! Today its used for more peaceful purposes – eventually you get messages like this

and the stuff which looks like “secret codes” if decoded on a Linux machine (doesn’t work on Windows even with the same software) is actually just the weather; except from ships at sea or weather monitoring stations.

This weather boat is funded by the EU and operated by (I think) the French Navy – BATEU00 = bateau (fr) πŸ˜‰

By now you probably are wondering – why go to all this trouble in the 21st century when you can get the weather info online?

one reason is much of the online stuff for Europe is the exact same data but processed via private companies in USA who know little about Europe’s geography and introduce flaws into the data, in the UK the BBC and Met Office computer links regularly go wrong.

Doing this also unearths any particularly bad interference from gadgets in your building or if the Russians are doing anything sketchy – the small weather boat (which often does some surveillance work as well) is sent elsewhere or told to switch off its radio transmitters unless its an emergency); a lack of weather reports from any European country which isn’t obviously too skint to keep their weather service working also means something unusual is going on. There is always Weather in Europe.

Particularly rough weather means even the Russians stop with all of their spying as well (and even warn Europe of any particularly harsh weather, usually via Norway). Germans and Dutch call that “Unweather” (something so bad it is dangerous to everyone on land, sea and in the air). This whole setup doesn’t even need the Internet; as long as there is some electricity to keep the radio receiver and relatively old netbook going it will operate and this can be done with equipment older than I am…

Jun 282015

Finally got some time to test these loudspeakers, albeit in a different location to where I ultimately plan to deploy them in EPC1 (my studio and workshop).

Tannoy Mercury V1i loudspeakers / luidsprekers / Lautsprechers / enceintes

What they look like from the front; standard rectangular box shape (unlike the Wharfedales which are curved and bulkier)

Tannoy Mercury V1i loudspeakers / luidsprekers / Lautsprechers / enceintes*

he rear binding-posts – complete with clear plastic covers on them (some type of EU safety rule?). Unlike the Wharfedales they do not have the bi-amping links, fine by me as I don’t use two amps – these are my house systems; not a rave rig πŸ˜‰

Tannoy Mercury V1i loudspeakers / luidsprekers / Lautsprechers / enceintes

What they look like with the front covers off.

As I am still tidying up EPC1 (my workshop and studio) I tested them in my bedroom, in roughly the same position the Wharfedale Diamonds are situated.

I connected them to my Sony AV receiver (made in Malaysia in 2009 – more an “Aiwa” in a less brash case.

It has a traditional 1980s era design with a linear PSU and 100W RMS output per channel

I used the output of my laptop and a Raspberry PI B connected to a cheap C-media USB soundcard (better than the internal soundcard which is noisy and a bit “flat” sounding).

This room is smaller, my previous experience of Tannoy LS units (there are some at ICR-FM studios used as studio monitors) is that they need room; otherwise they sound “muddy!”Β  The good news is these ones do not suffer from this flaw – I tested them with everything from German Christian folk music and speech content from Radio Maria Nederland to 80s synthpop and hard techno!

it did seem I had to “give the amp some gas” compared to the Wharfedale Diamonds to get the same sound level (even though the sensitivity of these LS units are supposedly the same) – I haven’t done any “proper scientific” tests but I think the Wharfedales are heavier on the bass than the Tannoys. – but when the tannoys were given the right power they were strong and clear; sounded perfect for radio production. they may not be pro monitors like the reveal but to my ears they aren’t too far off

The Tannoys are way more directional and need to be positioned well – this could be an advantage in EPC1 as it will reduce noise nuisance to outside. So everything works out just right as I intend to use the Wharfedales for general listening [as an upgrade to “Japan” midi system (again made in Malaysia!) and the Tannoys as monitors for DJ mixing and studio production.

Jan 272015

I want some bright lights to flash in the studio when the VFR extension rings (rather than bells sound). The analogue telephone circuit uses a ringing signal of 80-90V AC at 25 Hz (it is quite strong; if you accidentally hold on to bare telephone wires it can definitely be felt!) – and all sorts of random signals can come down a phone line.

So I had to build a circuit to isolate the phone line from any other equipment; not let through any DC electricity (or the phone line will be permanently engaged) and reduce the voltage from the line to trigger an optoisolator.

first video is internal PABX call

second is external call

the circuit is here – the zeners are 10V and capacitor (to block DC and not seize the phone line) 470nF.

The PNP transistor switch is used as the opto is connecting to ground – the 10K resistor which also acts as a check for the opto output (as those 6 LEDs will eventually be in another unit elsewhere) also is a pull-up resistor for the transistor switch. The LED LD1 still glows very dimly even when the circuit isn’t active; maybe I should remove the 220K resistor (that was recommended in the original transistor switch design) as there is actually only 18k resistance between the 12V supply and the “active” LED and possibly leakage current gets through.

That said TBH it works and provides the signals I want so I may leave it at that…


telephone ringing detector + LED driver cct

Nov 302014

short update – had to swap the positions of the Soundtech Series A console and my electronics maintenance workbench – stil loads more to do but here are a few pics

displays by night timeEPC1 by night


DSCF1341Studio clock / monitor signals from Raspberry PI (which can also be used for stream monitoring/silence detection) connected to the cheaper of the two HDMI TV sets (and old one my mum brought with her) that doesn’t have as much resolution [she got the slightly larger and better picture quality LG set that was previously in this position, as she actually watches TV πŸ˜‰ )

I had to deal with altering /boot/config.txt and all sorts of other settings to get a half decent picture on it; its just about good enough for a clock..

output of soundprocessing