Back from FOSDEM

Well, FOSDEM is over and it was fantastic to meet so many people. I would have liked to travel on the Thursday and Monday, but Uni constraints meant I had to do a fly-by visit. Many thanks for Nokia for paying for the hotel and Eurostar, as otherwise I wouldn't have been able to be there.

The OHM talk went well, with lots of constructive feedback and positive comments. Expect more wiki and mailing list stuff in the next few weeks. Although the embedded guys seem to be keen on OHM, some details and problems will need to be ironed out. Expect some fairly animated discussions on the mailing list.

I've also experienced a few people greeting me and thanking me for working on g-p-m. That meant quite a lot to me, as one happy user saying thanks in person overcomes about 50 NEEDINFO bugzilla entries, and makes it all worthwhile. So, whoever you were, thanks.

I have exams fairly soon, I'll really have to reduce the amount of OSS work I am doing…

FOSDEM: Open Hardware Manager

Tomorrow I'm off to FOSDEM. I'm introducing a BOF on Open Hardware Manager in the embedded room on Sunday. OHM is a small open source system daemon which uses HAL and abstracts out common hardware management tasks such controlling heat dissipation and power consumption on embedded devices.

If any embedded people want to find out what all this stuff is about, then please either come to the BOF or buy me a beer in the evening.

Rhodri 4GB Saga 3

Spent some more time hanging out with Rhodri, and answering some of the Ubuntu questions he had.

First, his FAT32 fixed disk was not showing up in the menus, and for quickness I just added an entry in fstab, but wondered why it was not showing up in the menus. In FC6 I know you can just edit the HAL FDI file to enable this, but this didn't work on Edgy.

He had created several 7Gb iso images and put them on his ext3 home. He then tried to copy them to the new FAT32 partition on another disk, but every time Nautilus would crash halfway through.

Of course, FAT32 only supports up to a file size of 4Gb, but we were not told this either by nautilus or by the command line using mv.

This has been reported before, bug #365885 but has had no love yet. What about a new dialog like “You are trying to copy a large file to a partition type that cannot support this. [skip] [skip all] [cancel]” Better wording appreciated.

Bugs like this rarely affect die hard linux fans with all ext3/xfs partitions but probably is hit frequently with people new to Linux and dual booting. Anybody already have a patch for this or do I have to do it?

WPA-PSK, it can't be that hard, right?

So, I spend another few hours with Rhodri today, helping to set up networking with Ubuntu Edgy and a new zd1211 based USB2 networking device. This all should “just work” with the new zd1211rw driver in the kernel. I spent about an hour using my laptop as a wireless->wired bridge which was no mean feat, as NetworkManager didn't do this for me, and the redhat network scripts don't do WPA. After applying the updates everything worked a little better. After about 2 hours of debugging, I came to the conclusion that either the edgy updated kernel does not have the latest zd1211rw code required for WPA, or that the Ubuntu wpa_supplicant was in some way broken. I admitted defeat, and changed the access point to be WEP with MAC filtering and promised I would find the proper solution. So lazyweb, how do you get zd1211rw to work with WPA-PSK? Thanks.

About Rhythmbox

Rhythmbox is a very cool bit of software. I stumbled on the “About” entry for Rhythmbox and got this:

The corresponding gnome-power-manager about window looks like this:

Now, I'm jealous of the Rhythmbox 420×110 logo background. Any artists want to contribute some ideas and designs for something similar for gnome-power-manager? It is a very easy way for people new to GNOME to get your name in the Artwork credits! Email me (richard_at_hughsie_dot_com) if you have some ideas or mockups. Thanks!

Time remaining for funky batteries

Peter Jones, you are a legend:

…use a matrix of previous discharge rate intervals indexed by the charge at the time and the actual average discharge rate during that interval….

I've prototyped this, and wow, it's accurate. I've used floating point least squares regression to find the rate of discharge. This trivially takes into account battery cell configuration and battery chemistry data, and continually 'tweaks' itself with the new data, i.e. getting more accurate in shape as you discharge and charge each time.


Sub-screenshot of my test program

I've still got to work on interpolation of data where the percentage wasn't hit (the start and end for me, but might happen anywhere), but this is not a big problem.

I'm now optimising my code for speed, making a suitable gobjects for the data structures and testing like mad. I hope to have some other battery discharge and charge curves from stuff like OLPC and my nearly completely broken battery iBook.

Before people ask, the graph widget is the one used in gnome-power-statistics, and that screenshot was taken of a custom hacky application that has far too many graphs to fit on one screen.

Calculating how much time we have left… the sequal

So I posted a blog about a software patent. I now know this was a bad thing to do for an open source developer, but naively I thought I should research the problem domain. I now know that open source developers should not look at patents, and pretend they do not exist. A few people have said I should just use the patented 'invention', and let the US users patch it out. I'm not going to do this, as I think it's not the best solution for everyone. The patent itself is only similar to the work I have done, and only touches on some of the ideas I was using. It's not a big loss if I do things another way, the code I had written was only proof-of-concept and had quite a few different ways of calculating the same data. I'm now thinking of using V=IR and P=IV for the basis of my calculations, but I'm not going to do any research just in case somebody has used these formulas before. Don't you just love software patents.

Calculating how much time we have left…

GNOME Power Manager sometimes really gets the time remaining wrong. It doesn't help that the ACPI BIOS sometimes misrepresents the data values, the units, or just gives bogus readings, but we should at least try to be accurate.

So I've been playing with a historical correction-matrix approach, at the moment targeted to the li-ion discharge curve. Initial results are very encouraging, and appear to be much more accurate than relying on the embedded controller data for my dual core laptop and my old iBook. Factoring in battery temperature would likely give an even more accurate answer.

And then I stumbled on this patent.

It appears to patent a method of reading the battery total energy and dividing it by the discharge rate, and then correcting it with a chemistry profile and specific historical correction matrix. Ahh…

This seems fairly obvious calculation to me, and I would hardly call it an invention (it's a formula with method), but I do not want to put a feature into g-p-m that is clearly patented. The patent would also likely explain the lack of documentation available online, and why all of the battery discharge chips are very closed source.

So, where do I go from here? I've not released any code, but I would appreciate your advice about what to do.

Rhodri and Ubuntu

My friend Rhodri called me up the other day mentioning he was having a few problems “with that Linux thing…” and that he knew I might be able to help. He's not a geek in any sense of the word and I thought he was quite happy with Windows XP. I knew he was serious when he showed me the Ubuntu Edgy CD he'd downloaded and said that he'd joined the Ubuntu forums. First problem. His wireless card didn't work. I explained the firmware thing, and I think he understood. We installed the PC with one of my Linux friendly dongles and I let him play. We got the wireless firmware installed but could not connect to his network as there was no NetworkManager. So I used my n800 to download all the NetworkManager and libnl type debs to the internal memory and then installed them with dpkg. After about 15 minutes of me swearing at NetworkManager he also mentioned the access point was MAC filtered. Ahh. One problem down, we entered the new dongle MAC into the web interface and we tried again. It might have been nice for NetworkManager to tell me about the connection problem. Next problem. The network was also set to WPA-PSK, as comes default with SKY broadband (and they don't let you change it). NetworkManager didn't say “WPA-PSK not supported yet” but kept asking him for the WEP password and then silently failing the authentication. So we hit Google on my n800 (which did connect) and were prompted with a tutorial for Edgy which involved wpa_supplicant and lots of command line action. About 5 pages of the stuff. Most of the stuff he didn't even start to understand. I had to leave him to it as it was getting late, but I just thought how embarrassing it was for desktop Linux to be so close and yet so far.