• I tried the Barometer app (https://banglejs.com/apps/#barometer ) and get the following error:

    Uncaught Error: Unhandled promise rejection: Error: Cannot read property 'pressure' of undefined

    Digging into it, I found that the app only reads the pressure once and draws, rather than repeatedly updating. On my Bangle.js 2 at least, the first pressure read always returns undefined from the promise, I had a look at the Barometer code in jswrap_bangle.c but I'm not sure which hardware I have or how that C code works really, but it seems something's up with the first read.

    =Promise: {  }
    =Promise: {  }
    { "temperature": 28.54738006591, "pressure": 1031.94320908512, "altitude": -154.48409162262 }

    If I run Bangle.setBarometerPower(1) first then this isn't a problem, but the app isn't doing that.

    Is this expected behaviour for the Bangle.getPressure() function or should I submit a bugfix for the app until the underlying function is fixed?


Avatar for dukky @dukky started