Avatar for tev

tev

Member since Jul 2023 • Last active Jul 2024
  • 6 conversations
  • 28 comments

Most recent activity

  • in Bangle.js
    Avatar for tev

    That's a neat idea putting it in the App Loader, it'd just require writing a file after we set the time. The only issue is that watch reboots between App Loader runs would knock out the timings, and so if it was automatic it's possible it could end up configuring the PPM difference wrong.

    I thought about that. Maybe a sanity check could be performed that makes sure the watch's reported time isn't too far off from actual time, and if it is, the recalculation of the drift could be skipped for that occasion (perhaps with a warning message printed on the console, if desired). Or else have a way to just let the user manually request when the drift should be calculated and the time be adjusted, perhaps.

  • in Bangle.js
    Avatar for tev

    Thinking about that, I wonder whether something could be added to https://banglejs.com/apps/?id=widadjust to allow it to figure out the drift using GPS.

    It would be pretty nice if it had some means of measuring its own drift. Years ago I wrote my own clock drift corrector for a HP 50g graphing calculator, though instead of using GPS it was just based on my periodically entering the correct date and time and manually pressing a button right on the second, at which point it would calculate the corresponding drift. Just a couple of iterations of this quickly made it more accurate than a $50 quartz Timex watch. :)

    If there was a way for the app to receive an event when connecting to the App Loader and updating the date/time, it could then compare the new value to the current clock along with the last known date/time of adjustment in order to determine the drift itself.

  • in Bangle.js
    Avatar for tev

    Okay, so I went back to 2v21 and waited about a day, and so far the clock drift seems more reasonable now, only about 4 seconds over the last day rather than 50+.

  • in Bangle.js
    Avatar for tev

    But I would like to inform you about a strange behavior: To be honest I did not checked the time before downgrade. But there is no reason for being totally wrong. But after flashing and restarting the clock showed 10:26 pm - but local time was 8:40 pm. After "set time" via web interface it showed the correct time 8:45 pm.

    Yeah, when I downgraded to 2v21 I noticed my clock jumped forward a couple of hours, even though the last GPS fix was a couple of days earlier. Can't say I've seen this happen before when changing firmware versions, but this is also the first time I've gone backward a revision rather than forward.

  • in Bangle.js
    Avatar for tev

    I was just going to post about the same issue with my Bangle.js 2. I am seeing a similar discrepancy, gaining over 50s per 24h. I believe I did start seeing this roughly around the time I upgraded to 2v22, so perhaps I will downgrade and see what happens.

    • 12 comments
    • 483 views
  • in Bangle.js
    Avatar for tev

    Ah, I see what happened. I thought I had updated my fork, but I was working on a different branch that got old. Now I see that readStorageJSON works. Thanks!

  • in Bangle.js
    Avatar for tev

    Ah, okay. But I swear that when I try to use Util.readStorageJSON from interface.html it definitely complains that the function doesn't exist, and I have to use readStorage instead. And in the browser console, autocomplete even shows Util.readStorage but not Util.readStorageJSON.

  • in Bangle.js
    Avatar for tev

    First of all, I totally misunderstood your link to the Storage documentation. I took it as the generic documentation for the Storage module and just now realized it was a special page that contained interface.html-specific information. Oops.

    Still, it doesn't seem all that straightforward what functions are available for Util, Puck, etc., that is, I can't find a reference. I can do Util.readStorage, for instance, but apparently not Util.readStorageJSON. Speaking of that, JSON.parse in the browser doesn't seem to like strings from storage files written on the Bangle.js with storage.writeJSON. I had to resort to parsing it with plain old eval instead.

    I got the local web server working on Linux, though. That was really easy. Just go into the root of my BangleApps project directory and run python3 -m http.server 8080 --bind 127.0.0.1. Then go to localhost:8080 in my browser, and that was pretty much it. :) I'm posting this here for future reference in case someone finds it helpful.

    I think I finally got my desired functionality working using Util.readStorage, though, with a bit of rewriting. There wasn't much code involved in simply printing out the contents from the app, so it's not so bad, I guess.

  • in Bangle.js
    Avatar for tev

    Never mind, I think I totally botched the syntax. It should be:

          function onInit() {
            Puck.eval("load('timestamplog.app.js')",­ output => {
              setTimeout(() => {
                Puck.eval("stampLog", output2 => {
                  document.getElementById("content").inner­HTML = output2;
                });
              }, 3000);
            });
          }
    

    My mind gets along much better with Python than this mess. :D

Actions