Laptops: I close the lid, the GPS turns off. Why?

Posted by: tfabris

Laptops: I close the lid, the GPS turns off. Why? - 22/07/2010 14:17

Before you come up with the obvious answer, please note that I have set the laptops so that they are all configured with the setting "When I close the lid: DO NOTHING" in their power settings.

Okay, in my day to day work I need to do some software testing on laptops which contain embedded GOBI-brand WWAN chipsets. These are nifty little chipsets which contain both a GSM+CDMA cellular modem and a NMEA GPS receiver that outputs on a standard COM port. These laptops are very common and are sold by many different brands, I've got a pile of HP's, Dells, Acers, Panasonics, and Lenovos, and they all use either a Gobi 1000 or a Gobi 2000 chip set for this task.

What this all means is that you can connect these laptops to any cellular carrier and get GPS information, all without any external dongles on the laptop.

However, sometimes I want to do this with the laptop's lid closed. And even though I set the operating system so that the laptops do not go to sleep when I close the lid, the NMEA GPS stream stops dead as soon as I shut the lid. Everything else keeps running as far as I can tell, but the GPS goes poof. (The cellular modem might go poof, too, but I'm not sure about that, and at the moment the GPS is my primary concern.)

I have, on one of the Gobi 2000 laptops, dug into all the power management settings and disabled everything that looked like it might remotely be related. Even things I didn't understand like "USB Selective Suspend" and "Link State Power Management". I went through all the devices in the Device Manager that looked like they might be related (Com ports, network adapters, USB devices, PCI express devices, etc.) and looked for a Power Management tab. For any one that had a Power Management tab, I unchecked the "allow the system to turn off this device to save power" check box. All of that, and still the same behavior.

Anyone know why this happens, and if it can be worked around?
Posted by: tfabris

Re: Laptops: I close the lid, the GPS turns off. Why? - 22/07/2010 14:22

Let me clarify one point that might or might not be important... I'm not certain that the NMEA stream on the COM port actually stops. It's possible that the NMEA stream might continue spitting out strings, but if so, it's strings without valid location+time information, because any applications trying to read the stream stop reporting valid located samples as soon as the lid is closed.
Posted by: andy

Re: Laptops: I close the lid, the GPS turns off. Why? - 22/07/2010 14:24

Maybe the casing around the lid of the laptop simply blocks the GPS signal, though I'd be surprised if the GPS would immediately stop emitting useful data.
Posted by: tfabris

Re: Laptops: I close the lid, the GPS turns off. Why? - 22/07/2010 14:37

Quote:
Maybe the casing around the lid of the laptop simply blocks the GPS signal


That's a good guess which I'd considered, but I'm pretty sure that's not the case. This happens even when the laptop is out in the open air, when it should be able to receive a fix on many satellites even if the lid partially obscures it. In that case I'd expect it to reduce the number of satellites (and have its HDOP go up) rather than a sudden 100 percent POOF GONE.

Also, this happens across models.
Posted by: wfaulk

Re: Laptops: I close the lid, the GPS turns off. Why? - 22/07/2010 14:54

Looked in the BIOS?

Also try opening a serial terminal emulator against the COM port and see what kind of data shows up when the lid is closed.
Posted by: tfabris

Re: Laptops: I close the lid, the GPS turns off. Why? - 22/07/2010 16:23

Both are excellent questions. Answers:

- Can't find anything in the BIOS which controls this.

- NMEA strings continue to spit out on the com port when the lid is closed. It's just that the software doesn't consider the strings to be valid located data points after that happens. Not sure what exactly is failing about the strings; I'm not parsing the strings in detail yet. It could be that the GPS chip simply loses its satellite fix, or it could be that the satellite fix is OK but the timestamps are wacky, or something like that. But it does give me food for investigation.
Posted by: peter

Re: Laptops: I close the lid, the GPS turns off. Why? - 22/07/2010 16:28

When the lid's closed, it sends your GPS information to the NSA instead.

Peter
Posted by: tman

Re: Laptops: I close the lid, the GPS turns off. Why? - 22/07/2010 16:32

What software you using anyway to view the GPS data?

If the GPS continues to output NMEA strings which look valid then I'd assume that the GPS software you're using is detecting the fact the lid is shut.
Posted by: tfabris

Re: Laptops: I close the lid, the GPS turns off. Why? - 22/07/2010 16:45

I'm trying a few different pieces of software, but the critical one is our own software, and it's definitely not got any code in place to detect when the lid is shut.

Although I wonder if it's the Verizon connection manager detecting the lid-shutting, and it's doing something there. I'll mess with that, too, in addition to trying to find other pieces of software that will interpret the NMEA stream a little better for me.
Posted by: wfaulk

Re: Laptops: I close the lid, the GPS turns off. Why? - 22/07/2010 17:33

If I were you, I'd write a little perl script. GPS::NMEA should be available even under Windows.
Posted by: Roger

Re: Laptops: I close the lid, the GPS turns off. Why? - 23/07/2010 04:42

Originally Posted By: tfabris
in addition to trying to find other pieces of software that will interpret the NMEA stream a little better for me.


Maybe, take a look at http://code.google.com/p/snopilot/source/browse/trunk/tests/dump_nmea/nmea_sentence_collector.cpp. I've no idea if it compiles at all, but it might help you figure out whether the sentences are valid or not.
Posted by: pca

Re: Laptops: I close the lid, the GPS turns off. Why? - 23/07/2010 09:01

Hi.

My guess would be that it's simply the lid of the laptop blocking the GPS antenna. The antenna is probably either in the lid somewhere around the sides of the LCD, or knowing the common dimensions of a GPS patch antenna, more likely under the laptop keyboard surround. The metal EMC shielding in the lid, never mind the LCD panel itself, will be more than enough to completely block the GPS signals, which are extremely weak compared to either cellular signals or WiFi.

If you can get the thing to output the $GPGGA sentence, look at the sixth field and it will immediately tell you whether this is the problem. It is most likely giving 0 in this field, indicating no fix. It should be 1 (GPS) or 2 (DGPS) when the fix is valid. You could also test this by finding the mechanism which detects the closure status of the lid and overriding it so the machine thinks the lid is closed when it isn't. There is usually a small switch somewhere, either on the hinges or in the latch mechanism. A toothpick should suffice as a debugging tool.

If the lid closure is triggering a shutdown in some way, defeating the switch should provoke it with the lid open. If it still works, there's your problem.

This is a good reference for NMEA sentences. I've done quite a lot of work with GPS systems over the years, and parsing the data is pretty easy. But actually receiving a signal can sometimes be an issue wink Modern chipsets are absurdly sensitive, but there are limits.

pca
Posted by: tfabris

Re: Laptops: I close the lid, the GPS turns off. Why? - 23/07/2010 14:27

Thanks, Patrick!

Yes, I can look at sixth field of the GPGGA sentence, it's very clear, you're right, so I'm going to do some testing and look at that more closely right now.

I'm also going to look at the number of satellites in the fix. I followed the link to the reference you cited, which shows that. I'd like to know whether, if I'm slowly closing the lid, if the number of satellites goes down slowly as the reception gets worse and worse. That will prove if it's simply the lid blocking the antenna. If it goes suddenly from 8 satellites to zero, then that's probably an indication that it's some kind of an on/off trigger.

Posted by: tfabris

Re: Laptops: I close the lid, the GPS turns off. Why? - 23/07/2010 14:33

Interesting. You'd think that GPGSV would show the number of satellites in view. Actually I think it shows the number of satellites expected to be in view above the horizon based on the almanac data. I'm getting a full set of 16 satellites in GPGSV when I'm inside a big faraday cage of a building. Yet GPGSA shows no satellite fixes.

The trick is that I look at the GPGSA string and if it's a bunch of blank fields (lots of commas), that means no satellites used in the fix. If I see a lot of satellite IDs in the GPGSA string then that's how many satellites are in the fix. So that's how I can count them. I'm going to try that now. :-)
Posted by: tfabris

Re: Laptops: I close the lid, the GPS turns off. Why? - 23/07/2010 16:21

Okay, it's starting to look like it truly is just a reception issue. Closing the lid makes the number of signal-locked satellites drop, but not disappear completely.

The reason it acted like an "off switch" is because our software (and many others) will reject out-of-hand any samples with a high enough DOP. Closing the laptop lid reduced GPS reception so much that all samples immediately stopped passing the DOP bar.
Posted by: Redrum

Re: Laptops: I close the lid, the GPS turns off. Why? - 23/07/2010 18:20

Sorry to hijack your post a bit but when I got my new laptop I noticed it has GPS as well.

I’ve been trying to figure out a fun application to take advantage of the GPS.

Do you have any recommendations?
Posted by: tfabris

Re: Laptops: I close the lid, the GPS turns off. Why? - 23/07/2010 18:36

Google earth and google maps support built in GPS. There are also nav apps. I don't have much that's "fun" that I know of...
Posted by: Redrum

Re: Laptops: I close the lid, the GPS turns off. Why? - 23/07/2010 18:52

By “fun” I guess I mean different or entertaining. I have a conversional GPS that does the standard stuff. I guess I’m just wondering if there are any applications that take advantage of the fact a PC is connected to the GPS rather than a handheld device.

So I’m just fishing.
Posted by: canuckInOR

Re: Laptops: I close the lid, the GPS turns off. Why? - 23/07/2010 20:10

Originally Posted By: Redrum
Sorry to hijack your post a bit but when I got my new laptop I noticed it has GPS as well.

I’ve been trying to figure out a fun application to take advantage of the GPS.

Do you have any recommendations?

If you have a digital camera that can shoot tethered to a laptop, you might be able to use the laptop to geotag the photos, rather than getting the camera vendor-approved gps unit, if such a thing even exists for that camera model, or doing it manually.
Posted by: gbeer

Re: Laptops: I close the lid, the GPS turns off. Why? - 23/07/2010 22:31

Simple:

Get magnet
find switch
With lid open, trigger switch.

Did the stream stop?

if yes, open laptop and
either
remove magnet
or
physically disable switch.
Posted by: siberia37

Re: Laptops: I close the lid, the GPS turns off. Why? - 26/07/2010 12:48

Time to get a Bluetooth or USB GPS. Easy $30 solution. Assuming your laptop doesn't turn off USB/Bluetooth when closed it should work.
Posted by: andy

Re: Laptops: I close the lid, the GPS turns off. Why? - 26/07/2010 12:55

Only if the lid switch is activated by a reed switch, some are operated by the lid catch.
Posted by: wfaulk

Re: Laptops: I close the lid, the GPS turns off. Why? - 26/07/2010 13:13

Some have a small button pressed by a protrusion on the lid. These are usually near the hinge.
Posted by: tfabris

Re: Laptops: I close the lid, the GPS turns off. Why? - 26/07/2010 16:32

Originally Posted By: siberia37
Time to get a Bluetooth or USB GPS. Easy $30 solution. Assuming your laptop doesn't turn off USB/Bluetooth when closed it should work.


Yup. We've got boxfuls of Bluetooth and USB gps units from every possible brand. We're testing those, too. Yes, I'm aware that they don't lose their signal when I close the laptop's lid. My conundrum was specific to the embedded GPS situation, since I need to work on both cases: Embedded *and* external.