Posts tagged ‘eeepc’

Forcing off the eeePC’s LCD backlight in NetBSD

My NetBSD-powered eeePC 701 webserver is still working just fine. The only downtime I’ve had since I set it up was when I once accidentally partially unplugged its power supply while trying to squeeze one extra plug into the same powerboard. I managed to get it out enough that the eeePC switched over to battery power but not so much that it was obvious at a glance, so I didn’t realise what I’d done until the battery discharged and I stopped being able to check my email. I intend to write a power management script to stop this from happening again. The output of apm on the eeePC is fairly informative:

Battery charge state: high
Battery remaining: 100 percent
A/C adapter state: connected
Power management enabled
Number of batteries: 1

A script that parsed this output ever minute or so and checked for changes in “A/C adapter state” could recognise when the power supply has come unplugged or when there has been a blackout and take appropriate action – probably emailing me a warning and also playing an audible notification through the in-built speakers. The same script could probably also force a graceful shutdown when “Battery remaining” gets to 10%. Once I’ve written this I’ll publish it here.

One thing that I’ve always been a little displeased about is that I haven’t been sure whether or not the screen’s LCD backlight was going out when I closed the lid. This typically requires the OS to be able to talk to the BIOS about the video card and non-mainstream OSes like NetBSD can’t always do this when the BIOS details have stupidly been kept secret by their manufacturer. On some laptops this is easy to check for – on my ThinkPad T42 the switch that gets depressed when you close the lid is clearly visible and you can poke it with your fingernail or a pen to test that the screen really does go out. However, this switch for the eeePC seems to be completely internal so the best you can do is get the lid 95% closed and try to peer in through the resulting gap to see what is happening. As you can imagine, it doesn’t work too well. Anyway, I really wanted the backlight to be off while the lid was closed if possible, since the backlight counts for a surprisingly substantial amount of the power consumed by a laptop, and one of the motivations for switching to the eeePC was to lower the power costs of all my hosting activities.

This recent blog post by Matthew Sporleder, who is also running NetBSD on a 701, explains how he managed to forcibly switch off the backlight but his solution involves having X.org installed (and running!). This seems sort of like overkill for me since I don’t ever plan to use X for anything else on the device. However, a comment on the entry by “jmcneil” suggested that vbetool might be of some help. So I installed that and sure enough running vbetool dpms off forces the backlight off even when the screen is open. Replacing “off” with “on” obviously gets it back on again. This seems like an ideal solution. The only problem I can see is that if I’m ever forced to work on the eeePC using its own screen and keyboard instead of remotely using ssh (for example when I’ve made a stupid change to my network configuration and I can’t get in via ssh) I don’t know how to get the screen back on (aside from very carefully logging in and running the vbetool command while blind!). None of the function buttons along the top of the keyboard for adjusting the screen brightness or toggling between the inbuilt screen and an internal monitor seem to wake it up. Still, this is likely to be such a rarely occurring problem that I think the power savings more than justify the inconvenience.

NetBSD on the eeePC continued

Three consecutive entries on the same topic!

I bought a 4GB SDHC card for my eeePC server a few days ago. I used fdisk, disklabel and newfs to replace the default FAT32 partition on it with a 256MB /var partition (far larger than I am likely to ever need, but storage space is cheap these days and the pain of a full /var is great) and a partition taking up the rest of the space which I’ll use for my websites and web logs, my Postgres databases, etc. I edited /etc/fstab so that these partitions are mounted automatically on boot up and everything seems to just work. There now should be relatively few files on the eee’s SSD which are regularly overwritten. I’m actually quite inexperienced with removable media like SD(HC) and USB sticks and the solid state technology behind them (since I cut my Unix teeth at around the time floppy disks were starting to disappear in favour of CDs). Having now done a little bit of research (to find out, for instance, if my eeePC could read an SDHC as opposed to SD card), I’m not sure of the extent to which the general paranoia about SSD life is warranted – wear levelling technology seems to do a lot to alleviate the issue and is apparently fairly wide spread. At any rate, SD(HC) cards are cheap enough that the extra caution can’t really hurt.

I’ve transferred my HTTP(S) and SMTP services to the eeePC and things seem to be running quite nicely. My old server is still running for the purpose of providing NFS and Samba access to the large collection of multimedia files that I don’t have room for on the eee, but once I buy an external hard drive case I will transfer that over too and retire the old machine. If you notice any problems with web or mail services here in the next few days it’s probably just me ironing out bugs. At any rate, all of the most complicated and critical work in this project is pretty much wrapped up and I’m really happy with how smoothly it went.

For now my main concern is where abouts I’m going to put the thing! I’d rather not keep it on the floor under my desk like my previous server, because obviously it’s a lot less physically sturdy and I’d hate to accidentally step on it. I’m not too fond of the idea of putting it on my desk, either, because it would take up space which is at a serious premium, and also puts the machine at risk of having coffee spilt on it or the like. I’d really like to be able to keep it in a desk drawer – out of sight and out of mind. I could drill a hole in the back panel of the drawer large enough to feed the power cable and ethernet connection through. My only concern with this is whether or not there would be sufficient ventilation to keep the thing running at a safe temperature. I’m already a little bit nervous about running the eee with the lid permanently closed, especially since ordinarily the keyboard acts as a heatsink (see, e.g., step 5 of this disassembly guide). Other eeePC users have asked about this very issue before and the consensus seems to be that there isn’t much of a problem with doing it, but I have to assume that most people who claim to have done it without problems weren’t also keeping the thing stuck in a drawer. I could always drill a whole bunch of ventilation holes in the back of the drawer, or even remove the back panel entirely, I guess. I’ve also thought that I could stick one of those novelty USB fans in there with it to improve the airflow over the machine and out the holes at the back, but I’ve never actually seen one of those fans in real life so I’m not sure how much noise they make. If it’s a lot, they could be a really annoying solution.

NetBSD on the eeePC

Following on from my last entry, I have gone ahead and installed the very recently released NetBSD 5.0 Release Candidate 1 on my eeePC 701. I installed it from a USB stick as planned, by following this guide. Things went pretty much without incident. About the only think which temporarily stumped is that in order to boot the eeePC from a USB device, you need to press Escape during the initial loading screen – there’s nothing written on that screen to indicate this, and in fact the screen instructs you to press one of the F buttons to get a “boot menu”, which actually doesn’t have a USB option in it. I thought this was a bit counterintuitive.

After the install, the onboard ethernet device didn’t seem to be working – the kernel detected it without any issue but when I plugged it into my router the indicator light didn’t come on and I couldn’t get a DHCP lease. This thread at the overclockers.com.au forums suggests that this is a common problem on the eee after changing the OS. I’ve no idea how this supposed causal relation could actually exist, but nevertheless I disconnected the power and battery as suggested and ethernet worked just fine. The wireless device is detected but rejected by the default driver. There’s supposedly a patch that fixes this, but I haven’t tried it yet.

My biggest concern about setting the eee up as a NetBSD server is the fact that it has a solid state hard drive which has a finite life-span – according to some, around 100,000 reads/writes per block. Thus, to maximise the life of the machine, it is important to decrease the amount of repetitive writing that goes on. I have taken a few steps to facilitate this, for instance I have set the machine up with no swap space and mounted all my filesystems with the noatime option – this prevents updating of the “last accessed” timestamp every time a file is read. However, the issue of logging still remains to be dealt with. The /var/log directory is full of files which are written to constantly during the machine’s operation, and the HTTP logs for my website will be in much the same category. I think that before I actually deploy the machine as my new server I’ll invest in a 4GB or 8GB micro SD card and partition it in two – a small /var partition for all machine related logging and a larger /srv partition that will hold my website and the accompanying logs, as well as the PostgreSQL database for my weather data project.

The other issue that I need to resolve before I completely replace my current big, heavy, noisy, power-hungry server by the almost invisible eee is file storage. In addition to acting as a web and mail server, the current machine has a 200GB hard drive in it which contains my music, videos and other such files, which are NFS exported to my home network so that I can access them from any of my other machines. The eeePC’s solid state hard drive is only 4GB big, which is of course too small for this job, and of course I can’t physically install an IDE drive or the like inside it to get more space because the machine is tiny. If money were no object I could buy something like Western Digital’s Passport portable hard drives, which are quite large in terms of capacity, quite small in terms of physical size and powered entirely by the USB connection. More likely I will end up buying an external case with a USB connection for the IDE drive in the current machine. This will be a lot cheaper, but unfortunately it will consume an extra power outlet and a bit more space.

I’m feeling optimistic about this project for now.

Repurposing the eeePC as a power-efficient webserver

Lately I have been giving a lot of thought to repurposing my eeePC and using it as a replacement for the old desktop machine which I currently use as a server for this website, my email and a private fileserver for my home. The current machine is an old Compaq Deskpro that I bought for the purpose on eBay, mostly on account of its relatively low form factor (it’s perhaps 10cm tall, 30cm wide and 40cm deep) and power consumption.

Of course, the eeePC leaves this thing for dead when it comes to form factor and power consumption. It could comfortably sit in a desk draw, freeing up space under my desk, and it consumes at most a mere 21 Watts, saving me money on electricity and also cutting down on the amount of heat that accumulates in the room its in, which is full of computers. Not only do I get these savings, but – in an astonishing testament to the power of miniaturisation – the eeePC actually has a faster processor and more RAM, so I’d get a performance increase as well.

Another persuasive factor is that, by virtue of having a battery in it, the eeePC has a kind of primitive built-in UPS. It won’t immediately power down during a blackout like my current machine would. In some sense this is a moot point – if the power goes out then my cable modem and router are going to go out with it and so having my actual server still running would not be of much use. I can still see some benefit in it, though: if I’m out of the house between 9 and 5 and the power goes off for 10 minutes at 10 o’clock, then with my eeePC running the show my server downtime will be 10 minutes, since when the modem and router come back on the server will be ready and waiting. With the batteryless desktop machine, the downtime would the 7 hours that the machine sits there waiting for somebody to physically turn it on again. That’s a significant difference!

Finally, like everyone I occasionally make a stupid accidental change to my server’s network settings while fiddilng with it over ssh. This change kills my ssh session immediately so in order to do it I need to locate a spare monitor and keyboard and crawl under my desk to fix it. It’s a real pain. With an eeePC server I could just scoop the thing up, drop it in my lap, open it and go.

About the only downside that I can come up with to this plan is that it means no longer having my eeePC as an all-purpose portable unit. I’m not sure how big of a loss this is. For all my initial excitement, I have to admit that I’ve not been a particularly big user of the thing. Most of my time is spent at home or at university, and I have desktop computers at both of those places which are more powerful than the eeePC. I also own an IBM Thinkpad which is not all that less convenient to carry around than the eeePC (although I didn’t have this machine at the time I acquired the eee). The idea of putting a USB GPS device in the eee and writing some sort of clever spatially-aware software still intrigues me, but I can only see it being of real use for someone who does a lot of moving about in interesting areas, like orienteering or caving (would GPS receivers get signal in a cave?). All I tend to do is catch buses into the city and back. Even if I was more active, the 701’s battery life is disappointingly short and I doubt it would last the length of a good hiking sessions or bike ride. So I don’t see much actual loss in losing the eee as a general machine. Anyway, if I ever do think of an awesome project for one, they’ll probably be so damned cheap by then that it won’t be a hardship to get another one.

I’m not sure when to actually make the transition. I’d like to install NetBSD on it instead of using the kinda gross default Linux distribution. This should be an educational experience, since the eee has no built-in optical drive and I don’t own a USB one. I’ll probably end up installing it from a USB stick as per this guide. The big question is whether or not I wait for NetBSD 5.0 to come out before I do this or to just install 4.0 now and upgrade later…

Asus eeePC goodness

Yesterday my wife and I used the money from our tax returns to each purchase an Asus eeePC. Most geeks reading this will already by familiar with the eeePC, the ultra-portable and ultra-cheap Linux-powered notebook that caused a lot of fuss when it debuted last year for the astonishing price of AU$500. It’s a very appealing unit for Linux/Unix geeks, not just because of its low price tag but also because its a very rare case of a notebook computer where all of the functionality – including the wireless networking, integrated webcam and ACPI features – can be enjoyed on a Linux system right out of the box. I’ve wanted one for a very long time.

I have been excited about the eeePC concept (to be fair, I really mean the “sub-notebook” or “netbook” concept, which is realised or soon to be realised by machines other than the eeePC) ever since I learned of it, because it is a step toward the vision of [ubiquitous computing](http://en.wikipedia.org/wiki/Ubiquitous_computing) and it makes possible a lot of household uses for a PC which are handy but utterly impractical with a desktop PC or full-sized laptop. For example, it has been possible to find databases of recipes on the web for years, but the eeePC, on account of its incredibly small size and mass, makes it practical for the first time to find a recipe and then carry the screen displaying it right into the kitchen. The eeePC eliminates the need to print out or rewrite Google map directions, at least for trips that will be shorter than the battery life, because it is small enough to easily just take in the car with you. Heck, it’s possible that with a USB GPS receiver and a bit of technical skill you could use an eeePC as an improvised in-car navigation system. With a wireless internet connection it can sit on the lounge room coffee table and act as a TV guide or display console game walk-throughs. Furthermore, its cheap enough (with the 7 inch screened version now less than AU$400) that a middle class household can realistically aspire to own 2 or 3 or 4 of them, which can “live” in appropriate parts of the house or car for their respective functions. I believe intuitively that there are a lot more really useful uses for the eeePC than I could think of off the top of my head right here and right now.

I expect my first eeePC project to be a sort of intelligent alarm clock. I have a love/hate relationship with sleep. I hate it in the sense that I’m never ready to go to sleep at the time needed to stay in sync with most of the world’s 24 hour cycle, but I love it in the sense that once I’m sleeping I’m reticent to stop. As such, I don’t fare too well with conventional alarm clocks – that is, those in which snoozing the alarm and deactivating it are equally as easy. I’m liable to deactivate the alarm without any conscious thought and wake up hours later wondering what happened and if I missed anything important in the meeting I was supposed to be in at 10am. An alarm system where I can snooze easily but actual deactivation requires something difficult – say, physically getting out of bed and using my desktop computer to remove a small file which the alarm process on the eeePC periodically checks via HTTP over a wireless network connection. Not only would an eeePC facilitate this sort of alarm deactivation asymmetry, but it gives me much more control over the actual alarm sound thank could otherwise be obtained, and I’m thinking of writing a script which uses Flite (a small, fast, free speech synthesis engine) to read out pertinent things fetched from the web – the day’s weather forecast, perhaps a list of news headlines, or the details of any emails I’ve received while asleep.

If I go ahead with this I’ll make an entry and post the source. I hope that it will be only the first of a number of rewarding eeePC projects, a hope that I am sure will be helped toward fruition by the (seemingly, after 2 days exposure) solid eeeUser site.