Avatar for Indridi

Indridi

Member since Mar 2022 • Last active Oct 2022
  • 2 conversations
  • 7 comments

Most recent activity

  • in Bangle.js
    Avatar for Indridi

    @uname (I'm user141090 - just changed the default user name to something that makes sense). Well, functionally it might be a "storm alert". It just displays the change over the past 3 hours along with the current value in a subdial behind the clock dial.

    You can check it out in my repo. It's split in two apps. First is a background widget to handle barometer readings :
    https://github.com/indridieinarsson/Bang­leApps/tree/master/apps/widbarom
    And then the clock face :
    https://github.com/indridieinarsson/Bang­leApps/tree/master/apps/ieclock
    which relies heavily on the clock construction kit (https://github.com/rozek/banglejs-2-anal­og-clock-construction-kit).

  • in Bangle.js
    Avatar for Indridi

    I'm using the barometer.

    Even made a clock face that shows falling/rising pressure (coming to an app loader near you soon!).
    @uname said :

    If it was reliable I think it is a good point in favor.

    I'm reading it every ten minutes, and applying a median filter with window-size of 3 samples (=30 minutes). This irons out most outliers, this way I find the barometer to be quite reliable.

    Not a crucial feature, but interesting.

  • in Bangle.js
    Avatar for Indridi

    Regarding the Bangle 2, daylight readable screen was probably the most important feature to me (besides, you know, all the other fantastic features...).

    Should there be a version 3, better waterproofing would be sitting very firmly on the top of my wish-list, making it a bit more of a "action watch" that one can wear while on the water (kayaking, in my case). More buttons a distant second.

  • in Bangle.js
    Avatar for Indridi

    I tried a firmware reset, to rule out that something I have installed was causing this. No change.

    Then I tried completely draining the battery (I understand that at least some of the components on the board always have electricity, unless the battery is dead). Leaving the GPS on for a night makes sure everything is thoroughly dead. After charging, barometer works again!

    Possibly related to this: I was working on some code that powers up the barometer, makes a reading and powers it down again every X minutes. Some logic that re-tries if the barometer returns 0 or undefined was botched, resulting in cascaded endless loops of power-on, read, power-off of the barometer. That might have put the barometer chip in a funny state.

    Indriði

  • in Bangle.js
    Avatar for Indridi

    Hi,
    I deleted all of my own code, to be sure errors in there weren't interfering. On 2v12.89, the code above results in this:

    >setInterval(() => {
    :  Bangle.getPressure().then(d => {
    :    console.log(d);
    :  });
    :}, 10 * 1000);
    =3
    { "temperature": 0, "pressure": 0, "altitude": 0 }
    { "temperature": 0, "pressure": 0, "altitude": 0 }
    { "temperature": 0, "pressure": 0, "altitude": 0 }
    { "temperature": 0, "pressure": 0, "altitude": 0 }
    { "temperature": 0, "pressure": 0, "altitude": 0 }
    

    Could the sensor have gotten damaged? Just 2 days ago, the barometer was working, and matching wonderfully with the local met office readings.
    Greetings,
    Indriði

  • in Bangle.js
    Avatar for Indridi

    Hi,

    I'm fiddling with the barometer on Bangle.js 2.
    On the releases 2v12, I had the issue that the first sample was always undefined (but fine after that). On 2v12.70, everything seemed to be ok, also the first sample. Then, for no good reason, I updated to 2v12.89, and now all calls to the barometer return 0 (also for temperature and altitude).

    I can't figure out which git commit Id corresponds to 2v12.70, so I can't go back to verify that everything works there still. But in the IDE, I can confirm that the barometer is on, and that this is reproducible.

    Greetings
    Indriði

  • in Bangle.js
    Avatar for Indridi

    Hi,
    I'm a first timer here. Fantastic project! I wasn't even looking for a smartwatch, but just had to have one, when I saw it :) .

    I'm trying to store barometer data for the past few hours (to indicate rising/falling pressure on a watch face).
    Current approach : use a widget as a background service. Using a timer, I power up the pressure sensor once or twice per hour, and store the data in a buffer (using fixed-size typed array in a ring-buffer fashion). The array buffer lives in the scope of the widget. Since the widget isn't graphical, it just has width=0 and an empty draw() function.
    However, whenever I leave the watch face, e.g. to open an app or go into settings, the widget seems to be reloaded. The buffer seems to have gone out of scope and gotten garbage-collected, as in the init code of the widget, it is undefined. I'm guessing that the WIDGETS global variable is

    I did a workaround where I write the buffer to flash storage each time I add a value, then re-initialize from that file when loading the widget. But it seems odd to be constantly writing to flash all the time, especially when it's data that is (relatively) short lived. But it does need the history of the past 1-2 hours to make sense.

    • Is there any way to make a service like this in bangle.js? Meaning something that starts when the watch is started, so that a variable may survive widget reloads?
    • Or as a backup plan - is there any way I can hook up to an event before the WIDGET variable is nuked, i.e. before widgets are loaded? That way I could save data to file only on that occasion, instead of scratching the flash constantly.
    • Or, as a backup plan, I guess I could use my own global variable to store the buffer. That feels a bit dirty, however. Would that be considered good practice (I'm not very experienced in javascript programming...).

    A bonus question, slightly related : Is there any event one could hook to, that fires before the watch is reset? Also with saving data to permanent storage in mind.

    btw - I'm running on fw 2v12.70

    Greetings, and thanks for a fantastic project!
    Indriði

Actions