Thursday, 26 November 2009

Hallo from Germany!

I'm in Nurnberg at the SPC/IPC/Drives fair this week! Great weather, great people, great service! Germany is the land of automation - from toilets to bars, there's some level of automation everywhere.

I also like the public toilets - €0.50 to get in (refundable on a purchase from the nearby shops) however the toilets are high-quality 5-star and CLEAN! (Of course with automatic taps, flushers, etc). And some pipe rainforest sounds as well... I'd happily pay 50c to use a clean public toilet in Australia.

Anyway, it's great to see all the manufacturers that I couldn't access in Australia, under one roof (or 10 roofs actually). I've been able to get access to some of the head developers for PLCs and IPCs and ask them detailed questions that Australian distributors have no clue about.

I even bumped into Manfred Werner (not realising it was him until we swapped business cards) because he happened to be standing at the CoDeSys front desk. I was able to ask him about the future of CoDeSys and the integration of a C compiler. Needless to say they're not considering it right now, but the Matlab code generation topic has been raised with them a lot recently, so they're thinking...

Well, the days are short, the weather is a refreshing "cool", and I'm looking forward to the Christmas Market (Christkindlesmarkt) on my only day off. So Guten Tag!

Wednesday, 26 August 2009

Extracting CAB files for Windows Mobile without ActiveSync

I received an old bluetooth GPS that I write about here. To install the software, I simply had a Windows (not mobile) executable. I don't have Windows and ActiveSync installed, so how do I go about getting the contents out of the executable and onto my Windows Mobile phone?

In most cases it's quite easy! Here are some tips:

Try 1: Is a plain CAB alternative offered?

This may seem obvious to some, but check if the software is offered in two forms - as a Windows executable, and a plain CAB file download. Browse around the website or CDs for files ending in .CAB

Try 2: Is it a self-extracting zip file?

This is the easiest form of executable! Zip files can be made "self extracting" by containing both executable code and the embedded zip structure. To find out (from Linux, Unix, BSD etc) just run an incantation of zip that understands dos-based PKZIP archives, such as info-zip. (You may have this version of zip already).

info-zip comes with zipinfo which lists information about zip files. In my case, the TomTom executable is called navupd521.exe
$ zipinfo navupd521.exe
Archive: navupd521.exe 4409856 bytes 5 files
-rw-a-- 2.0 ntf 4762417 b- defN 16-Jan-06 13:17 setup.apk
-rw-a-- 2.0 ntf 81 t- defN 23-Feb-05 23:28 cp.txt
-rwxa-- 2.0 ntf 2498560 b- defN 16-Nov-05 15:49 setup.exe
-rw-a-- 2.0 ntf 0 t- stor 24-Feb-05 11:05 TomTom Update.cid
-rw-a-- 2.0 ntf 22 t- stor 11-Jul-05 08:54 ttn.txt
5 files, 7261080 bytes uncompressed, 4377788 bytes compressed: 39.7%
If you see a list of files, then the executable is understood by zip. But alas! there's no CAB files in here. Unless they're in that setup.exe...
$ unzip navupd521.exe
Archive: navupd521.exe
inflating: setup.apk
inflating: cp.txt
inflating: setup.exe
extracting: TomTom Update.cid
extracting: ttn.txt
$ ls
cp.txt setup.apk TomTom Update.cid
navupd521.exe setup.exe ttn.txt
$ zipinfo setup.exe
[setup.exe]
End-of-central-directory signature not found. Either this file is not
a zipfile, or it constitutes one disk of a multi-part archive. In the
latter case the central directory and zipfile comment will be found on
the last disk(s) of this archive.
zipinfo: cannot find zipfile directory in one of setup.exe or
setup.exe.zip, and cannot find setup.exe.ZIP, period.
And here's the end of the line! The setup.exe file is not a zip archive (even though they sometimes are called setup.exe).

Try 3: Temporary files

Use wine to start the install process, and look for temporary files.

In my case, when I run wine navupd521.exe:
  • While the TomTom installer is complaining that your computer does not support the device blahblah or somesuch rubbish, look for a directory in <>/windows/temp that wasn't there before. If necessary, create an index of all the files in your wine c drive before you run the installer. Then do it again with the installer running, then check for differences. There should be a temporary file or directory somewhere!
  • copy the entire directory (for TomTom that's "<.wine>/drive_c/windows/temp/WZSE0.TMP/") to somewhere safe
  • Exit the installer, and search for CAB files in the directory you just copied.
  • For TomTom you will find:
    WZSE0.TMP/pocketpc/tomtom.cab
    WZSE0.TMP/pocketpc/ttn.cab
    WZSE0.TMP/palmos/navigator.CAB
  • Choose the right CAB file matching your device by name or directory. I'm going with the pocketpc directory for my pocketpc!
Now all that's left is to copy the CAB files to your device using bluetooth, USB, or storage card; then select them in Windows Mobile to start the install.

(This example is for the TomTom Navigator 5 December 2005 update. After installing your original TomTom Navigator, run these CAB files to update to the new version)

And that's how you can get CAB files without Windows!

Tuesday, 25 August 2009

What do do with a bluetooth GPS


I received a bluetooth GPS, by TomTom, which came with TomTom Navigator 5.

It installs on my O2 Windows Mobile 5, it pairs, it works, but there are no maps for Australia. It is, after all, from 2005.

(I've made some notes on extracting and installing CAB files in Linux without ActiveSync, which you might be interested in).

I've searched for map downloads, but as far as I can tell, they're not available for Australia for this version of Navigator. Nor are TeleAtlas maps, which are supposedly compatible.

So the question is: What do I do with this bluetooth GPS? It works fine with my phone, and no doubt would work with my laptop. I don't want Google Maps, because it doesn't give voice guided directions, nor does it allow you to download maps. (You have to be within range of a 3G tower at all times).

I would have liked a voice-guided navigator for my mobile, but I can't find one. Nor do I want to hack or download the latest Tomtom Navigator, or equivalent.

Your suggestions please! The more unusual the better! Duct tape required! Perhaps a GPS-aware back to base alarm for my car? You think of something...

Ideas so far:


  • Download a compatible program and create data for OpenStreetMap. (OpenStreetMap is creating a royalty free and open GPS street map of the world, but they need GPS data). I could permanently mount my GPS and phone in the car, and upload the data from time to time.

    The only problem is Yahoo has provided some free data already which covers most of the city I live in...

  • (Waiting for idea #2)

Wednesday, 12 August 2009

Dell Inspiron 9100 infra red port

My old Dell laptop has a built-in infra red port on the front. In the 4 or more years that I've had it, I've had no need for the port.

Now that it is becoming my (MythTV) media centre, the infra red port becomes useful! Here are the steps I used to get it working. I had some small hassle with the built-in serial port driver taking over.

  1. First, make sure it's enabled in the BIOS, and take note of the serial port it's attached to.

    There are no other serial ports on this laptop, so anything that looks like a serial port is likely to be the infra red port.

  2. I used lirc to receive and configure the port.

    In Gentoo enable the lirc global USE flag (global means put it in make.conf because many programs can make use of it). Also add this line to make.conf:
    LIRC_DEVICES="sir"

    In other distros, you have to somehow build the sir driver.

    Also add the lirc USE flags hardware-carrier and transmitter. You can do this in /etc/make.conf, or better use /etc/portage/package.use, or better still, make package.use a directory, and add the file /etc/portage/package.use/lirc-20090806 with the contents:
    app-misc/lirc hardware-carrier transmitter

    (You can of course make any-named file in /etc/portage/package.use)

  3. (re)compile! This includes lirc, MythTV, mplayer and anything else that might be able to take advantage of your new lirc USE flag.

    In Gentoo, you could use the command:
    emerge --update --newuse --deep world
    to find and rebuild all packages that have changed USE flags.

  4. Now you need to load the lirc module. For com1, run this command:
    modprobe lirc_sir io=0x2f8 irq=3 threshold=5

    options lirc-sir io=0x2f8 irq=3 threshold=5
    Also add this line to remove any conflicts:
    install lirc_sir setserial /dev/ttyS0 uart none; modprobe --ignore-install lirc_sir

    Make sure you run update-modules; then unload and reload the lirc_sir module after any changes to lirc.conf

  5. Test your configuration with mode2. Run mode2 as root and then press buttons on a remote. You should see some output like
    pulse 591
    space 96900
    pulse 9042
    space 2277
    pulse 591
    space 96900
    pulse 9042
    space 2273
    pulse 594
    space 96901
    pulse 9042
    space 2274
    pulse 593


    If not, make sure you've unloaded any serial related module. Check dmesg after loading the lirc module to make sure your hardware is recognised:
    $ dmesg | grep lirc_sir
    lirc_sir: I/O port 0x03e8, IRQ 4.
    lirc_sir: Installed.


  6. You're almost there! Now you can download remote codes from the LIRC website, or make your own with irrecord. I made my own, since my remote wasn't there.

    Copy the remote code file to /etc/lircd.conf

    Leave the /etc/conf.d/lircd blank or all commented out if you have the same hardware

    Start lircd: /etc/init.d/lircd
And that should be that!

Many thanks to: