Skip to content

Instantly share code, notes, and snippets.

View JF002's full-sized avatar

JF JF002

View GitHub Profile
JF002 / InfiniPaint.cpp
Created May 1, 2024 09:55
Drawing arbitrary buffer to the display of the PineTime by hacking the InfiniPaint application
#include "displayapp/screens/InfiniPaint.h"
#include "displayapp/DisplayApp.h"
#include "displayapp/LittleVgl.h"
#include "displayapp/InfiniTimeTheme.h"
#include <algorithm> // std::fill
using namespace Pinetime::Applications::Screens;
InfiniPaint::InfiniPaint(Pinetime::Components::LittleVgl& lvgl, Pinetime::Controllers::MotorController& motor)
JF002 /
Created December 9, 2023 09:10
Convert GPS data points from Seeedstudio LoRaWAN tracker from TTN MQTT to GeoJSON
import json
from datetime import datetime
file = open("data.log", "r")
lines = file.readlines()
JF002 / gist:f79a5514bca5da5c80686e6ad29fda85
Created May 18, 2023 10:21
How to build and run InfiniSim
# For this example, I'm working in /home/jf/git/test/
# [1] Clone InfiniTime
$ git clone
$ git submodule update --init --recursive
$ cd ..
# [2] Clone InfiniSim
$ git clone --recursive
$ git submodule update --init --recursive
JF002 / gist:bff230ae1192ac554249aaaa168d7237
Created July 18, 2020 11:44
How to flash Pinetime-JF
For those having issue with my firmware, here are some info:
- I build the code using gcc-arm-none-eabi-8-2019-q3-update and nRF5_SDK_15.3.0_59ac345. It might work with newer GCC but I haven't checked. Newer NRF52 SDK might need code change.
- If the CMake targets for flashing do not work, I would recommand to first try to flash the firmware manually (using JLink tools, OpenOCD, GDB, or any tool you're familiar with). It's not easy to provide scripts and command that'll work for anyone, as everyone use a different setup (ide, compiler, tools, debugger,...)
To do that, you can either use the files from the release, or the files you built yourself.
Release files :
- pinetime-app.hex is the standalone firmware. It should be flashed at address 0x00 and boots right away. It does not work with @lupyuen bootloader.
- pinetime-mcuboot-app.hex is the version of the firmware that works with the bootloader. BUT... MCUBoot (the bootloader) cannot work with this file directly, it must be converted into an "image"
JF002 / gist:46363d88c5aefcac0043dc47b4fa962b
Created March 21, 2020 09:29
Connect a Raspberrypi with a Pinetime and synchronize the time using CTS
# Build and run this project. This is the GATT server that implement the CTS server
Server GATT :
# Start a BLE scan to find the MAC_ADDRESS of your Pinetime
hcitool scan
# Optionally, get some info about your Pinetime
hcitool -leinfo --random MAC_ADDRESS
#Start bluetoothctl