• It looks to me that you have several levels / scopes of what is awake and powered... Several (nested) intervals - or better: timeouts (made to escape-able intervals with self invocation) - switch on and of different areas of your logger. A state-machine could be used to control the walking through a cycle.

    In an earlier post, @Gordon pointed out that Espruino pins hold their state even when on sleep - don't know about the deep sleep though... but anyway. Therefore, you could give your GPS a heads-up - I man power - and then go to sleep - with a timeout - for another few minutes until actually reading the data. If something is not ready yet, 'snooze' until it is ready with - of course - some retry (snooze) limiting algorithm. After getting a satisfactorily set of data of satisfactorily data quality, you switch the GPS off and do the rest of the work.

    Since you have the last recent GPS data, use it when restarting GPS the next time. A GPS gets much faster on the road when you can tell it something, and the closer you input is to the actual location, the quicker the GPS is catching up.

    Regarding code in your post, data is just a (particular) sentence that the GPS delivered (in object form, and sometimes some of the properties are missing). Checkout the GPS Module, Extensions for handling other sentences, and u-blox NEO-6M GPS receiver conversation about getting out of the GPS you may need to. You can also configure the GPS to do better what you want and let alone what you are not interested in.

About

Avatar for allObjects @allObjects started