Is it possible to sync Bangle.js 2 time to smartphone time?

Posted on
Page
of 5
First Prev
/ 5
  • https://www.espruino.com/Reference#l_E_g­etTemperature

    This one.

    Use the microcontroller's internal thermistor to work out the temperature.

  • Most likely

    Want me to test that? I have a raspberry pi 3B+.

    Would be much appreciated if you can provide a step by step guide to set the measuring up. I can probably gather it from the thread but it will take quite a bit of time.

  • That would be nice. Is it OK if I just give the compiled binary with installing instructions? (I could also give cross-compile instructions but that requires installing Rust etc. on separate computer and has only been tested in Debian 11.)

    Also this may require current (Debian 11 based) Raspberry Pi OS. I'm using the 32-bit OS currently.

  • Yes, current 32 Bit raspi os here as well. I am fine with the compiled binary, nothing on it which can be abused.

  • ok, here are quick instructions:

    Get ble-current-time-broadcast.bz2 and ble-current-time-broadcast.service
    from release 2022-02-04.

    You can just run extracted ble-current-time-broadcast directly in terminal, or if you want you can install it as service:

    ; much better time-syncing than default systemd-timesyncd
    sudo apt-get install chrony
    
    bunzip2 ble-current-time-broadcast.bz2
    sudo cp ble-current-time-broadcast /usr/local/bin
    sudo chmod +x /usr/local/bin/ble-current-time-broadcas­t
    sudo cp ble-current-time-broadcast.service /lib/systemd/system
    sudo systemctl daemon-reload
    sudo systemctl enable ble-current-time-broadcast
    sudo systemctl start  ble-current-time-broadcast
    

    If you didn't have chrony installed, then you should probably wait some time for it to stabilise.

    Then upload ppm_logger.js to Bangle.js 2, it will show one line per 10 minute interval (by default) with average/min/max temperatures, interval length in seconds and measured clock drift in PPM.

    Some variance in PPM is expected especially if using default 10 minute interval, so I usually let it run for some time.

    Here's what it looks like for me currently (I should probably add logging to file also):


    1 Attachment

    • ppm_logger.png
  • I assume (as a non-programmer) that the recent (interesting) posts aren't about trying to get the time from an iOS device. Do correct if that's wrong.

  • this is for Linux

  • I followed your steps, they worked perfectly. Here are my numbers.


    1 Attachment

    • download.png
  • Yep, that's clearly different. My Bangle.js 2 has about 63 PPM at 19 C and yours is around 71 PPM.

    btw, the graph I showed earlier was made with LibreOffice Calc: I measured some temperature/PPM pairs, made a chart of them in LibreOffice Calc and added trend line (polynomial, degree 2).

  • @jeffmer
    Any luck with Gordon's fix for using the iOS time?

  • Sadly, you still need to disconnect and reconnect to set things up properly. I think it would need to be done in the firmware to work efficiently.

  • Sadly, you still need to disconnect and reconnect to set things up properly.

    So you did try without disconnect and it does not work? Iphone refuses connection from Bangle when it is already connected to it in opposite direction? I was thinking ANCS works in same way. Normally Espruino can do connection while being connected to, never tried with same device though. Will test this between two nrf52 espruino devices, both connecting to the other one while having console on serial.

  • Yes, I think it is more to do with the internal Gatt structure not getting set up properly. I have not fully debugged as I only tried it on a Bangle - need to try it on a dongle to see all the error messages.

  • Does that mean disconnecting and reconnecting only once? Or how often?

    (A further question: how much of your code is needed, and how should that be used for a given watch script?)

  • I assume from the above multiple discussions of some weeks ago that the Bangle.js cannot use Apple's iOS time service in an efficient and reliable manner to regulate the watch's timekeeping via an iPhone. If that's incorrect, it would be helpful if someone would elaborate.

    Meanwhile, other ways of regulation are being created (not by me).

  • I think its fine if you want to synchronise with the iPhone once a day, however, at the moment, as it seems to involve disconnection/reconnection, it would not be advisable to do it at a much greater frequency.

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

Is it possible to sync Bangle.js 2 time to smartphone time?

Posted by Avatar for malaire @malaire

Actions