[Ovmsdev] How to get a quick and reliable GPS fix
ahebert at gmail.com
Sat Nov 8 04:45:26 HKT 2014
Thanks! That's great info Mark, and I hadn't thought about how much longer
it would take to fix when the GPS is moving in a car. I'm currently trying
out doing the cold reset only when the device is first powered on, and then
no GPS resets after that. So far it seems to work really well for picking
up the GPS fix when the car has been parked for a brief period, but not
after it's been parked for half a day. Since it lost the GPS fix, the
module hasn't picked it up again for a whole day now, and I'm suspecting
that it might need a GPSRST=1 command. If that's true, then my next
investigation will be to figure out *when* it makes sense to use a warm
I have a stationary bench test measuring the time-to-first-fix across
permutations of [cold/warm/no-reset, time-with-GPSPWR-off, SCLK=0/SCLK=2]
between GPS power-cycles. It will take 2~4 weeks to complete because of the
long time delays involved. If there's anything to learn from it, I'll share
Responding to your bullet points:
- Yes, I have added a state to put it into sleep mode. The trigger for
it is that it's awake (AT+SCLK=0) whenever there is CAN activity, which is
basically when the car is on or charging.
- Yes, the SIM908 handles SMS perfectly while in AT+CSCLK=2 mode. It
goes into a low-power state, but automatically comes into normal operation
when it receives an SMS. As long as the firmware responds to the SMS within
a few seconds of receiving it, then the device is still awake to handle the
response. Afterward it goes back into a low-power state when there has been
no RS232 activity for several seconds. The beauty of this is that the
firmware doesn't need to wake it up just to handle an SMS message. When it
is time to finally wake the module for normal operation, the firmware needs
to send some characters (I use "AT\r") on the RS232 line and wait a second
for it to wake up enough to respond to the command: AT+CSCLK=0.
- Here are some current measurements I've taken on the 12V line.
Note 1: I'm not using the TCP connection
Note 2: I'm keeping both LEDs off (each LED adds 7mA to the current draw)
*Normal operation* (AT+CSCLK=0 and AT+CGSPPWR=1): *120mA*
*Normal w/GPS off* (AT+CSCLK=0 and AT+CGPSPWR=0): *56mA*
*Sleep mode *(AT+CSCLK=2 and AT+CGPSPWR=0): *37mA*
- I have all of the above low-power modes working in my code and it
helps to save the battery from going dead. The code is intertwined with
proprietary stuff for my client, so I can't share it right now. My client
is appreciative of the OVMS to build upon, so I'll bring it up with them to
see if I can share part or all of it when the project is finished.
On Wed, Nov 5, 2014 at 5:34 PM, Mark Webb-Johnson <mark at webb-johnson.net>
> I think Michael is correct. GPS cold start is very nasty and assumes
> absolutely no knowledge of where in the world the device is. Warm start
> uses the previously known location. Usually, when GPS units try to do a
> warm start, if they can't get a lock within a few minutes they roll back to
> cold start anyway (which was an issue with an old TomTom unit I had when my
> car was in the garage - if I didn't get out into open skies quickly enough,
> it would timeout and go to cold start). The other issue with cold starts to
> be wary of is that if the vehicle is moving, it will take them dramatically
> longer to get a lock.
> Regarding your work on this:
> - Presumably you have introduced a new NET state for this sleep mode.
> Entering that state puts it into sleep, and then there is some trigger to
> get out of the state (N minutes after park not charging)?
> - From the SIMCOM documentation, in AT+CSCLK=2 mode the GSM is still
> active for SMS reception. Perhaps it could be woken up for N minutes and
> still handle the SMS message in that mode (even if GPRS is not possible)?
> - Have you taken any power consumption readings in this sleep state vs
> normal? It would be interesting to see the results.
> - If you manage to get it working, and see significant power savings,
> it would be good to have this as an option (feature #, or something in
> carbits) in the standard firmware. Perhaps only necessary for some types of
> vehicle (particularly those that have no lock/charge/etc functions). Even
> if the code you wrote is completely different, and not based on OVMS
> firmware, it would be good to see your results and learn from them.
> Regards, Mark.
> On 6 Nov, 2014, at 5:26 am, Arthur Hebert <ahebert at gmail.com> wrote:
> Thanks for the info Christopher and Michael! I'll try it without
> resetting, and see if that helps.
> On Wed, Nov 5, 2014 at 4:20 AM, Michael Balzer <dexter at expeedo.de> wrote:
>> Hi Arthur,
>> the SIM908 hardware design doc says:
>> *Power down mode: The GPS engine will be set into this mode by sending AT
>> command “AT+CGPSPWR=0”. In this mode the internal power supply for GPS will
>> be shutdown, and the current consumption is very low. The last position,
>> current time and ephemeris data will be stored in the GSM host memory.*
>> *User can power on GPS engine by sending AT command “AT+CGPSPWR=1”. *
>> So it seems a GPS reset is not necessary after a software power down /
>> sleep state, I'd first try without.
>> If you find out you need to do a reset, I'd first try to cope with "hot"
>> / "warm". The command manual says:
>> *COLD start mode is recommended For first time reset.*
>> So I think this is normally only needed for the first power up.
>> Am 04.11.2014 um 17:42 schrieb Arthur Hebert:
>> Hi All,
>> Does anyone know the details of how, most reliably and most quickly, to
>> get a location fix from the GPS module after it has been powered up and
>> after it has come out of sleep mode?
>> I have written my own code using the OVMS hardware. To save power, it
>> turns off the GPS power (AT+CGPSPWR=0) and puts the module to sleep
>> (AT+CSCLK=2) while the vehicle is parked (i.e. no CAN bus activity). Once
>> there is CAN activity again, it comes out of sleep mode (AT+CSCLK=0) and
>> turns on the GPS (AT+CGSPPWR=1). Immediately after turning on the GPS
>> power, I also issue one of the GPS reset commands (AT+CGPSRS=0 or
>> The module documentation if vague about when to use the 0 reset or the
>> 1 reset.
>> I know that the GPS module itself isn't made to function while the
>> module is asleep even though the commands may not give an error.
>> I've read that it takes up to 15 minutes to get a fix on most GPS
>> devices. In practice, sometimes I get a fix within a minute every time I
>> start up, and other times I don't get a fix even after hours of trying with
>> either reset option.
>> Any information will be greatly appreciated.
>> OvmsDev mailing listOvmsDev at lists.teslaclub.hkhttp://lists.teslaclub.hk/mailman/listinfo/ovmsdev
>> Michael Balzer * Paradestr. 8 * D-42107 Wuppertal
>> Fon 0202 / 272 2201 * Handy 0176 / 206 989 26
>> OvmsDev mailing list
>> OvmsDev at lists.teslaclub.hk
> OvmsDev mailing list
> OvmsDev at lists.teslaclub.hk
> OvmsDev mailing list
> OvmsDev at lists.teslaclub.hk
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the OvmsDev