Posts filed under 'Technical'

Lifescan Ultra USB Meter Driver for 64 bit Windows

If, like me, you use a Lifescan blood glucose meter (I used an Ultra 2), you may want to take advantage of its ability to link to the LifeScan Diabetes Management Software. However, if, also like me, you’re running a 64-bit version of Windows you’ll find the USB driver Lifescan make available doesn’t work.

So, here’s how to make it work.

Get the Prolific 2303 drivers from their website, extract the contents of the zip file and install them using the driver installer program.

Running the OneTouch software it should now be able to find the meter and download the readings, remember to check the instructions as to whether you need to have the meter on or off before plugging it in.

Happy monitoring!

 

July 4th, 2010

Windows Vista – How I cured its insomnia

I have previously mentioned how Windows Vista really wasn’t that scary at all, however I was having one issue that was annoying – it just didn’t want to sleep automatically. It would sleep on demand quite happily, but there was no way I could make it sleep after any decent idle period. So I decided to attempt to figure it out, since no amount of warm milk would solve the problem.

Step 1: Isolate the problem

As there was no difficulty in getting Vista to sleep manually, I assumed there was no problem with sleep per se, rather there was something blocking the idle detection system that was keeping it awake.

The first thing to look at is one of the simplest, by default if you have Media Player sharing enabled, Vista will not go to sleep, on the assumption that other devices may be streaming from your PC. To turn this off, go into Power Options, Edit plan settings, Change advanced power settings and at the bottom make sure that Multimedia settings looks like this:

image

Most of the time that would be enough, but my PC was determined to remain awake. So I soldiered on.

The next thing I looked at was whether a process was intermittently resetting the idle timer: lacking proper tools to check this I tried the most obvious thing – setting the sleep timer in Power options to one minute. This worked – the PC went to sleep quite happily after a minute idle – but is obviously impractical for day to day use. Increasing the time to two minutes didn’t work, it doggedly stayed awake. It was time to get technical.

Step 2: Bring out the gimp toolkit

As a developer I knew there was an API that could be used to stop windows from turning off the display or even sleeping while it was, say, showing a video. You wouldn’t want your PC to shut off midway, so Media Player prevents this. A quick search on MSDN turns up this API call, SetThreadExecutionState that is used to prevent the PC from idling. I needed to track what was calling that roughly every minute that was keeping my poor PC wide eyed.

My first thought was to write something that would hook the SetThreadExecutionState function in kernel32 to allow me to see what was calling it and how often. My second thought was that although this would be interesting to write, someone must have already done this as debugging power options has to be a common enough occurrence. Some more googling turned up a reference to the Windows Device Driver Kit utility Pwrtest which is precisely for this very purpose. The one difficulty is that the WDDK isn’t easily obtainable to the average Joe end user; fortunately I have an MSDN subscription so I downloaded it and started testing.

Step 3: Nailing it down

From an elevated-privilege command prompt, I ran “pwrtest.exe /es” to show execution state changes, and just left it running. This was the result:

image

(click for larger image)

The culprit was the Bluetooth stack, roughly every two minutes it was refreshing its state and resetting Windows’ idle timeout. The simple act of unplugging the cheap Bluetooth USB dongle I use cured the problem, my PC could now go counting sheep quite happily.

All was well in the world and my power bills would be reduced. Rejoice!

Epilogue: Don’t blame the Dongle for everything

Even after supposedly curing the issue, every now and again Vista would again remain awake, even with the Bluetooth dongle unplugged, in a box and buried in the back garden. Pwrtest /es wasn’t showing anything resetting the timer, yet still Vista would stay awake. Fortunately pwrtest has another option, “/info:powerinfo” that shows a snapshot of the Windows data structure SYSTEM_POWER_INFORMATION, which is defined as:

typedef struct _SYSTEM_POWER_INFORMATION {
ULONG MaxIdlenessAllowed;
ULONG Idleness;
ULONG TimeRemaining;
UCHAR CoolingMode; } SYSTEM_POWER_INFORMATION;

The pertinent information fields are Idleness and TimeRemaining, I wrote a little batch file to call “pwrtest /info:powerinfo”, sleep 20 seconds (using the sleep.exe command from the Server 2003 power tools), and loop.

This showed that the time remaining would start dropping for a while (indicating that the system was detecting the idle state) then after a while reset back. It also showed that when it did this the Idleness value was under 80, which is what the field MaxIdlenessAllowed was set to.

Investigating more showed that every time the system went above 20% CPU usage (ie, less than 80% idle), the timeout was reset, preventing the PC from sleeping. This is a lot easier to debug, just bring up Windows Task Manager and see which process is eating all the pies. As it turned out it was Firefox; my habit of having 40+ tabs open, many of which had Flash rubbish running kept pushing things over 20%, even on a quad-core processor.

Changing the MaxIdlenessAllowed value turned out to be a bit of a problem, but thanks to this post on the Microsoft Technet forums the following in an elevated command prompt did the trick:

powercfg -setacvalueindex scheme_current sub_sleep 81cd32e0-7833-44f3-8737-7081f38d1f70 70

powercfg -setactive scheme_current

The long GUID is the id of the ‘balanced’ power plan. This changed the MaxIdlenessAllowed value to 70, down from 80, which doesn’t reset the counter until Windows reaches 30% processor usage, which even with a multitude of flash-laden Firefox tabs didn’t keep the PC awake.

Finally, unless I’m actually doing something intensive enough to keep it awake – when I don’t want it to switch off – Vista is now happily sliding into the land of Nod. With this fixed, the idea of going back to Windows XP holds no appeal in the slightest.

October 5th, 2008

Windows Vista – Not so scary after all

One of the (many) draft blog posts I never got around to posting was entitled “Vista – Not so compelling”. In it I documented how Vista really didn’t offer anything that made me want to upgrade to it; in fact I thought of it as nothing more than a prettier version of XP that used more memory.

I was happy with XP, and I suffer from operating system conservatism, I never upgrade to the latest and greatest versions for the longest time. I continued to use OS/2 for a couple of years after NT4 became available; similarly I ran Windows 2000 Professional for a couple of years after XP was out. Unlike some people I don’t enjoy reinstalling everything every couple of weeks, I tend to accumulate so many programs that reinstallation becomes a real chore.

So what changed my mind?

The primary reason was simple, bit rot. The longer you use Windows, the more applications are added, updated, removed and changed, the more it starts slowing down. It has survived two motherboard upgrades thanks to keeping with nVidia chipsets (their unified drivers really are unified), and so much software had accumulated that the start menu was four columns wide, and I run at a high resolution! I did contemplate simply flattening XP and reinstalling it, but it didn’t help with my other reasons.

Reason two: I needed more memory. I’m what can be called a power user, not only do I develop software, I also play games and edit lots of photographs. All these tasks are improved by adding more memory, even though I had 2Gb installed I wanted to use more, and the limit of 32 bit operating systems is 4Gb, a significant chunk of which can’t be used. I had tried XP64 on a trial basis last year, but the experience wasn’t ideal due to the lack of drivers and software incompatibilities. This left me with only one choice, Vista x64.

So, I performed a full backup (using Acronis True Image Home), replaced the RAM to bring the machine up to 8Gb, inserted the Vista SP1 DVD and installed.

All in all, it was anticlimactic. All the hardware (bar one, a cheap serial card I use for communicating with a UPS), already had drivers or installed after the first Windows Update. I only had one major issue: ironically the nVidia chipset drivers stopped Vista from booting at all – even in safe mode – and I had to resort to booting again off the DVD and recovered from the last system restore point.

I’ve had some software issues, ZoneAlarm isn’t available as a x64 application, with Zone Labs in no hurry to release one, so I use the free Comodo firewall, which does work. Sorry Zone Labs, no more money from me for you! Similarly I couldn’t get Executive Undelete working, but I’m not that bothered so I’ll live without it, Vista does include the Previous Versions system, and the computer is backed up daily using Windows Home Server

The only other problem I was having was getting it to sleep automatically, which turned out to be quite an interesting journey in itself and I will be making a follow-up post on how I solved it.

Beyond that everything has been trouble-free, Photoshop isn’t 64 bit, but it is large memory aware so is happier on the new system, and the new Lightroom 2 is available in a 64 bit variation so I will be upgrading to that shortly. The few DirectX 10 games I have play nicely, and going back to XP without integrated search is a royal pain.

So, ignore the nay-sayers comparing Vista to Windows ME, give it a go, you may actually end up liking it!

Technorati Tags: ,,,

September 20th, 2008

Go virtual to consolidate those servers

For several years I’ve been running Linux-based servers for hosting web sites and email, both for myself and several friends. These have worked remarkably well and served (pardon the pun) me well, but I felt it was time to change.

For my day job I’m writing a fairly large-scale ASP.Net application, and I thought it was time to get a Windows based server, and thanks to a decent offer from my web hosts, ThePlanet, I could get a dual-core Xeon server with a couple of gigs of ram for a reasonable price.

The new machine was considerably more powerful than either older server, which were long in the tooth by current standards, and I thought it was time to move all the sites and emails on the other two servers to the new one, both saving me money (important!) and keeping things nicely under one (virtual) roof.

Most of the existing sites are simple static html pages, which were obviously easy to move; other sites, however, and email were a more difficult proposition.

Firstly, most of the sites rely on PHP / MySQL extensively, the majority of those moved over to PHP on IIS6 without major hassle, with the Windows version of MySQL working happily with minimal changes (there were some hard-coded paths, for example). Ironically enough, this very blog is using WordPress, which can be made to run on IIS, however when I first set it up I created friendly URLs, which use the apache feature mod_rewrite. Unfortunately, IIS6 doesn’t have an equivalent feature, although there are several commercial replacements I didn’t feel like spending more money on a feature for this blog which I used to get for free.

That was problem number one.

Problem number two was the email system. I’ve been happily using postfix for years to handle email and as far as I’m concerned nothing on the Windows side touches it for flexibility and power. I did, briefly, consider trying to get it working using cygwin, but I dismissed that as a really bad idea.

So, I had web sites that wanted a LAMP environment, and an email system that is very much rooted in a unix-like O/S, and I was running windows. When the going gets tough, the tough go get VMWare Server and JeOS.

I’ve been using VMWare Worsktation for years for my day job, it allows me to test applications over multiple operating systems and in later versions easily debug apps in the virtual machines from Visual Studio, so I decided to use their free server virtualisation tech over Microsoft’s own Virtual Server. For the virtual server I chose to create a custom appliance from JeOS, installing Postfix, the LAMP stack, and Dovecot for POP / IMAP access; all installed using apt-get, also used for keeping the system up to date, very simple.

It was given its own IP address from the bank allocated to the server (important to make sure Windows isn’t also bound to that IP, this is effectively another server, remember), configured it to start when the host starts, and everything is ticking away nicely.

The final result is consolidating three servers into one physical and one virtual machine, giving me both ASP.Net development capability with the addition of the ability to continue to run my legacy LAMP based sites. Well worth the effort.

August 2nd, 2008

Rapidswitch, consider yourself dropped

78.129.202.0/24 is now permanently dropped into the bit-bucket, thanks to unrelenting comment spam spewage from this Russian cesspool.

Technorati tags: ,

April 18th, 2008

Windows Home Server – Disaster Recovered

One of the (admittedly) cheap Samsung hard drives in my Home Server decided to start developing bad sectors and making noises like a coffee grinder.

Needless to say, this is not the kind of noise you want to start hearing from a hard drive, especially one in a server.

So, I had to start the process of replacing a hard drive, with real, valuable, data on the one that’s failing.

Due to my stuffing the server to the gills, I didn’t have every shared folder replicated; however non-shared folders contain non-critical data, so any loss will be annoying, but not fatal.

The first step was to remove the drive from the Home Server drive pool:

removingdrive

When it says it may take several hours, believe it. This screenshot was taken about two hours into the process of removing the 500Gb drive; it eventually took over ten hours to complete – probably because the disk was damaged. In the end I was one hard drive down, and the server was full.

The next issue was identifying which one of the four identical hard drives, was the one to be replaced. Fortunately an add-in helped here, specifically the Disk Management add-in. It lists the drives in order, so the /Device/HardDisk3 throwing the errors listed in the Event Log is the same as physical disk 3 as listed in the add-in, which in my case was on the SATA4 connection on the motherboard.

Once that drive was replaced, it was simply a case of rebooting and connecting to the WHS console to add the drive.

newdrive

The new drive is listed as a Non Storage Hard Drive. I decided to get one of the lovely Western Digital Green Drives, a 750Gb unit, since I needed additional space (as you can see!) and they run cool and quietly.

newdrive3

Installing the drive was fast, and resulted in my server having some breathing room once more:

newdrive4

One final word of advice, once you do add a drive to a full Home Server, let the storage balancer run for a while, otherwise you won’t be able to copy any files of any size onto it – the first drive’s free space is used to gauge how big a file you can add to the server so the storage manager tries to keep that as free as possible. I don’t expect to be able to put any more large files onto the server until tomorrow, to give it chance to sort itself out.

But, I’ve not lost any files, which is not my normal experience of having a drive failure!

 

February 20th, 2008

Windows Home Server saves my bacon, well, my email

I have previously waxed lyrical about Windows Home Server, but today it finally paid for itself.

I use TheBat! for email, and it has served me well for many years, however when I checked a little-used email account I discovered that all the messages in it had been deleted. Checking the folder in explorer shows that the database file holding the emails had presumably become corrupted and had emptied completely. This was a trifle inconvenient as I really needed the contents of one of the lost emails, urgently.

Thankfully, WHS backs up my PC daily, although I had to go back over a month to find an uncorrupted copy of the messages, but I’m now happily back with a full mailbox on the account, and the important information therein recovered.

I am one very happy camper.

 

Technorati tags:

December 2nd, 2007

Rip off Britain? The software companies think so

Recently, there was a fuss about the pricing of Adobe Photoshop CS3 when compared between the US and UK, the UK price being nearly double the US price, when the currencies were converted. Adobe never really explained themselves to my (or indeed many peoples’) satisfaction. Still, I got CS3 in any case, because I needed it.

When I received an announcement of the release of Diskeeper 2008, I decided to take the plunge and buy a copy. Off I went to the UK Diskeeper store, and the Pro-Premium edition was priced at £95.20, which is $198.89 at the current exchange rate (thank you collapsing Dollar).

Frankly there was no way I was going to pay so much for even this excellent bit of software, so instead I went to the Diskeeper US store, which priced the self-same product at $99.95, which is currently £47.84, a smidgeon above half the UK price, which I bought and am now happily using.

So, save yourself some money by taking advantage of the global economy and buy your software from US online stores in dollars, and reap the benefit of the weak dollar / strong pound & euro.

PS Diskeeper 2008 really is very good and worth buying, just not at double the US price.

Technorati tags: , ,

November 3rd, 2007

Windows Home Server

Although I’ve bemoaned its absence from MSDN, I went ahead and built a Windows Home Server (WHS) box for my home network.

Since it’s going to be running 24/7, it needed to be quiet, frugal on power consumption but still powerful rough to be useful, and have a ton of storage. In the end I plumped for an AMD Sempron 3200 based machine, with four 500Gb Samsung hard drives providing the storage, coming to a total of 1.8Tb once everything had been installed. Even with all that, the server runs on idle of less than 50W, and under 100W when under load. It has built in VGA which consumes less power than a normal add-on card, but since the server runs headless it was only used for installation.

I’m afraid that my previous backup solution, Acronis True Image, has been sat idle ever since because the built-in backup support of WHS totally eclipses it for both convenience and configurability. It runs automatically for all of my PCs on the network, backing them up daily (apart from my laptop, it can’t wake it up and won’t back it up when it’s on battery, which makes sense) without my having to lift a finger. Additionally I can control what is being backed up so that, for example, it doesn’t back up the Steam folder on my main pc, since all the games are available to download at any time and it saves 14Gb going over the network.

Using a RAID-like software mirroring system, folders set for replication are spread across multiple drives so in the event of a disk throwing a shoe and crashing, nothing will be lost. Not to mention it can use external USB storage as part of the pool of drives available to it, making expansion easy.

The remote access features are also useful, for example if I need to access my home pc, using the Asoft Autoexit addon I can connect to my home server over the internet, wake up my home pc using wakeup on lan, then remote desktop to it – pretty slick.

Sod Vista, this is the product that Microsoft have proved they can make really compelling products with.

Technorati tags:

1 comment October 6th, 2007

Windows Home Server – Microsoft screws the (developer) pooch

Frankly, Windows Vista strikes me as just XP with some makeup on and a whole heap o’ DRM technology added. I can dual boot it on my pc but frankly there is no compelling reason for me to use it so far.

Windows Home Server (WHS), however, is an entirely different kettle of fish. This is a product I want, and I want it now. Although in all my uber-geekdom I can easily build a Linux box with most of the functionality offered by WHS the whole package looks slick enough to make me want to use it. As soon as I get around to building a new server for it I’ll be purchasing a copy.

Plus, as a software developer I’ve got several ideas for WHS addins that will be of use to me and potentially other people so I eagerly logged onto MSDN to see if I can download a copy for development purposes, because, you know, you really don’t write code and test it on a production platform. Not there. Oh well, it has only just gone to RTM perhaps they’re taking their time.

Apparently not, for some insane reason they’re not going to put WHS on MSDN. Since there is zero chance I’m going to buy an additional copy for development purposes after Microsoft already have taken lots of money for the MSDN subscription, I guess that my home server addins will simply have to wait until they get it through their corporate heads that as a developer I may want to use my Microsoft Developer Subscription Network subscription to develop software for, arguably, their most interesting new product for several years (much more exciting than Vista, by a long shot).

They tried a similar thing with the Expression products, arguing that developers never write html or do graphics so they don’t need access to them. After a while sanity reigned and I have a hope that this also happens with WHS sooner rather than later.

But I’ve been wrong before…

Technorati tags: , ,

1 comment August 15th, 2007

Previous Posts


Calendar

March 2024
M T W T F S S
 123
45678910
11121314151617
18192021222324
25262728293031

Posts by Month

Posts by Category