Akademisk Radioklubb


Category: Projects (page 1 of 14)

Hamlib driver for Spid MD-01 and MD-02

A release candidate of hamlib 3.2 is out. When released, version 3.2 will be the first to contain our driver for the Spid MD-01 and MD-02 rotator controllers.

At LA1K, we’ve been using a wide range of Spid rotators and rotator controllers for a decade. We’re satisfied enough with them that we bought the MD-01 for our 1-10 GHz project even though there was no driver we could use (it comes with a Windows driver, but we were planning to use it from Linux). Spid has been accommodating with documentation in the past, which is how we’ve been able to write the other Spid drivers in hamlib, so we were optimistic about getting it to work.

The driver implementation was even easier than we thought. We first thought that we’d have to implement a brand new protocol, but it turned out the MD-01 protocol is still just vaporware. The device actually only supports the Spid Rot2Prog (or Rot1Prog) protocol, and we’ve implemented that in hamlib before. After making that discovery, we just turned on the MD-01 and set it up with hamlib rotator model 901 (Rot2Prog). Of course, it failed in fun and exciting ways.

It turned out that, yes, it speaks the Rot2Prog protocol, but not the exact same way that Rot2Prog does. While the original Rot2Prog doesn’t send a response to the set_position command (the command that makes the rotator rotate to a given position), the MD-01 will respond with its current position. Hamlib rotator drivers, at least those we’ve looked at, aren’t very forgiving when it comes to controllers sending more data than hamlib expects. There is no clearing of input buffers at the beginning of a command, so if it gets out of sync, it will disturb communication until you close and reopen the connection. Once we figured out that little quirk and implemented that behavior in the driver, it worked perfectly!

Until it didn’t …

It turned out there was a bug in the MD-01 firmware that made the controller drop commands, rotate the antenna to a different position than we requested, and generally behave in a way that made it completely useless for our purposes. The bug was triggered if commands were sent to the MD-01 too fast. If we staggered the commands, there was no problem. We worked with Spid to resolve that issue, but that is a different story. Suffice it to say, Spid has released a new version of the firmware (1.2507) that contains a bug fix.

MD-01 and MD-02 extend the Rot2Prog protocol with commands to move the rotator clockwise, counterclockwise, up and down without setting a target azimuth or elevation. The hamlib driver also supports these commands, in addition to the go to position, get position and stop commands.

So if you have an MD-01 or MD-02: Upgrade to firmware 1.2507 or greater, upgrade to hamlib 3.2, run rotctl -m 903, lean back and enjoy!

Write-up of the GNU Radio workshop

As previously announced, this weekend we held a workshop in GNU Radio in collaboration with the Department of Electronic Systems at NTNU. The content was divided into three lectures and one practical session. None of the lecture holders are experts in their own right, but we believe the combined best effort result was solid.

LA3WUA Øyvind started out by introducing the course, and gave a talk on Software Defined Radio (SDR), the hardware that enables it, and why SDR programming has become so relevant recently.

LA3WUA demonstrates why it is so complicated.

Next LB6RH Jens gave an overview of what GNU Radio is, and held a live demonstration of block based graphical programming and the use of GNU Radio Companion.

LB6RH draws and explains.

NTNU kindly provided free lunch for all the attendees. After some relaxation and downtime, the attendees got to play around with GNU Radio in the SDR-lab. Each of the computers were set up with GNU Radio live provided on a USB drive, and a USRP.

The practical part consisted of a series of tasks. First the attendees familiarized themselves with GNU Radio Companion and the signal space by receiving a test signal from a signal generator. For the second task the challenge was reception of a FM transmitter set up somewhere in the 2.4 GHz ISM band. The last tasks were oriented towards guided free play, where some went on to receive a DAB+ station and install a DAB+-enabled fork of gr-dab, others went on with their own small projects of receiving APRS or similar, and some attempted to receive one of ARK’s CW beacons or other signals in the surroundings.

LB0OH, LB6RH and LA6YKA hard at work.

Proud GNU Radio Companion user Amund showing off his sliders.

LB0VG is slightly confused over the binary output in his terminal.

Though we could have gone on for a while, we had to stop the practical part of the workshop after the allotted time and continue with the next lecture. Here, LA9SSA Asgeir gave a basic introduction to the relationship between the blocks seen in GNU Radio Companion and the actual implementation of the blocks, the organization of the GNU Radio source code and how custom blocks can be written.

As mentioned, the course contained a large amount of improvisation and live demonstration. The slides themselves do not give the full picture, but the tasks from the practical session are provided here for those who may find use for them. A summary of links for further investigation of block programming is provided below:

Overall, we think we were able to cover quite a bit, with the whole range from the SDR hardware and basic use of GNU Radio to familiarization with the graphical programming part. Having covered the basics, and the participants now being familiar with the flowgraph thinking, we could go on to show the more complex details in block programming. We are also quite satisfied with our development of the practical part, as we sat down on the SDR-lab Saturday morning with a concept of quite different tasks than we ended up with in the document above. Once we started testing our ideas, and adjusted them, we arrived at a solution we think was sensible.

We hope that the participants were satisfied, and can get started with SDR programming in GNU Radio. We also hope that they will now know where to look if they ever want to do more advanced stuff :-).

Older posts