Categories
computers suck

Sometimes, things do not go exactly as planned … C development for Amstrad CPC on Raspberry Pi

If you crash an Amstrad CPC, you often got some pretty patterns. Like the one above, which was supposed to print the alphabet, but got about as far as R, then started making coloured spots on the screen. My alphabet doesn’t (usually) contain coloured spots, so something went wrong.

This post is only about the Raspberry Pi in that it’s the nearest always-on Linux system that I have. This would likely work fine on any Linux machine. While the Z80 cross compiler I use (z88dk) is available in the repos, I can’t get it to build anything, so I just pulled down the latest version. To build the compiler:

wget http://nightly.z88dk.org/z88dk-latest.tgz
tar xvzf z88dk-latest.tgz
cd z88dk
export Z80_OZFILES=$(pwd)/lib/
export ZCCCFG=${Z80_OZFILES}config/
export PATH=${PATH}:$(pwd)/bin
./build.sh

This should result in a working environment. We can test it with a simple C program:

/* alfa.c - print the alphabet */
#include

int main(void) {
  char a='A';
  char b=26;
  while (b>0) {
    putchar(a);
    a++;
    b--;
  }
}

You can build it with:

zcc +cpc -create-app -make-app -O3 -unsigned -o alfa.bin alfa.c -lcpcfs -zorg=16384

You should end up with a file alpha.bin of approximately 4749 (!) bytes. You can copy it to a disc image using iDSK:

iDSK blank.dsk -i alfa.bin -c 4000 -e 4000 -t 1

It runs like this:

You can do the same with Z80 assembly language (shown here in the most gratuitously pretty Amstrad assembler, Maxam):
Although this results in only 11 bytes of code, it’s not portable; the C code above compiled and ran on both my Raspberry Pi and my Mac. It wouldn’t even run properly on a different Z80 system, as only the Amstrad CPC knows that call #bb5a prints the character in the A register. On the ZX Spectrum, for example, it was the completely different instruction rst 16 to print a character.

(There’s a lot more on z88dk on the CPCWiki.)

Categories
amateur radio

One year of amateur radio: what works

So I’ve just got my digital mode setup working again. It seems that somewhere, somehow, a driver for the SignaLink USB decided to stop working, and at best I got no signal on transmit and a very very quiet one on receive. Now my mind’s back in radio mode, I realise there’s a ton of stuff I’ve bought and found to be of variable utility. This is the good stuff:

  • Rigblaster Pro: this audio interface is far larger and far more expensive than it needs to be, but I got it used for a good price. Coupled with a $3 (!) USB sound card, it makes a sensitive and controllable sound device. I think I now prefer serial PTT-controlled audio interfaces to the SignaLink’s vox-style “Make a noise and I’ll transmit it” mode. It means you won’t accidentally tx system noises. That’s worth having another USB cable lurking about.
  • LDG autotuner: because of the wild and pointless diversity in radio interfacing, LDG makes a bunch of autotuners for specific radio models. Mine just works, and will tune my mini-G5RV from 10 to 80(ish) metres.
  • Big external meter: a cheap LDG meter is way better than the fiddly bar graph on the front of my FT-857D. I have it set up for signal on receive, and perhaps slightly unusually, AGC on transmit. Since I have a tuner and run almost entirely digital modes, it’s important that my signal doesn’t distort, so seeing AGC and being able to tweak it is important.
  • Heil Pro-Micro headset: this is comfy, and keeps the family sane. I have the footswitch too, which really helps to run nets.
  • Quarter-wave dual-bander HT antenna: The rubber ducks that all my HTs have are a bit rubbish. A simple replacement antenna allows me to talk through fairly distant repeaters from my sheltered back garden.
  • WinKeyer USB: I’m just starting morse. The WinKeyer kit was so well put together it was a delight to build, and seems to be an utterly sound keyer.
  • Fldigi: the digital mode program. Reliable, full-featured and free. It basically runs all the time on my shack computer.
  • Chirp: I can program all my HTs and my HF rig with this. It’s truly great, and miles better than proprietary programming software.
  • PSKReporter: a few minutes after calling CQ, I can see where in the world I’ve been heard. This automatic reverse-beaconing site is magic, and I’m amazed that a lot of digital users don’t even know it’s there.

My one annoyance about having a Linux-based shack is that ham radio is still very stuck in using serial ports. None of my computers have hard-wired RS232 ports, so I rely on USB serial adapters. These mostly work well, but Linux has a habit of shuffling the allocations around, so what was /dev/ttyUSB0 controlling your rig today might be ttyUSB1 tomorrow. You can get around this (if the software supports it) buy using long serial device names from /dev/serial/by-id/, which don’t change. They don’t change, that is, unless you have two Prolific serial interfaces that don’t have serial numbers set, so I can only have one attached at a time. Annoying.

Categories
amateur radio

confuzzled: fldigi seems to be interfering with itself …

Fldigi used to work fine, but recent updates may have caused me to drop off the face of the (radio) earth. What it seems to be doing — and I don’t find this at all plausible — is causing interference with its own audio stream when its window has focus, but receiving perfectly when the program window is hidden. As Fldigi is a highly interactive program, this is not much use.

Here’s an audio sample showing what I mean: fldigi-psk14070-VA3PID-201206092107z. It’s about 45 seconds long, a sample of the 20m PSK31 band this afternoon, and comprises:

  • 0-15 seconds: fldigi’s window is in focus. None of the traces in the waterfall resolve to meaningful text.
  • 15-30 seconds: I changed focus to another program. The waterfall traces snap into focus; QSOs become readable. The conversation at 2383 Hz goes from line noise to a very clear “…  73 73  Jim and thanks for ans[w]ering the cq …”
  • 30-45 seconds: fldigi’s window is back in focus, and all decoding is cut off.

I’m running fldigi 3.21.43-1~kamal~precise from the Ubuntu Amateur Radio Software Updates repo. Hardware is a Thinkpad R51 (a bit old), latest Ubuntu 12.04 LTS, a FT-857D into a Signalink USB, and the audio’s being handled by PortAudio. I’m stumped!

Update: It was a volume thing. Linux had decided that I didn’t need my main system volume above 10%, so fldigi was picking up noise only.

Categories
computers suck

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Raspberry Pi is in the house.

Categories
amateur radio

JT65 on Ubuntu, finally

I’d been trying to get JT65 to work in Ubuntu for a long time. K1JT’s package is fiddly to set up, and the version in the repositories is ancient. I’d had minor success with the Windows version of JT65-HF under Wine, but it wasn’t very stable, and any attempt to switch programs (something I, Capt. Micro-Attention-Span, do a lot) caused it to crash.

Thankfully, I found W6CQZ’s compiled version for Linux, which installed and ran almost without hitch. What you need to do is make your rig’s audio interface the default sound card, and then JT65-HF should pick up the interface and use it straight off:

That’s gnome-control-center confirming that JT65-HF is using the sound device. You do have to be a bit careful not to send computer audio across the airwaves when you do this, though.

The one good thing that is built into Ubuntu is that you don’t have to worry about clock synch like you do on Windows. Ubuntu pretty much keeps the system clock on perfect time, and Jt65 expects everyone to be synchronized. Doing this on Windows is much harder than it needs to be.

It’s a great mode. This is how I was heard earlier this evening:

They heard me in Australia, on 12W!

Update, 2012-06-17: W6CQZ’s binary won’t run under Ubuntu 12.04 LTS, so I had to bite the bullet and build from source. I grabbed the SVN repository, and followed M1GEO’s instructions Compiling WSPR. It’s still fiddly to choose which audio device (I use Pulse, and can use the same number for both input and output). See, lookit; signals!

 

Categories
computers suck

ColorHug

I got my ColorHug calorimeter the other day. You can’t tell, but this laptop display is a bunch warmer than it was, and there are now colours springing out of what was formerly murk (sproing!).

It’s still very much in beta (and I mean that the way it used to mean), so it works but is a bit fiddly. It currently has to boot from a Linux live CD; there’s no native OS X or Windows support. There’s a very active user group, and issues are being found and squished daily.

Categories
computers suck

Good old PCD0992 …

I found the good old Kodak Photo CD sample images on the site linked through from the photo. Test images for MFSK image radio transmission, here we come!

I got this CD with OS/2 Warp back in early 1995. My machine didn’t like Warp at all; it repeatedly fork-bombed in the file manager, so it was essentially a £40 paperweight. So burned was I with commercial software that I bought a Slackware distro so I could run something more fun that Windows 3.11. I’ve been happily running Linux since then.

Categories
amateur radio

Ham Radio Talk links

The ham radio talk went quite well last week; the usual TLUG (and Perl Mongers) suspects plus a couple of knowledgeable hams. For some reason, LibreOffice didn’t format the links correctly, so here they are as real links:

Categories
amateur radio computers suck

GTALUG: Ham Radio & Linux

I’m talking about radio next week at TLUG. More deets: Meetings:2011-08 – GTALUG.

The slides are here: http://scruss.com/talks/02011/radio/

Categories
computers suck

To view Ubuntu Remote Desktop under OS X …

… you need to set a password — even a trivial one — on the Ubuntu Remote Desktop settings. OS X won’t connect to your remote desktop if you don’t set a password.

That is all.

Categories
computers suck

something went wrong

Something went very wrong when my Thinkpad booted up:

Pretty, though.

Categories
computers suck

awe-inspiring terminal output

sheevaplug terminal outputWell, not really that awe-inspiring. But it does show that the Sheevaplug boots and runs out of the box. Given that it has only 512MB of RAM and the same amount of Flash storage, it’s a fairly small system.

I really want to have this replace my Firefly Media Server installation on the laptop. First, I need to work out how to get it to boot from an external HD.

Categories
computers suck

sheevaplug, I haz it

It arrived!
sheevaplug development kit

Categories
computers suck

the little computer that should

My home server went phut last week. There was a brief power outage, and everything else came back on — except the server. It was a three year old Mini-ITX box, and I’m casting about for ways to replace it.

To serve my immediate music serving and podcasting needs, I have pressed The Only Computer That Runs Windows into service, running Ubuntu using Wubi. Unfortunately, I do still occasionally need to run Garmin Mapsource, which only runs on Windows, and also The Only Computer That Runs Windows is also rather too nice a laptop to be sat doing server duty.

I have some options:

  • Get a new motherboard for the mini-itx box. Via still has some crazy ideas about pricing (over $200 for a fanless C7?) but maybe I’ll go for Intel’s snappily-named D945GCLF, which looks okay for what I need and is only $80.
  • I could resurrect the old Athlon box I got in 2002, but it’s big, loud, and its components are probably near end of life. Also, why disturb a mature spider habitat?

What I was really looking for was one of those tiny fanless internet appliance boxes that were so 2007 (like the Koolu and the Zonbu, both of which have moved on to other things), but such units, without the tied storage service contract, are upwards of $500.

My needs are simple:

  • run Firefly to feed the Soundbridges;
  • generate the automatic podcast every day, which realistically means a linux box with Perl, sqlite and the like;
  • have something to ssh into when boredom strikes the need arises. Perhaps unwise having an open machine sitting directly on the internet, but only the ssh port will be open.

I really also need to get rid of all the computer junk in the basement. It now includes two fritzed mini-ITX systems and the world’s slowest PostScript laser printer. Such fun.

Categories
computers suck Wind Things

AWS OpenWIND

AWS OpenWIND is a free wind farm design tool. It’s from people who know what they’re doing. I’m intrigued.

Categories
goatee-stroking musing, or something

maybe a bit too nerdy


MidpSSH on my Blackberry talking to a screen session on my home server running a bittorrent client (and no, this doesn’t mean that I was torrenting over a mobile network).

Categories
choons computers suck

ripping dvd audio with Ubuntu

With more than a little help from How to Rip DVD audio to mp3 or ogg — Ubuntu Geek, here’s how I’d rip audio from a DVD:
for f in $(seq 1 12)
do
transcode -i /dev/sr1 -x null,dvd -T 1,$f,1 -N 0x1 -y null,wav -m $(printf "%02d" $f).wav
done

Your track count and device name will vary. You’ll note that I caved, and used the annoying $(…) syntax instead of good old-fashioned backticks (which some youngsters will claim are deprecated, but I claim as job security). WordPress munges those badly, so we’re stuck with the ugly.
You could use livemp3 to convert to mp3s (if I remembered to upload the version that handles wav files) under controlled circumstances.

Categories
computers suck

my only gripe with the heron

I’m quite happy with Ubuntu. If a user didn’t have to be tied into specific, Windows-only applications, I’d recommend it. It’s stable, fast, intuitive and pretty.

My one annoyance is what the latest release has done to CD/DVD drive naming. In the past, my machine’s first DVD drive was hda. For no reason whatsoever, Ubuntu decide to call it sr0. Similarly, the drive’s name for command-line tools now has a different specification.So all my applications need to be told where the drives are; a pain.

Maybe I’ve been at this too long – I still like to use applications that I can see what’s running in the background, so I use grip over gstreamer (mainly because, unless you’re using lame, I’m not listening to your mp3s),  cdrdao over (whatever the young kids are using today to burn gapless audio). At the very least, I would have liked to get a summary of changes when I upgraded Ubuntu. Better still, I’d have liked a list of reasons for the changes. Unless my CD/DVD drive is now faster and more secure, why change?

Categories
computers suck

new and improved

Categories
computers suck

like a virtual workspace manager for the shell

How did I manage to go for so long without knowing about screen? screen allows you to create several connection sessions to a terminal, switch between them, detach from them, then reconnect from anywhere. I’d previously had to to set up long-running remote jobs as background jobs, relying on nohup and various methods to prevent terminal output. But no more!

This page taught me all I know about screen: screen: Keep Your Processes Running Despite A Dropped Connection