• Hi,
    the clock always becomes a reset to UTC, after uploading a file.
    A nice to have would be on uploading a widget file, the clock hangs until long press of BTN3. Maybe it's because the uploaded file is executed in a wrong context?

    best,
    Timo

  • Hi Timo,

    It's probably best to go into the IDE settings page, Communications, and uncheck Set Current Time.

    The time is set based on what the Web Browser reports, so if the browser is reporting a different timezone then that's what it'll attempt to use.

  • It seems GPS time always returning in UTC.

  • Wed 2020.04.01

    @Abhigkar isn't that a specification requirement, such that any GPS request is matched to a known entity?    e.g. up to requestor to perform and apply offset

    Still searching for a more concrete spec example, but the best explanation I've found so far:

    http://manuals.spectracom.com/VS/Content­/NC_and_SS/Com/Topics/TIME/SysTime_conf.­htm

  • It seems GPS time always returning in UTC.

    The GPS Time app? Or when it says 'getting time from GPS'? Or just the 'GPS' event?

  • I mean to get time from GPS.

    The clock get its time from GPS when started or re-started (bootloader.js)

    Bangle.on('GPS',function cb(g) {
          Bangle.setGPSPower(0);
          Bangle.removeListener("GPS",cb);
          if (!g.time || (g.time.getFullYear()<2000) ||
             (g.time.getFullYear()==2250)) {
            // GPS receiver's time not set - just boot clock anyway
            eval(clockApp);delete clockApp;
            return;
          }
          // We have a GPS time. Set time and reboot (to load alarms properly)
          setTime(g.time.getTime()/1000);
          load();
        });
    

    Here g.time returns an time object in UTC, which I guess is fine.

    My assumption was the GPS will detect the location and convert the time to local timezone. But I may be wrong...

    Another though, can we have event emitter defined in bootloader.js that emit global events when-

    • A second elapsed
    • A minute elapsed
    • An hour elapsed

    Any app will subscribe to these events to process the clock time update.
    This way we don't have to write separate timers in clock app to capture the time update.

    what is "The GPS Time app"

  • You can't simply "detect the location and convert the time to local timezone", this is a bigger problem. There is eg. an google maps api to do this (https://developers.google.com/maps/docum­entation/timezone/)

  • I guess there may be an issue if you have a nonzero timezone and then you get time from GPS? Not sure...

    what is "The GPS Time app"

    Go to https://banglejs.com/apps/, look up GPS Time

    can we have event emitter...

    I feel like that would probably end up being a bit of a waste of battery life if Bangle.js is having to fire off events whether they are being used or not? While modules aren't handled well at the moment, there is already http://www.espruino.com/Cron which looks like it'd do a good job.

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

Clock is reset to UTC after file upload with the web IDE

Posted by Avatar for user110935 @user110935

Actions