Python script to set your PineTime (with Infinitime) to the current time, accurate to the nearest 1/256th of a second
Other features demonstrated:
- Get current watch time
- Read step count
- Send notification
big thanks to https://github.com/getsenic/gatt-python
Install Python requirements:
sudo pip3 install -r requirements.txtInstall system requirements:
sudo apt-get install python3-dbusPair your PineTime device to your machine with the bluetoothctl tool.
Run at the console:
bluetoothctlIf your device is already paired, you should see the device with your mac address like this:
[NEW] Device EF:C0:ED:C1:68:52 InfiniTimeYou can list all of the available bluetoothctl commands by running help and you will see the list, scan, and pair commands.
Once you have paired your device and recorded the mac address, run this command to set the time on the PineTime:
python3 sync-pinetime.py PINETIME-MAC-ADDRESS (E.g., EF:C0:ED:C1:68:52)- https://wiki.pine64.org/wiki/PineTime
- Bluetooth GATT SDK for Python -- https://github.com/getsenic/gatt-python
- InfiniTime docs --- https://github.com/InfiniTimeOrg/InfiniTime/blob/main/doc/ble.md#heart-rate
- dbus docs -- https://dbus.freedesktop.org/doc/dbus-python/dbus.html
- https://bluedot.readthedocs.io/en/latest/pairpipi.html#using-the-command-line
- https://codeberg.org/prograde/InfiniTime/src/branch/main/doc/MotionService.md