Aha - cracked it. In order for this to work, the PowerOff GPS has to be part of the promise chain otherwise the GPS will be powered off before any of the setup functions get called.
This log shows that the GPS was getting powered off before the config functions had been called.
function setupPSMOO() {
log_debug("setupGPS() PSMOO");
Promise.resolve().then(function() {
UBX_CFG_RESET();
return delay(100);
}).then(function() {
UBX_CFG_PM2(settings.update, settings.search);
return delay(20);
}).then(function() {
UBX_CFG_RXM();
return delay(20);
}).then(function() {
UBX_CFG_SAVE();
return delay(20);
}).then(function() {
log_debug("Powering GPS Off");
/*
* must be part of the promise chain to ensure that
* setup does not return and powerOff before config functions
* have run
*
*/
Bangle.setGPSPower(0);
return delay(20);
});
}
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Aha - cracked it. In order for this to work, the PowerOff GPS has to be part of the promise chain otherwise the GPS will be powered off before any of the setup functions get called.
This log shows that the GPS was getting powered off before the config functions had been called.
Now using this code:
I can see everything working properly.
Yeah - getting code ready for pull request. Many thanks for all you help @Gordon.