A return to posting

It’s been an exceptionally long time since my last post. That’s probably a reflection of “real” life getting in the way. It’s been a very busy last couple of years balancing family (especially as children start to have more active lives), work, hobbies and the usual domestic stuff and I reached the stage where sitting at a computer of an evening as well as all day for work was just something I didn’t want to do any more.

However, whilst I’m still as busy as ever I’m going to try to get back into posting again, catching up with what’s been happening over the last couple of years and keeping track of new things too.

Posted in Uncategorized | Leave a comment

Now we know the origin of “Black Friday”

And it’s nothing to do with “the day when shops get out of the red and into the black”. As far as I can see from the news reports of the last two days and recalling the same from last year, it’s actually called “Black Friday” because of the way people behave.

There is nothing I have or could wish to have that I would be willing to put someone else at risk of injury to obtain either at a discount or even full price. I would rather go completely without. To behave in such a way as the news reports say, demonstrating such greed and lack of care for others is not clever or shrewd or decent or reasonable. It’s not even human. People who behave like animals should have no complaint if they end up being treated like them. It disgusts me more deeply than I can express.

Even worse, the Sun newspaper is quoted by the BBC News website today as saying “Packed stores and overflowing tills do wonders for the economy. Ok, the occasional shopper got over-excited. That’s a (substantially-reduced) price worth paying.”

Really? So as long as people get a cheap television, the fact that others are getting punched in the face or ending up in hospital or committing assault isn’t a big deal? What utter scum-sucking bottom-feeder wrote that? Somehow I find it hard to believe that were it one of their nearest and dearest who was the victim in such a situation that they would be writing “Oh, well, as long as someone got a cheap TV, never mind that my granny is in hospital”, for example. I find myself unable to comprehend how sick such a person must be to condone such casual violence.

Whilst we fail to speak out against this behaviour our society is doomed. We won’t have a society. We’ll have a group of greedy, self-serving individuals who don’t give a damn about anyone else, even though those very same people they’re treating so shabbily may well be ones upon whom their very existence depends.

I’m tempted to say “I hope you’re proud of yourselves”, but that’s really just not true. Actually, I hope you rot in Hell at the earliest available opportunity. The Human race has absolutely no place for you.

Posted in Random | Leave a comment

Installing OSX 10.8 on a Mac Mini2,1

I wanted to be able to build and test oaCapture on different OSX releases, but only Snow Leopard and Lion would install on my old Mac Mini.  It would have been very convenient for me if I could also have tried Mountain Lion, but the installer just stopped at boot time with a “not allowed” icon 🙁  There’s no major reason the install shouldn’t work as far as I can find out.  The later versions of OSX don’t have the proper driver for the video card, but for just testing that software would build and run that didn’t bother me too much.

After grubbing around on Google for some time trying to find the right thing to search for, I discovered two useful things:

  1. the OS installation contains a file listing all the hardware that Apple wants the OS to run on, and
  2. it is possible to boot a Mac into what’s called “Target Disk Mode” by pressing the “T” key on the keyboard when it boots.  This makes the machine behave as an external disk connected by FireWire (or Thunderbolt, presumably).

The file listing the “compatible” hardware is /System/Library/CoreServices/PlatformSupport.plist.  It contains lists of the board ids and hardware types allowed.  Hardware type in my case was fairly obvious as “macmini2,1”, but the board id was more troublesome until I discovered that this command, run in a terminal window, would give it to me:

ioreg -l | grep board-id | cut -d\" -f4

So, I noted that down and dug out a FireWire cable, connected the Mini up to another (later model) Mac, powered on the Mini (holding the T key down) and waited.  Shortly it displayed a large bouncing FireWire symbol on the console, at which point I put in the install media for Mountain Lion and booted the second machine.  From that point on everything worked as a normal installation.  I just had to select the FireWire disk as the place to install the OS, which the installer was quite happy to do.

Finally I opened a terminal window, edited /System/Library/CoreServices/PlatformSupport.plist and added my board id at the end of the “SupportedBoardIds” section and “macmini2,1” at the end of the “SupportedModelProperties” section. Then I shut down the newer Mac, powered off the Mini (in that order), unplugged the FireWire cable and rebooted the Mini, which happily started in Mountain Lion. The display was a bit ugly given the lack of a suitable driver, but I decided I could probably live with that.

By sheer chance however I happened to come across a set of rebuilt 64-bit GMA950 drivers that were claimed to work with Mountain Lion, packaged up as “3624-Kexts GMA950_X86_64.zip”. I downloaded them and in the knowledge that I could now re-install the OS should anything go horribly wrong, unzipped the file and dropped the Kext files, the bundles and plugins into the /System/Library/Extensions. One more reboot and I had a properly functioning display as well.

Now it’s done I don’t use the OS for much other than testing or checking out bugs, but for that purpose it’s been exceptionally useful.

Posted in Computing | Leave a comment

Trouble never comes alone

Just as I thought I had a temporary resolution to the previous problem with oaCapture, another one gets thrown in my face 🙁

Inclusion of the cfitsio library causes binary portability problems left, right and centre because the libraries have slightly different versions on systems that are otherwise happy to run the same binary.

I think my fix for this is just going to be to reconfigure the build scripts to ignore the FITS library unless it’s forced on the command line or the build is on OSX.  For the time being, binary distributions will just have to do without FITS.  I’ll fix it when I get around to producing proper .deb and .rpm files for each environment.

Posted in Astronomy, Computing, Linux | Tagged | Leave a comment

Just when the finishing post is in sight…

I thought I was going to be able to finish off everything for the new release of oaCapture today, but just at the last moment I’ve found a problem with the support for the Starlight Xpress filter wheel.

I’ve written support for the wheel using libusb although in actual fact the device claims to be a HID.  It all works on Linux, but on OSX the kernel forces a driver to load for HIDs and they can’t be detached via libusb.  So, the driver won’t work.

Looks like the solution is going to be to re-write the driver using a HID interface.  But not for this release I think.  I’ll put it on the list for the next one.

Posted in Astro Equipment, Astronomy, Computing, Linux | Tagged | Leave a comment

The joy of supporting filter wheels

I’m working on support for filter wheels for oaCapture at the moment.  I’ve had a few hardware niggles that I’ll document separately, but just getting the code right is proving something of a struggle.  Every time I make a change somewhere I think of some knock-on effect somewhere else that needs handling.  The multiple layers of indirection from a list of possible filters to their possible inclusion in a filter wheel and in what position and then the selection of those filters as part of a capture sequence is a bit mind-bending to say the least…

I hope I’m now most of the way through it.  I do have (largely untested) code that will run sequences of captures selecting filters in turn from a list between each, so now I need to test it and do some of the remaining tidying up though I think some of the advanced stuff can wait for another release.

On the subject of releases, I did want to make this release available with a full build system for making .rpm and .deb files, but I don’t think that’s going to happen as I’d really like to get something out some time around the end of the month.  Even whilst I’ve been writing this piece I’ve thought of one more item for “future development” and another to be done before the release goes out.

Posted in Astro Equipment, Computing | Tagged | Leave a comment

Astro EQ conversion of EQ3-2 (part 5)

Once the RA motor mounting was sorted I started on the DEC bracket which is somewhat simpler, being made from a section of 4mm thick aluminium angle. Again there’s only one bolt for fixing to the mount, so the bracket is wide enough that it can’t rotate about the fixing. The hole for the bolt (lower left in the image below) was drilled and threaded for an M5 screw which fits through the slotted motor mounting lug on the EQ3-2 saddle.

astro-eq-04

 

The remaining holes on the left are for the RJ11 socket, and those on the right obviously for the motor itself.  Here it is fitted together:

astro-eq-05

And finally, all the bits and pieces fitted to the mount body and connected up to the worm drives.

astro-eq-06

Posted in Astro Equipment, Astronomy, Projects | Tagged , | 1 Comment

Still Life in Green and Black

green-black

35mm, 27mm, 24mm and 19mm Tele Vue Panoptics, currently the physically largest eyepieces I have, next to a 5mm Baader Genuine Ortho. And something Green and Black for scale…

Posted in Astro Equipment, Astronomy | Tagged | Leave a comment

Separated at birth?

I’ve just watched the Horizon programme from a week or so back — “Is your brain male or female?” presented by Michael Moseley and Alice Roberts. My enjoyment of it was somewhat curtailed however because of Alice Roberts’ uncanny similarity in appearance, mannerisms and speech patterns to Victoria Coren-Mitchell. I have absolutely no objection to either of them. Quite the opposite in fact: it’s always a pleasure to hear or read what they have to say, but it’s quite odd when your brain keeps telling you it’s the wrong person.

poker-facebone-head

Posted in Random | 5 Comments

libudev to the rescue!

Well, on Linux at least, for the moment…

Some time ago when I was writing part of oaCapture I wanted to be able to tell whether the currently connected camera was a Philips SPC900. Ideally, given that I knew, say, that I was communicating via /dev/video0 I wanted to be able to find out what USB vendor id and product id were associated with the USB device (if any) connected to to /dev/video0 and see if they were the values for the SPC900.

I couldn’t work out how to do that, so in the end I opted for an ugly “solution” where I found the name of the camera and compared it with a suitable string. Clearly that’s not great because the string may well not be exactly identical in all versions of the camera and/or firmware.

I’ve now got to the point where I’m trying to add filter wheel support. I have a Xagyl FW5125 USB filter wheel and I found myself in a similar, but even more awkward, position. I know the filter wheel will show up on Linux as /dev/ttyUSBn where n will depend on how many other USB serial devices there are on the system and in what order they were initialised. I also know the VID/PID and serial number for the filter wheel. The question is, given one, how do I find the other to see if I have the right device and not some other USB serial hardware with an FTDI (as that’s what it uses) chipset?

The force was strong in me this time however and I discovered some information on libudev which can traverse the Linux sysfs filesystem and drag all sorts of useful data back out of it. In this case for me it meant that I could look at all the serial/tty devices, find which of them were on a USB bus and then look at the vendor id, product id and serial number to see if I had the right one, and find the device name under /dev used to communicate with it. Everything I could have wanted, and more!

The code looks something like this:

{
  struct udev* udev;
  struct udev_enumerate* enumerate;
  struct udev_list_entry* devices;
  struct udev_list_entry* dev_list_entry;
  struct udev_device* dev;
  const char* serialNo;
  const char* path;
  const char* deviceNode;
  const char* vid;
  const char* pid;

  if (!( udev = udev_new())) {
    fprintf ( stderr, "can't get connection to udev\n" );
    return -1;
  }

  enumerate = udev_enumerate_new ( udev );
  udev_enumerate_add_match_subsystem ( enumerate, "tty" );
  udev_enumerate_scan_devices ( enumerate );
  devices = udev_enumerate_get_list_entry ( enumerate );
  udev_list_entry_foreach ( dev_list_entry, devices ) {

    path = udev_list_entry_get_name ( dev_list_entry );
    dev = udev_device_new_from_syspath ( udev, path );
    deviceNode = udev_device_get_devnode ( dev );

    if (( dev = udev_device_get_parent_with_subsystem_devtype ( dev, "usb",
        "usb_device" ))) {
      vid = udev_device_get_sysattr_value ( dev, "idVendor" );
      pid = udev_device_get_sysattr_value ( dev, "idProduct" );
      if ( !strcmp ( "0403", vid ) && !strcmp ( "6001", pid )) {
        serialNo = udev_device_get_sysattr_value ( dev, "serial" );
        if ( !strcmp ( serialNo, "A4008T44" )) {
          // I have my filter wheel...
        }
      }
    }
    udev_device_unref ( dev );
  }
  udev_enumerate_unref ( enumerate );
  udev_unref ( udev );

  return 0;
}

At the time the filter wheel is identifed, deviceNode contains the path of the character device required to communicate with it (eg. /dev/ttyUSB1).

Now I just have to work out how I’m going to do that on OSX 🙂

Posted in Astronomy, Computing, Linux | Tagged , | 1 Comment