Bangle.js 2 Barometer Returns undefined on first read #4047
Replies: 1 comment
-
Posted at 2022-02-11 by dukky Also there seems to be something up with the altitude reading as I'm not underground! Is there any way to calibrate that altitude value to a known value/from GPS? Posted at 2022-02-11 by myownself Aah, I wondered why the barometer app didn't draw hands for me. The pressure sensor isn't calibrated and there isn't way to calibrate it yet, but it wouldn't be a one off thing anyway. There are some interesting summaries about accuracy of GPS vs. Pressure altitude on gliding/flying websites. Posted at 2022-02-11 by @gfwilliams Is your firmware definitely on 2v12 or later? Posted at 2022-02-11 by myownself I am definitely on 2v12. I can't say for certain that my issue is the same as @dukky described though, I haven't checked. It could just be that my barometer is returning a value out of the range for the app. Posted at 2022-02-11 by dukky @gfwilliams my firmware is 2v12, on a BangleJS 2 I bought about a week ago Attachments: Posted at 2022-02-11 by cdohb The barometer app doesn't show any value on my Bangle.js 2 (2v12) either. Posted at 2022-02-11 by nicoboss on mine it seems ok Attachments: Posted at 2022-02-11 by user140377 Same problem here. The next reading is ok. Posted at 2022-02-11 by HilmarSt first wrong reading "702", next correct reading "1013". A ticket was created: Posted at 2022-02-11 by myownself Can confirm that the first reading of getPressure() results in undefined, subsequent readings are fine. I've tested with a Kickstarter Bangle 2 and a newer Bangle 2 and this problem only occurs with the newer one. Presumably related to the different sensor? Posted at 2022-02-14 by @gfwilliams I've just updated the app to at resample if the first reading is undefined (which at least works around the firmware issue for now). But maybe it should actually just update itself all the time? You could then leave it on and see things changing |
Beta Was this translation helpful? Give feedback.
-
Posted at 2022-02-11 by dukky
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 injswrap_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.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?Beta Was this translation helpful? Give feedback.
All reactions