itd is a daemon that uses my infinitime library to interact with the PineTime smartwatch running InfiniTime.
Go to file
Vyacheslav Chigrin 243826bd67 Fix crash in filesystem API (#69)
This help me fix #issues/64

Reviewed-on: Elara6331/itd#69
Reviewed-by: Elara <elara@elara.ws>

Fixes #64
Co-authored-by: Vyacheslav Chigrin <vyacheslav.chigrin@izba.dev>
Co-committed-by: Vyacheslav Chigrin <vyacheslav.chigrin@izba.dev>
2024-07-04 03:25:39 +00:00
.github Add FUNDING.yml 2023-12-15 16:11:00 -08:00
api Fix crash in filesystem API (#69) 2024-07-04 03:25:39 +00:00
cmd Add rewritten infinitime abstraction and integrate it into ITD 2024-04-13 21:20:12 -07:00
infinitime Prevent operations on a file once it's closed 2024-04-14 11:46:43 -07:00
internal Prevent operations on a file once it's closed 2024-04-14 11:46:43 -07:00
mpris Update domain 2023-04-20 19:54:58 -07:00
scripts Add go generate script for calculating version number 2022-11-17 21:27:36 -08:00
translit Run formatter 2023-01-03 09:18:57 -08:00
.gitignore Add itgui.desktop 2022-11-24 16:18:26 -08:00
.goreleaser.yaml Fix Nominatim geocoding 2024-06-04 15:00:42 -07:00
.woodpecker.yml Remove itgui CI config 2023-01-02 22:32:04 -08:00
calls.go Add rewritten infinitime abstraction and integrate it into ITD 2024-04-13 21:20:12 -07:00
config.go Update domain 2023-04-20 19:54:58 -07:00
fuse.go Add rewritten infinitime abstraction and integrate it into ITD 2024-04-13 21:20:12 -07:00
go.mod Add rewritten infinitime abstraction and integrate it into ITD 2024-04-13 21:20:12 -07:00
go.sum Add rewritten infinitime abstraction and integrate it into ITD 2024-04-13 21:20:12 -07:00
itd.service Initial Commit 2021-08-21 01:19:49 -07:00
itd.toml Add metrics collection via sqlite 2022-05-10 18:03:37 -07:00
itgui.desktop Add itgui.desktop 2022-11-24 16:18:26 -08:00
LICENSE Initial Commit 2021-08-21 01:19:49 -07:00
main.go Add rewritten infinitime abstraction and integrate it into ITD 2024-04-13 21:20:12 -07:00
Makefile Switch version.txt target to use go generate 2022-11-22 03:23:14 +00:00
maps.go Add rewritten infinitime abstraction and integrate it into ITD 2024-04-13 21:20:12 -07:00
metrics.go Add rewritten infinitime abstraction and integrate it into ITD 2024-04-13 21:20:12 -07:00
music.go Add rewritten infinitime abstraction and integrate it into ITD 2024-04-13 21:20:12 -07:00
notifs.go Add rewritten infinitime abstraction and integrate it into ITD 2024-04-13 21:20:12 -07:00
README.md Update LURE badges 2024-01-20 04:56:54 +00:00
socket.go Add rewritten infinitime abstraction and integrate it into ITD 2024-04-13 21:20:12 -07:00
version.go Add go generate script for calculating version number 2022-11-17 21:27:36 -08:00
waitgroup.go Update domain 2023-04-20 19:54:58 -07:00
weather.go Remove debug code 2024-06-04 15:17:24 -07:00

ITD

InfiniTime Daemon

itd is a daemon that uses my infinitime library to interact with the PineTime running InfiniTime.

status-badge itd-git AUR package itd-bin AUR package LURE badge for itd-git LURE badge for itd-bin

This repository is part of the Software Heritage Archive:

SWH


Features

  • Notification relay
  • Notification transliteration
  • Call Notifications (ModemManager)
  • Music control
  • Get info from watch (HRM, Battery level, Firmware version, Motion)
  • Set current time
  • Control socket
  • Firmware upgrades
  • Weather
  • BLE Filesystem
  • Navigation (PureMaps)
  • FUSE Filesystem

Installation

Since ITD 0.0.7, packages are built and uploaded whenever a new release is created.

Arch Linux

Use the itd-bin or itd-git AUR packages.

Debian/Ubuntu

  • Go to the latest release and download the .deb package for your CPU architecture. You can find your architecture by running uname -m in the terminal.
  • Run sudo apt install <package>, replacing <package> with the path to the downloaded file. Note: relative paths must begin with ./.
  • Example: sudo apt install ~/Downloads/itd-0.0.7-linux-aarch64.deb

Fedora

  • Go to the latest release and download the .rpm package for your CPU architecture. You can find your architecture by running uname -m in the terminal.
  • Run sudo dnf install <package>, replacing <package> with the path to the downloaded file.
  • Example: sudo dnf install ~/Downloads/itd-0.0.7-linux-aarch64.rpm

Alpine (and postmarketOS)

  • Go to the latest release and download the .apk package for your CPU architecture. You can find your architecture by running uname -m in the terminal.
  • Run sudo apk add --allow-untrusted <package>, replacing <package> with the path to the downloaded file.
  • Example: sudo apk add --allow-untrusted ~/Downloads/itd-0.0.7-linux-aarch64.apk

Note: --allow-untrusted is required because ITD isn't part of a repository, and therefore is not signed.


itctl

This daemon comes with a binary called itctl which uses the socket to control the daemon from the command line. As such, it can be scripted using bash.

This is the itctl usage screen:

NAME:
   itctl - A new cli application

USAGE:
   itctl [global options] command [command options] [arguments...]

COMMANDS:
   help            Display help screen for a command
   resources, res  Handle InfiniTime resource loading
   filesystem, fs  Perform filesystem operations on the PineTime
   firmware, fw    Manage InfiniTime firmware
   get             Get information from InfiniTime
   notify          Send notification to InfiniTime
   set             Set information on InfiniTime
   update, upd     Update information on InfiniTime
   watch           Watch a value for changes

GLOBAL OPTIONS:
   --socket-path value, -s value  Path to itd socket (default: "/tmp/itd/socket")

itgui

In cmd/itgui, there is a gui frontend to the socket of itd. It uses the Fyne library for Go.

Easy Installation

The easiest way to install itgui is to use my other project, LURE. LURE will only work if your package manager is apt, dnf, yum, zypper, pacman, or apk.

Instructions:

  1. Install LURE. This can be done with the following command: curl https://www.elara.ws/lure.sh | bash.
  2. Check to make sure LURE is properly installed by running lure ref.
  3. Run lure in itgui. This process may take a while as it will compile itgui from source and package it for your distro.
  4. Once the process is complete, you should be able to open and use itgui like any other app.

Compilation

Before compiling, certain prerequisites must be installed. These are listed on the following page: https://developer.fyne.io/started/#prerequisites

It can be compiled by running:

go build ./cmd/itgui

Cross-compilation

Due to the use of OpenGL, cross-compilation of itgui isn't as simple as that of itd and itctl. The following guide from the Fyne website should work for itgui: https://developer.fyne.io/started/cross-compiling.

Screenshots

Info tab

Motion tab

Notify tab

FS tab

FS mkdir

FS resource upload

Time tab

Firmware tab

Upgrade in progress

Metrics tab


Socket

This daemon creates a UNIX socket at /tmp/itd/socket. It allows you to directly control the daemon and, by extension, the connected watch.

The socket uses the DRPC library for requests. The code generated by this framework is located in internal/rpc

The API description is located in the internal/rpc/itd.proto file.


Starting

To start the daemon, run the following without root:

systemctl --user start itd

To autostart on login, run:

systemctl --user enable itd

Cross compiling

To cross compile, simply set the go environment variables. For example, for PinePhone, use:

make GOOS=linux GOARCH=arm64

This will compile itd and itctl for Linux aarch64 which is what runs on the PinePhone. This daemon only runs on Linux due to the library's dependencies (dbus, and bluez specifically).


Configuration

This daemon places a config file at /etc/itd.toml. This is the global config. itd will also look for a config at ~/.config/itd.toml.

Most of the time, the daemon does not need to be restarted for config changes to take effect.


Attribution

Location data from OpenStreetMap Nominatim, © OpenStreetMap contributors

Weather data from the Norwegian Meteorological Institute