bosmoment / PineTime-apps

Firmware for the PineTime based on RIOT, NimBLE and LittleVGL
GNU Lesser General Public License v2.1
79 stars 32 forks source link
c embedded littlefs littlevgl nimble pinetime riot riot-os

Build Status

Bosmoment-style Pinetime firmware applications

Friendly firmware applications for the Pinetime!

This repository contains a number of applications and helper modules specific for the PineTime open source smartwatch.

Highlights:

Pre-build Binaries

Fresh binaries from the CI:

Features

And the default watch face screen includes:

Multiple watch faces are supported with smooth scrolling between the different faces. For now two dummy watch faces, one for notifications and one for activity, are included as proof of concept.

Structure

The project is separated into a number of directories:

Getting started

Repository setup

When checking out this repository, don't forget to initialize the RIOT submodule contained within this repository with:

git submodule init
git submodule update

Building applications

Applications are contained in the apps dir with a single application per directory. The pinetime application should give you a good starting point.

Use make all in the application directory to build the firmware, make flash to flash it on the target and make term to get a serial connection to the device.

Development

As the project is based on RIOT, it helps to get familiar with RIOT and check which functionality is provided by the OS. There is a quick start guide available for RIOT to get familiar with RIOT's build system and to validate your toolchain functionality. Doxygen-based API documentation is also available there.

Currently the Segger J-Link tools are used for flashing the application. It is possible to use a different programmer by overriding the settings in the Makefile.include for the pinetime board in the RIOT tree.

Bluetooth LE

Currently the firmware is always advertising if no connection is active. As soon as a host connects to the PineTime, the advertising is stopped and continues when the host disconnects.

Bonding is available and useable, but the bonds are not persistent between reboots. (see Planned features).

A custom UUID is included in the advertisement to recognise the device by:

9851dc0a-b04a-1399-5646-3b38788cb1c5

This UUID can be used for Bluetooth LE filters in Android and such. The device name itself can be customized to your liking and is not used for identifying the device.

Companion phone app

A fork of GadgetBridge is available with support for this firmware. The fork uses the custom UUID specified above to filter and identify the device.

The GadgetBridge app should pick up the device when scanning and allow pairing with the device. As long as the PineTime remembers the bond, the app and the Pinetime should be able to restore the secure connection.

The GadgetBridge fork is configured to only allow encrypted reads to the current time characteristic. The PineTime firmware automatically requests pairing when it receives an insufficient encryption error back from the app when requesting the time.

Tips

Planned features