Hack47.Boot Your Car Computer on a Schedule


Hack 47. Boot Your Car Computer on a Schedule

To get your in-car computer to do work when the car isn't on, you'll need to get it booting on a schedule.

OnStar, a service that comes preinstalled with certain U.S. vehicles, allows you to call a live person over a hands-free cellular connection to obtain a variety of concierge services, such as reservations, directions, and roadside assistance. One of the features of the OnStar computer is that, if you get locked out of your car, you can call them, and within 10 minutes they can unlock your car by sending a code to your OnStar system. You have to wait 10 minutes because this is how often the OnStar computer turns on to "phone home," making itself available to the OnStar mother ship through a cellular network.

"Phone home" is only one of the important features that can be enabled by periodic wakeups. You could configure your in-car computer to take time-lapse photographs of the parking lot with an attached camera, or to pull down traffic information from an online traffic web site (using your web browser's timed web site retrieval) so that it's there when you get in the car before and after work. Or you might want it to sync up every night with a directory on your home computer (using file synchronization software) over a wireless connection, in order to download music, videos, or other data.

4.8.1. Computer BIOS Wakeup

Most computer BIOS settings include the ability to wake up on a schedule. The feature is designed for client/server machines that must perform periodic tasks but may not be powered on when the tasks are due. This is great if you want a computer to turn on at 2 A.M., dial your other office, and perform one or more tasks, or if you want to push software updates to hundreds of machines in the middle of the night.

There are even utilities to set the wakeup time. On Linux, using tools such as NVRAM wakeup (http://sourceforge.net/projects/nvram-wakeup) or Wakeup Clock (http://www.malloc.de/tools/wakeup_clock.html), you can program your computer to wake up every hour (or whenever you need) by using a cron job or scheduled task that shuts down the PC but sets the wakeup time before it goes down.

On Windows, utilities such as PowrClik (http://genntt.webs.com.ua) allow you to set scheduled wakeups and run Visual Basic scripts and command-line programs.

4.8.1.1 Problems with timed wakeup.

The problems with using timed wakeups in a car are twofold. First, each of these wakeups uses a lot of power, even if the computer only wakes up and shuts down within a span of two minutes. While not as taxing as starting your car, these startup/shutdown sequences take their toll on the battery, especially if the vehicle is only driven every few days or on weekends. Second, the car computer requires something called "standby power"that is, the computer must still be plugged into a live source of power for periodic wakeups to function, and this means it is constantly drawing small amounts of power.

The OnStar computer is a small, low-power, embedded computer that takes only as much power as a car alarm. A desktop computer, even when powered off, can draw 10 times that power. In a wall-power setting, this tiny trickle of current is no problem. In a car, however, supplying this 300 mA of current is the equivalent of leaving your dome light onafter a couple of days or a week it can kill the car battery.

4.8.1.2 Using a second battery.

The simplest approach to letting your computer wake up on a schedule is to allocate the power for it. If you install a second deep-cycle battery [Hack #10], there is no risk of killing your main battery. Since a deep-cycle battery doesn't mind being completely discharged, there's no problem if you don't drive for a week and your computer drains it. And because the standby power for a PC (around 300 mA) is much, much lower than the rated output of the battery, you should be able to get weeks of standby power without discharging the battery too muchperfect for scheduling your car PC to record a radio program for you while you're on vacation.

4.8.1.3 Using a startup controller.

Most of the startup/shutdown controllers described in "Start Up and Shut Down Your Car PC" [Hack #43] cut power completely from the car computer when the car is turned off. While this is good for the battery, it essentially precludes the PC from waking up on its own because it has no standby power.

However, the startup controller I like the best, the ITPS (http://www.mini-box.com/itps.htm), can be reprogrammed. Why would you want to do this? Well, when you turn off your car and go into your house or office, you may want your computer to stay on for another 30 minutes so you can copy files to its WiFi connection [Hack #64], for instance. iTuner Networks even provides the source code to the microcontroller they use, a 12-series PIC chip. You can download the source code at http://www.mini-box.com/ITPS/itps3.zip and reprogram it to suit your needs. You'll need a PIC chip writer, but these can be purchased for under $50 (Google "PIC programmer").

Using the ITPS, my own company, CarBot (http://www.carbotpc.com), has tried to solve the problem of starting car computers on a schedule. At CarBot, we wanted a way to have a car computer start up every couple of hours so we could periodically check email and download of new versions of the software.

We also wanted the computer, not the ITPS, to be in charge of when to shut down. Ordinarily, the ITPS has two wires, both of which connect to the power switch on the computer. Since we use a 10uF capacitor across the power switch to automatically start up the computer when power is applied. [Hack #43], we decided to repurpose the two pins on the ITPS (both of which go directly to pins on the 12-series PIC chip). You can get the source code for our PIC modification at http://www.oreilly.com/catalog/carpchks.

We use one of the pins for output, and one for input. The output pin is wired directly to the carrier detect pin (pin 1) of the onboard COM2, and the status of the ACC line (whether the car's ignition is on) is sent to the computer. That way, when the car is turned off, the computer knows about itbut then it's up to the computer to determine how long to stay on. The input pin is wired to a 5V line on the motherboard audio header. This allows the ITPS to monitor when the computer is on. When the computer finally turns off, the ITPS then cuts the power to the motherboard. This drops the power consumption from the 1.52A that a normal EPIA-M board takes when running with a laptop hard drive, or 300 mA when turned off, down to the 1030 mA trickle of current that the ITPS consumes. The ITPS then continues to wait until the car turns on again, and when the power comes back, the motherboard starts up again.



    Car PC Hacks
    Car PC Hacks
    ISBN: 0596008716
    EAN: 2147483647
    Year: 2005
    Pages: 131

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net