How often to call AssetTracker updateGPS()

Do I really need to call this every LOOP cycle, or is just when I want GPS data sufficient?

I’m concerned that continually calling updateGPS() may consume battery energy fasterOr,
Or, that hammering the GPS device may increase the risk of bad data from it.

@douglaskbell, you are not “hammering” the device! In fact, it’s the other way around - the GPS unit is putting out a continuous stream of serial data which the Electron is reading and interpreting. If you don’t want to read the GPS data all the time then you can stop calling updateGPS() and/or disable the GPS unit altogether (using pin D6 I believe). :wink:

1 Like

Thanks.

Does updateGPS() do anything that consumes more processor power, compared with LOOP just ‘watching’ millis() and only processing GPS every few seconds instead?

@douglaskbell, to capture data from the GPS, updateGPS() must always monitor the serial port for incoming characters and parse the data looking for correct GPS messages. As such, when you run it, you need to let it run until it parses the message you need. It can’t be a call it every few seconds or it will not be able to capture all serial data and parse messages.

The difference in power consumption between looping and reading the serial buffer is marginal (at the most).
If energy efficience is a concern, go with @peekay123 suggestion to power down the GPS and/or the radio and/or the µC alltogether.

1 Like